← All open source projects

NestJS

nestjs/nest

NestJS is a TypeScript framework for Node.js server applications with modules, controllers, providers, and dependency injection.

Forks 8,313
Author nestjs
Language TypeScript
License MIT
Synced 2026-06-11

What it is

NestJS is a framework for server applications on Node.js. It is popular with teams that like the JavaScript/TypeScript ecosystem but want stronger structure: modules, controllers, services, dependency injection, decorators, and clear separation of responsibilities.

The nestjs/nest repository has been on GitHub since 2017. Its primary language is TypeScript, and it uses the MIT license. Topics include Node.js, TypeScript, framework, microservices, and websockets, which shows its range from HTTP APIs to more complex server systems.

What is inside

Inside are the Nest core, packages, examples, documentation, and framework infrastructure. The Nest idea is that a server application is assembled from modules, controllers receive requests, providers hold business logic, and DI connects dependencies without manual wiring in every file.

A minimal controller

This example shows the typical NestJS style: a decorated class describes an HTTP route, while TypeScript makes the contract explicit. In real applications, logic usually moves from the controller into a service/provider.

Language: TypeScript
import { Controller, Get } from "@nestjs/common";

@Controller("health")
export class HealthController {
  @Get()
  status() {
    return { ok: true };
  }
}

Where it helps

NestJS fits APIs, internal services, applications with multiple modules, team development, and projects where TypeScript is used on both client and server. It helps maintain structure when a single Express file is no longer enough.

The framework is also useful when a project needs guards, pipes, interceptors, WebSocket support, queues, microservices, or OpenAPI integration. Not every app needs all of this, but it is useful when the framework has an official path for growth.

Strengths and tradeoffs

NestJS’s strength is predictable architecture. A new developer can more easily find the controller, service, module, and dependency path. That matters in teams where a codebase lives for years.

The tradeoff is structural weight. For a tiny script or simple webhook, Nest can be more than needed: decorators, DI, and modules add files and rules. The project shines when the application is large enough to benefit from discipline.