# Batteries included

Source: https://docs.nestjs.com/faq/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](/observability/overview) for tracing and error monitoring, and the official agent skills for coding agents. See [First steps](/first-steps).

These come with the core, with no extra package:

| Need | What Nest gives you |
| --- | --- |
| Validate request bodies, parameters and queries | [Validation pipes](/application/validation), with class-validator classes or Zod, Valibot, ArkType and other Standard Schema libraries |
| Shape and filter responses | [Serialization](/application/serialization) |
| Protect routes and handle errors | [Guards](/guards), [interceptors](/interceptors) and [exception filters](/exception-filters) |
| Security headers, CSRF protection and CORS | [Security headers](/security/helmet), [CSRF protection](/security/csrf) and [CORS](/security/cors), on every HTTP adapter |
| Cookies | [Cookies](/http/cookies), on every HTTP adapter |
| File uploads | [File upload and streaming](/http/file-upload), with type and size validators. On Fastify, install `@fastify/multipart` as well |
| Stream responses and server-sent events | [Streaming responses](/http/streaming-responses) and [Server-Sent Events](/http/server-sent-events) |
| Version an API | [Versioning](/http/versioning) |
| Logging | [Logger](/application/logger) |
| Lifecycle hooks and graceful shutdown | [Lifecycle events](/fundamentals/lifecycle-events) |
| An interactive console into a running application | [REPL](/recipes/repl) |
| Run on Express, Fastify or `node:http` | [HTTP adapters](/http/performance) |

#### 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](/security/authentication) |
| Permissions checked in policies | `@nestjs/authorization` | [Authorization](/security/authorization) |
| Rate limiting | `@nestjs/throttler` | [Rate limiting](/security/rate-limiting) |
| Sign and verify JWTs | `@nestjs/jwt` | [Passport (auth)](/recipes/passport) |

**Data**

| Need | Package | Chapter |
| --- | --- | --- |
| SQL with Drizzle ORM | `@nestjs/drizzle` | [Drizzle](/data/drizzle) |
| SQL with TypeORM | `@nestjs/typeorm` | [TypeORM](/data/typeorm) |
| SQL with Sequelize | `@nestjs/sequelize` | [Sequelize](/data/sequelize) |
| MongoDB with Mongoose | `@nestjs/mongoose` | [MongoDB](/data/mongodb) |
| Caching | `@nestjs/cache-manager` | [Caching](/data/caching) |

**Application services**

| Need | Package | Chapter |
| --- | --- | --- |
| Configuration and environment variables | `@nestjs/config` | [Configuration](/application/configuration) |
| Background jobs | `@nestjs/bullmq` | [Queues](/application/queues) |
| Cron jobs, intervals and timeouts | `@nestjs/schedule` | [Task scheduling](/application/task-scheduling) |
| In-process events | `@nestjs/event-emitter` | [Events](/application/events) |
| Calls to other HTTP APIs | `@nestjs/http-client` | [HTTP client](/application/http-client) |
| Email from templates, over SMTP or an email API | `@nestjs/mail` | [Mail](/application/mail) |
| Files in a local folder, S3 or an S3-compatible store, with signed URLs | `@nestjs/storage` | [File storage](/application/file-storage) |
| Translations | `@nestjs/i18n` | [Internationalization](/application/i18n) |
| Static files | `@nestjs/serve-static` | [Serve static](/recipes/serve-static) |
| Commands, queries and events kept apart | `@nestjs/cqrs` | [CQRS](/recipes/cqrs) |

**Reliability**

| Need | Package | Chapter |
| --- | --- | --- |
| Retries, timeouts and circuit breakers | `@nestjs/resilience` | [Resilience](/reliability/resilience) |
| Requests that are safe to repeat | `@nestjs/idempotency` | [Idempotency keys](/reliability/idempotency) |
| Messages sent in the same transaction as the data | `@nestjs/outbox` | [Transactional outbox](/reliability/outbox) |
| Long-running processes that survive restarts | `@nestjs/workflows` | [Durable workflows](/reliability/workflows) |
| One instance at a time doing a piece of work | `@nestjs/locks` | [Distributed locks](/reliability/locks) |
| Webhooks: signed and retried when you send them, verified when you receive them | `@nestjs/webhooks` | [Webhooks](/http/webhooks) |
| Health checks | `@nestjs/terminus` | [Health checks](/reliability/terminus) |

**APIs and transports**

| Need | Package | Chapter |
| --- | --- | --- |
| OpenAPI documents and Swagger UI | `@nestjs/swagger` | [OpenAPI](/openapi/introduction) |
| GraphQL, with Apollo or Mercurius | `@nestjs/graphql` | [GraphQL](/graphql/quick-start) |
| WebSockets, with Socket.IO or `ws` | `@nestjs/websockets` | [Gateways](/websockets/gateways) |
| Redis, MQTT, NATS, RabbitMQ, Kafka and gRPC transports | `@nestjs/microservices` | [Microservices](/microservices/basics) |
| MCP servers for AI assistants | `@nestjs/mcp` | [MCP](/mcp/overview) |

**AI**

| Need | Package | Chapter |
| --- | --- | --- |
| Language models, agents that call your providers as tools, and embeddings | `@nestjs/ai` | [AI](/ai/overview) |

**Observability and operations**

| Need | Package | Chapter |
| --- | --- | --- |
| Tracing, error monitoring and logs, with NestJS Observe | `@nestjs/observe` | [Observability](/observability/overview) |
| A live graph of modules, providers and routes | `@nestjs/devtools-integration` | [Devtools](/devtools/overview) |
| Deployment to AWS with Mau | `@nestjs/mau` | [Deployment](/deployment) |

**Tooling**

| Need | Package | Chapter |
| --- | --- | --- |
| Generate projects, modules, resources and libraries | `@nestjs/cli` | [CLI](/cli/overview) |
| Unit and end-to-end tests that replace providers | `@nestjs/testing` | [Testing](/fundamentals/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](/data/prisma) and [MikroORM](/data/mikroorm) have integrations of their own, so you work with the ORM your team knows. [Data](/data/overview) 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/ai` builds on the AI SDK, so it works with the provider package of the models you use, such as `@ai-sdk/anthropic` or `@ai-sdk/openai`.
- **Your frontend.** Nest builds the backend for web and mobile apps alike. It renders server-side pages with [Model-View-Controller](/http/mvc), and a separate frontend such as [Next.js](/recipes/nextjs) 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](/data/drizzle), [TypeORM](/data/typeorm) and [Sequelize](/data/sequelize) for SQL databases, and [Mongoose](/data/mongodb) for MongoDB. Each registers the database connection, and the ORM's models or repositories, as providers you inject. Most of the [tutorials](/tutorials/overview) use Drizzle, and [Data](/data/overview) compares them.

##### Does Nest have built-in authentication?

Yes: [`@nestjs/authentication`](/security/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`](/security/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](/http/mvc), but most applications pair it with a separate frontend, such as [Next.js](/recipes/nextjs), 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](/first-steps) creates the project, and the [tutorials](/tutorials/overview) add the packages an application needs one chapter at a time.

#### See them together

Each [tutorial](/tutorials/overview) builds a complete application from an empty project, and most combine several of these packages: the [multi-tenant SaaS backend](/tutorials/multi-tenant-saas) and the [e-commerce backend](/tutorials/ecommerce-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](/faq/nest-vs-fastify-express-hono). If you're coming from another batteries-included framework, the guides for [Laravel](/migrating/laravel), [Django](/migrating/django), [Spring Boot](/migrating/spring-boot) and [ASP.NET Core](/migrating/aspnet-core) map its concepts to Nest.
