Fundamentals for NestJSs
NestJS fundamentals are the building blocks every app uses: controllers that handle routes, providers that hold logic and are injected by the container, and modules that group them. Together with the request pipeline of middleware, guards, interceptors and pipes, they define how a request becomes a response.
Stage: Core Concepts · Part of the NestJS roadmap · Last reviewed 19 November 2026
What to learn in Fundamentals
- Create a controller with route decorators like @Get and @Post
- Write an injectable service and inject it through the constructor
- Group related code into a feature module and export providers
- Order middleware, guards, interceptors and pipes in the request lifecycle
- Use the Nest CLI to generate resources
Fundamentals interview questions
What is dependency injection in NestJS?
Nest has an inversion of control container. Classes marked @Injectable are registered as providers in a module, and Nest creates them and passes them to constructors that declare them as parameters. This keeps classes loosely coupled and easy to replace in tests.
What is the order of the NestJS request lifecycle?
An incoming request passes through middleware, then guards, then interceptors (before), then pipes, then the route handler. The response returns through interceptors (after) and any exception filters if an error was thrown.
Where Fundamentals fits in the NestJS roadmap
Fundamentals belongs to the Core Concepts stage (beginner level), which takes about 20 hours. The building blocks.
Other units in this stage
Back to the full NestJS roadmap