NestJS + TypeScript
Use when the server is NestJS. Do not introduce a second Express app alongside it unless the user asked.
Module paths are defaults. Real directories come from the implement/tdd recon of package.json and tsconfig.json (monorepo, paths).
Defaults
- Feature modules, injectable providers, constructor DI.
- Validation:
class-validator+ValidationPipe(whitelist) or a typed schema pipe. DTOs are TypeScript classes/types, not looseany. - Authz: guards on controllers. Do not hide authorization only in a random middleware file.
- Config:
ConfigModule; typed config keys. Do not print secrets in chat.
When Express is enough
A tiny JSON API with a handful of routes can stay on express-api. Nest pays off with multiple modules, shared guards, and a growing team.
Do not
- Mix Nest HTTP and a parallel Express server in the same process without an explicit architecture decision.