NestJS · Senior · Question 20 of 75
How would you structure a large Nest codebase to keep boundaries clear?
- ✓Correct answer: Feature (bounded-context) modules with explicit exports, a thin application layer, domain logic independent of Nest, and infrastructure adapters behind tokens
- 2One module with all providers
- 3Group files by type: all controllers, all services, all entities
Explanation
Keeping domain code free of framework decorators makes it testable and portable. Lint rules can forbid imports across module boundaries.