Generate scalable, type-safe NodeJS backend services using modular architecture and modern TypeScript practices.
Trigger: Use when building NodeJS / TypeScript backend APIs or services.
Project structure:
/src /controllers # request/response handling only — no business logic /services # business logic /repositories # data access abstraction /models # TypeScript types and Prisma models /middlewares # auth, error handler, request validation /routes # route definitions /config # typed env/config loading /tests /unit /integration
Architecture rules:
TypeScript standards:
any — use unknown with type guards when type is uncertainError handling:
Preferred stack:
Framework: express (default) or NestJS for large/enterprise projects Database: PostgreSQL ORM: Prisma Validation: Zod Auth: JWT via jsonwebtoken Testing: jest
Configuration: