Node Api

Node-Api with Javascript-Typescript

Project templateframeworksMIT5 source files

Before you use this component

This is a third-party source bundle, not an installation into your account. UI Discovery has checked the available redistribution license evidence; runtime behavior has not been tested. Review all files, use a disposable project first, and do not enable scripts or hooks until you understand their permissions.

Some integrations require separately installed software, API keys or paid services. Credentials and subscriptions are not included. These are Claude Code resources; other clients may require adaptation.

Extract the ZIP into a temporary folder, inspect its entry file and supporting resources, then follow the original instructions. Do not overwrite an existing project configuration blindly. Keep the bundled license and attribution notices.

Source publisher
Claude Code Templates
Creator supplied by source
Not listed in source
Pinned source version
a344359459263d73d8948651c789244093c02e4e
License evidence
LICENSE

Source preview

cli-tool/templates/javascript-typescript/examples/node-api/CLAUDE.md

# CLAUDE.md - Node.js API

This file provides guidance to Claude Code when working with Node.js API applications using TypeScript.

## Project Type

This is a Node.js API application with TypeScript and Express.js support.

## Development Commands

### API Development
- **`/route`** - Create API routes and endpoints
- **`/middleware`** - Create and manage Express middleware
- **`/api-endpoint`** - Generate complete API endpoints
- **`/database`** - Set up database operations and models

### Testing and Quality
- **`/test`** - Run tests and create test files
- **`/lint`** - Run linting and fix code style issues
- **`/typescript-migrate`** - Migrate JavaScript files to TypeScript

### Development Workflow
- **`/npm-scripts`** - Run npm scripts and package management
- **`/debug`** - Debug Node.js applications
- **`/refactor`** - Refactor and optimize code

## Framework-Specific Guidelines

### Express.js Best Practices
- Use middleware for cross-cutting concerns
- Implement proper error handling
- Follow RESTful API design principles
- Use proper HTTP status codes

### Database Integration
- Use TypeORM, Prisma, or Mongoose for database operations
- Implement proper connection pooling
- Use migrations for database schema changes
- Follow repository pattern for data access

### Security Considerations
- Implement authentication and authorization
- Use HTTPS in production
- Validate and sanitize input data
- Implement rate limiting and CORS

### Error Handling
- Use centralized error handling middleware
- Implement proper logging
- Return consistent error responses
- Handle async errors properly

## TypeScript Configuration

The project uses strict TypeScript configuration:
- Strict type checking enabled
- Proper interface definitions for requests/responses
- Generic type support for database models
- Integration with Express types

## API Design Patterns

### RESTful Routes
```
GET    /api/users      - Get all users
GET    /api/users/:id  - Get user by ID
POST   /api/users      - Create new user
PUT    /api/users/:id  - Update user
DELETE /api/users/:id  - Delete user
```

### Request/Response Structure
- Use consistent JSON response format
- Implement proper status codes
- Include metadata in responses
- Handle pagination properly

## Testing Strategy

- Unit tests with Jest
- Integration tests for API endpoints
- Database testing with test databases
- Load testing for performance validation

## File Naming Conventions

- Routes: `routeName.routes.ts` (e.g., `user.routes.ts`)
- Controllers: `ControllerName.controller.ts`
- Models: `ModelName.model.ts`
- Middleware: `middlewareName.middleware.ts`
- Services: `ServiceName.service.ts`
- Tests: `fileName.test.ts`

## Recommended Libraries

- **Framework**: Express.js, Fastify, Koa.js
- **Database**: Prisma, TypeORM, Mongoose
- **Authentication**: Passport.js, JWT, Auth0
- **Validation**: Joi, Yup, Zod
- **Testing**: Jest, Supertest, Artillery
- **Documentation**: Swagger/OpenAPI, Postman
- **Monitoring**: Winston, Morgan, Prometheus

Preview capped at 60,000 characters. Download the bundle for every original file and notice.

Read the redistribution license
MIT License

Copyright (c) 2025 Daniel (San) Ávila

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Bundle SHA-256: edf88136a8ea78eff76f907a4bec06e8d1567622ba4d40c558bd77371cc6d1ef. Files are served as downloads and are never executed by this page.