# Key Takeaways — NestJS

Source: https://www.geekswithgeeks.com/en/nestjs/nestjs-recap

> Essential concepts and patterns you should know.

## The NestJS triangle

**Modules** organize your app, **Controllers** handle requests, **Services** contain logic. Everything is tied together by **Dependency Injection**.

## Request lifecycle

Middleware → Guards → Pipes → Interceptors (before) → Controller/Handler → Interceptors (after) → Filters. Learn this flow to debug correctly.

## Database patterns

Use DTOs for input; repositories for data access; migrations for schema. Keep business logic in services, queries in repositories.
