Angular-style architecture for Node.js — TypeScript-first, decorator-driven, and built around dependency injection. The opinionated framework Express never was.
← Back to Server Side@Get(), @Post(), @Body(), @Inject().@Injectable() export class ProductsService { constructor(private readonly repo: ProductsRepository) {} findAll() { return this.repo.find(); } } @Controller('products') export class ProductsController { constructor(private readonly service: ProductsService) {} @Get() getAll() { return this.service.findAll(); } @Post() create(@Body() dto: CreateProductDto) { return this.service.create(dto); } } @Module({ controllers: [ProductsController], providers: [ProductsService, ProductsRepository], }) export class ProductsModule {}
Nest's IoC container assembles your app from modules at startup. Providers can be singletons, request-scoped, or transient. Eliminates manual wiring as the codebase grows.
ValidationPipe + class-validator).Same architecture supports REST, GraphQL, gRPC, WebSockets, and microservice transports (Kafka, NATS, Redis, RabbitMQ) — swap via configuration.
| Module | Purpose |
|---|---|
| @nestjs/typeorm / mongoose / prisma | ORM integrations. |
| @nestjs/config | Typed config & .env loading. |
| @nestjs/swagger | Auto OpenAPI docs from decorators. |
| @nestjs/jwt + Passport | Authentication strategies. |
| @nestjs/bull | Redis-backed job queues. |
| @nestjs/microservices | Polyglot transports. |
Imposed structure pays off as headcount grows.
End-to-end typed APIs with class-validator + Swagger.
Same code, multiple transports — REST + Kafka + gRPC.
Familiar OOP + DI patterns ease the jump.