Favicon of nest

nest

NestJS is a TypeScript/JavaScript framework for building scalable Node.js server applications with a modular, Angular-inspired architecture.

Nest is a Node.js framework for building server-side applications with TypeScript (JavaScript is also supported). It targets developers who want an opinionated application architecture out of the box instead of assembling one from scratch with Express or Fastify and a pile of libraries. If you've used Angular on the frontend, the module/provider/decorator patterns will feel familiar.

Under the hood, Nest runs on Express by default but can swap in Fastify for better throughput. It combines object-oriented, functional, and reactive programming patterns, and it's built to keep applications loosely coupled, testable, and maintainable as they grow past a simple API into something closer to enterprise scale.

Key features

  • Modular architecture: applications are organized into modules, controllers, and providers with dependency injection baked in, similar to Angular's structure.
  • HTTP adapter flexibility: runs on Express by default, with the option to switch to Fastify for performance-sensitive workloads.
  • TypeScript-first, JavaScript-compatible: written in and designed for TypeScript, but plain JavaScript projects work too.
  • Microservices support: has built-in patterns for building microservices, not just monolithic REST APIs.
  • Decorator-based design: routes, guards, pipes, interceptors, and middleware are all wired up through decorators, keeping controller code declarative.
  • Testability by design: the dependency injection system makes mocking and unit testing providers and controllers straightforward.
  • Large ecosystem: official packages cover GraphQL, WebSockets, CQRS, config, and more, on top of the wide npm ecosystem it inherits from Express/Fastify.

Ideal use cases

Nest fits teams building REST or GraphQL APIs, microservices, or backend systems that need to stay maintainable as they scale in size and team headcount. It's a good choice if you want enforced structure (modules, services, controllers) rather than deciding conventions yourself, and if you're already comfortable with TypeScript and decorator-heavy code.

It also works well for teams migrating from Angular to full-stack TypeScript, since the mental model carries over directly. Microservices architectures benefit from its built-in transport abstractions (TCP, Redis, gRPC, and others via official packages).

It's not a good fit for very small scripts, simple single-file APIs, or projects where you want minimal framework overhead and full control over routing without decorators and DI. If your team is not on TypeScript/JavaScript, or you need something lighter than a full framework (like a bare Express app or a serverless function), Nest adds more structure than you need.

Installation

The standard way to start a Nest project is with the Nest CLI:

npm i -g @nestjs/cli
nest new project-name

This scaffolds a new application with a working module, controller, and service, along with TypeScript config, testing setup, and scripts for running in development and production. From there:

cd project-name
npm run start:dev

Core packages (@nestjs/core, @nestjs/common) are published on npm and can also be added to an existing Node.js project manually if you don't want to use the CLI scaffold. Full setup and configuration details are documented at docs.nestjs.com.

For questions and support, the project points users to its Discord channel rather than GitHub issues, which are reserved for bug reports and feature requests.

Categories:

Frequently asked questions

Share:

Stars
76.1K
Forks
8.3K
Last commit
17 hours ago
Repository age
9 years
License
MIT
Self-hosted
No
Activity score
88/100
View Repository
Built with:

Similar to nest

Favicon

 

  
  
Favicon

 

  
  
Favicon