NestJS
Dependency injection, request lifecycle, validation, and database integration.
Why use a DTO and ValidationPipe?
A DTO describes the data a boundary accepts or returns, while ValidationPipe checks and optionally transforms incoming values at runtime. TypeScript types alone cannot validate a network payload because they are erased. Decorated DTO classes make the rules available to the validation mechanism.
How should authentication and permissions work?
Authentication establishes who the caller is, and permissions determine which actions and records that caller may access. In Nest, guards commonly apply these checks before controller execution, often using Passport strategies for authentication. Resource-level checks still need enough context to enforce ownership and tenant rules.
Difficulty is an editorial estimate. Completion means you chose to mark a question as understood.