Backend

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

neuron-one 11e50eb 1.2 KB Updated

File contents

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

neuron-one/godmode/tree/main/skills/development/backend commit 11e50ebe2e

Frequently asked questions

npx skillmds@latest add neuron-one/backend