Learn NestJS.
Learn dependency injection, validation, and application structure.
NestJS essentials
Start with the essentials or pick the concept you need.
01Modules & dependency injectionExplore concepts
02Request lifecycleExplore concepts
03Validation & authorizationExplore concepts
04Database integrationExplore concepts
05Background work & deploymentExplore concepts
What you will study in NestJS
Focused lessons organized by concept. Start with the explanation, trace the examples, and check your recall before moving on.
Modules & dependency injection
Nest modules define feature boundaries and register the controllers and providers that belong to a feature. Controllers handle transport concerns, while services usually contain business rules. This separation makes code easier to reuse and test without tying every decision to HTTP.
Request lifecycle
The request lifecycle is the order in which Nest processes an incoming request and produces a response. Different extension points handle different concerns, such as access checks, input conversion and response wrapping. Knowing the order helps explain why code in one stage cannot rely on work that happens later.
Validation & authorization
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.
Database integration
TypeORM and Sequelize are object-relational mappers for relational databases, while Mongoose models documents in MongoDB. They provide convenient data-access APIs but do not replace database knowledge. The generated queries, constraints and transaction behavior still determine correctness and performance.
Background work & deployment
A background job moves work out of the immediate request path, while a scheduled task starts work at a chosen time. Nest can integrate with queues and schedulers, but reliable execution still requires durable state and coordination. Multiple app instances can run the same schedule unless one owner or a distributed coordination mechanism is used.