Batteries included
Nest is a batteries-included Node.js framework, with first-party packages for authentication, data access, queues, mail, file storage, observability and AI. Together with the core, they cover what a backend needs beyond routing, from validation and configuration to GraphQL, WebSockets, microservices, OpenAPI and testing. This page lists them by need, with the chapter that documents each one.
Each battery is its own package, so a project installs only what it uses, and they plug in the same way: a module you import, providers you inject, and decorators on your classes.
What a new project starts with#
nest new generates a TypeScript project with modules, dependency injection, an HTTP server, a test setup, and scripts to build, run and watch it. The CLI also sets up NestJS Observe for tracing and error monitoring, and the official agent skills for coding agents. See First steps.
These come with the core, with no extra package:
| Need | What Nest gives you |
|---|---|
| Validate request bodies, parameters and queries | Validation pipes, with class-validator classes or Zod, Valibot, ArkType and other Standard Schema libraries |
| Shape and filter responses | Serialization |
| Protect routes and handle errors | Guards, interceptors and exception filters |
| Security headers, CSRF protection and CORS | Security headers, CSRF protection and CORS, on every HTTP adapter |
| Cookies | Cookies, on every HTTP adapter |
| File uploads | File upload and streaming, with type and size validators. On Fastify, install @fastify/multipart as well |
| Stream responses and server-sent events | Streaming responses and Server-Sent Events |
| Version an API | Versioning |
| Logging | Logger |
| Lifecycle hooks and graceful shutdown | Lifecycle events |
| An interactive console into a running application | REPL |
Run on Express, Fastify or node:http | HTTP adapters |
First-party packages, by need#
The packages below are maintained by the Nest core team. Install the ones a project needs with npm.
Security
| Need | Package | Chapter |
|---|---|---|
| Sign-in with passwords, sessions, access and refresh tokens, two-factor authentication, magic links, OpenID Connect and API keys | @nestjs/authentication | Authentication |
| Permissions checked in policies | @nestjs/authorization | Authorization |
| Rate limiting | @nestjs/throttler | Rate limiting |
| Sign and verify JWTs | @nestjs/jwt | Passport (auth) |
Data
| Need | Package | Chapter |
|---|---|---|
| SQL with Drizzle ORM | @nestjs/drizzle | Drizzle |
| SQL with TypeORM | @nestjs/typeorm | TypeORM |
| SQL with Sequelize | @nestjs/sequelize | Sequelize |
| MongoDB with Mongoose | @nestjs/mongoose | MongoDB |
| Caching | @nestjs/cache-manager | Caching |
Application services
| Need | Package | Chapter |
|---|---|---|
| Configuration and environment variables | @nestjs/config | Configuration |
| Background jobs | @nestjs/bullmq | Queues |
| Cron jobs, intervals and timeouts | @nestjs/schedule | Task scheduling |
| In-process events | @nestjs/event-emitter | Events |
| Calls to other HTTP APIs | @nestjs/http-client | HTTP client |
| Email from templates, over SMTP or an email API | @nestjs/mail | |
| Files in a local folder, S3 or an S3-compatible store, with signed URLs | @nestjs/storage | File storage |
| Translations | @nestjs/i18n | Internationalization |
| Static files | @nestjs/serve-static | Serve static |
| Commands, queries and events kept apart | @nestjs/cqrs | CQRS |
Reliability
| Need | Package | Chapter |
|---|---|---|
| Retries, timeouts and circuit breakers | @nestjs/resilience | Resilience |
| Requests that are safe to repeat | @nestjs/idempotency | Idempotency keys |
| Messages sent in the same transaction as the data | @nestjs/outbox | Transactional outbox |
| Long-running processes that survive restarts | @nestjs/workflows | Durable workflows |
| One instance at a time doing a piece of work | @nestjs/locks | Distributed locks |
| Webhooks: signed and retried when you send them, verified when you receive them | @nestjs/webhooks | Webhooks |
| Health checks | @nestjs/terminus | Health checks |
APIs and transports
| Need | Package | Chapter |
|---|---|---|
| OpenAPI documents and Swagger UI | @nestjs/swagger | OpenAPI |
| GraphQL, with Apollo or Mercurius | @nestjs/graphql | GraphQL |
WebSockets, with Socket.IO or ws | @nestjs/websockets | Gateways |
| Redis, MQTT, NATS, RabbitMQ, Kafka and gRPC transports | @nestjs/microservices | Microservices |
| MCP servers for AI assistants | @nestjs/mcp | MCP |
AI
| Need | Package | Chapter |
|---|---|---|
| Language models, agents that call your providers as tools, and embeddings | @nestjs/ai | AI |
Observability and operations
| Need | Package | Chapter |
|---|---|---|
| Tracing, error monitoring and logs, with NestJS Observe | @nestjs/observe | Observability |
| A live graph of modules, providers and routes | @nestjs/devtools-integration | Devtools |
| Deployment to AWS with Mau | @nestjs/mau | Deployment |
Tooling
| Need | Package | Chapter |
|---|---|---|
| Generate projects, modules, resources and libraries | @nestjs/cli | CLI |
| Unit and end-to-end tests that replace providers | @nestjs/testing | Testing |
Works with what you already use#
The batteries plug into the services and libraries your team already runs:
- Your database. First-party packages integrate Drizzle, TypeORM, Sequelize and Mongoose, and Prisma and MikroORM have integrations of their own, so you work with the ORM your team knows. Data compares them.
- Your infrastructure. Background jobs run on Redis, through BullMQ. Mail goes out over SMTP or an email provider's API, and files are kept in a local folder or a bucket such as S3 or R2.
- Any model provider.
@nestjs/aibuilds on the AI SDK, so it works with the provider package of the models you use, such as@ai-sdk/anthropicor@ai-sdk/openai. - Your frontend. Nest builds the backend for web and mobile apps alike. It renders server-side pages with Model-View-Controller, and a separate frontend such as Next.js can share types with the API.
Common questions#
What does batteries-included mean?#
A batteries-included framework ships, next to routing, the pieces most applications need: sign-in, permissions, data access, configuration, background jobs, email and testing, maintained by one team and built to work together. A minimal framework, such as Express, leaves each of those choices to you. Nest takes the batteries-included approach, and keeps each battery an optional package.
Is NestJS batteries-included?#
Yes. Besides routing, validation and dependency injection in the core, the Nest team maintains the packages listed on this page, from authentication and queues to webhooks, workflows, GraphQL, WebSockets, mail and translations. Nest is written in TypeScript and every package is typed, so it's also a batteries-included TypeScript framework.
Does Nest have an ORM?#
Nest has first-party packages for four: Drizzle, TypeORM and Sequelize for SQL databases, and Mongoose for MongoDB. Each registers the database connection, and the ORM's models or repositories, as providers you inject. Most of the tutorials use Drizzle, and Data compares them.
Does Nest have built-in authentication?#
Yes: @nestjs/authentication signs users in with passwords, sessions, access and refresh tokens, two-factor authentication, magic links, OpenID Connect providers such as Google, and API keys, with no Passport strategies to configure. @nestjs/authorization checks permissions in policies.
Is Nest a full-stack framework?#
Nest is a backend framework. It can render server-side pages with Model-View-Controller, but most applications pair it with a separate frontend, such as Next.js, a mobile app, or both.
How do I add a battery?#
Install its package with npm and import its module in your AppModule, as each chapter shows. First steps creates the project, and the tutorials add the packages an application needs one chapter at a time.
See them together#
Each tutorial builds a complete application from an empty project, and most combine several of these packages: the multi-tenant SaaS backend and the e-commerce backend, for example. Each tutorial has a matching example repository on GitHub.
To compare Nest with minimal frameworks, see Nest vs Fastify, Express and Hono. If you're coming from another batteries-included framework, the guides for Laravel, Django, Spring Boot and ASP.NET Core map its concepts to Nest.

