# Backend

> NestJS and Node.js backend development. REST APIs, middleware, guards, DTOs, database integration. Don't use for Python backends or frontend code.

- Skill: `neuron-one/backend` (Agent Skill)
- Install (CLI): `npx skillmds@latest add neuron-one/backend`
- Raw SKILL.md: https://api.skillmd.com/api/skills/neuron-one/backend/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: neuron-one (https://skillmd.com/u/neuron-one)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/neuron-one/backend

---


# Backend Development

## NestJS Patterns
- Module-based architecture
- Dependency injection for all services
- DTOs with class-validator for input validation
- Guards for authentication/authorization
- Interceptors for logging/transformation
- Exception filters for consistent error responses

## API Design
- RESTful naming: plural nouns, HTTP verbs
- Consistent response format: { data, meta, errors }
- Pagination for list endpoints
- Proper HTTP status codes (201 created, 204 no content)
- API versioning: /api/v1/

## Database
- Repository pattern for data access
- Migrations for schema changes (never manual)
- Indexes on frequently queried columns
- Transactions for multi-table operations

## Security
- Input validation on EVERY endpoint
- Rate limiting on sensitive endpoints
- CORS configuration (specific origins)
- Helmet for security headers
- Never trust client-side data

## Error Handling
- Custom exception classes
- Consistent error format across API
- Log errors with context (request ID, user)
- Don't expose internal errors to client
