nestjs/nest
A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript ๐
Mixed signals โ read the receipts
- โLast commit today
- โ5 active contributors
- โMIT licensed
- โCI configured
- โTests present
- โ Small team โ 5 top contributors
- โ Concentrated ownership โ top contributor handles 52% of commits
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Embed this verdict
[](https://repopilot.app/r/nestjs/nest)Paste into your README โ the badge live-updates from the latest cached analysis.
Onboarding doc
Onboarding: nestjs/nest
Generated by RepoPilot ยท 2026-05-05 ยท Source
Verdict
WAIT โ Mixed signals โ read the receipts
- Last commit today
- 5 active contributors
- MIT licensed
- CI configured
- Tests present
- โ Small team โ 5 top contributors
- โ Concentrated ownership โ top contributor handles 52% of commits
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
TL;DR
This is the core NestJS framework monorepo โ a TypeScript-first Node.js server-side framework that imposes Angular-inspired architectural conventions (modules, controllers, providers, decorators) on top of Express or Fastify. It solves the problem of unstructured Node.js backends by providing a strongly-typed, IoC-container-driven architecture with built-in support for middleware, guards, interceptors, and pipes as first-class concepts. Monorepo rooted at the repo level: the framework packages live under packages/ (not shown in top-60 but referenced by gulpfile.js build tooling), integration tests are isolated apps under integration/ (e.g. integration/cors/, integration/discovery/, integration/auto-mock/), and the build pipeline is driven by gulpfile.js with TypeScript compilation. Each integration sub-folder is a self-contained NestJS app with its own tsconfig.json.
Who it's for
TypeScript/Node.js backend engineers building scalable REST or GraphQL APIs who want Spring Boot / Angular-style structure without sacrificing Node.js flexibility. Also for framework contributors who need to understand or extend the core DI container, module system, or HTTP adapter layer.
Maturity & risk
NestJS is one of the most starred Node.js frameworks on GitHub (60k+ stars), has been in active development since ~2017, uses CircleCI for CI (see .circleci/config.yml) and has a full integration test suite under the integration/ directory. It is unambiguously production-ready and used in enterprise applications worldwide.
Low risk: the project is maintained by a dedicated core team (not single-maintainer), is sponsored via Open Collective, and has a formal security policy (SECURITY.md) and dependabot configured (.github/dependabot.yml). The main risk for adopters is major version breaking changes (e.g. v9โv10 changed module resolution); watch CHANGELOG carefully on upgrades.
Active areas of work
Active work is visible through the CircleCI pipeline (.circleci/config.yml), Dependabot auto-PRs (.github/dependabot.yml), and integration test expansions (integration/discovery/, integration/auto-mock/ appear recently added). The repo uses commitlint (.commitlintrc.json) enforcing conventional commits, suggesting structured release automation is ongoing.
Get running
git clone https://github.com/nestjs/nest.git cd nest npm install
Build all packages
npx gulp build
Run integration tests for a specific suite, e.g.:
cd integration/cors && npm install && npm test
Daily commands:
Build from source:
npx gulp build
Run a specific integration test suite:
cd integration/auto-mock && npm install && npm test
Run CORS integration tests:
cd integration/cors && npm install && npm run test:e2e
Map of the codebase
- gulpfile.js: Drives the entire monorepo build pipeline โ compiles TypeScript packages and orchestrates publish steps.
- .circleci/config.yml: Defines the full CI matrix including test, build, and publish stages for all packages.
- hooks/mocha-init-hook.ts: Custom Mocha lifecycle hook that bootstraps the test environment for all integration/unit tests.
- integration/auto-mock/test/bar.service.spec.ts: Canonical example of NestJS auto-mocking pattern in integration tests โ good reference for writing DI-aware tests.
- integration/discovery/e2e/discover-by-meta.spec.ts: Shows how DiscoveryService and metadata scanning are tested end-to-end โ key for understanding the module discovery system.
- integration/cors/e2e/express.spec.ts: Demonstrates how HTTP adapter-specific behavior (CORS on Express vs Fastify) is validated in isolation.
- .github/ISSUE_TEMPLATE/Bug_report.yml: Structured bug report template that enforces version info and reproduction steps โ important for contributors triaging issues.
- eslint.config.mjs: Flat ESLint config (new format) governing all TypeScript linting rules across the monorepo.
How to make changes
For DI container changes: look in packages/core/injector/ (module scanner, container, instance loader). For new decorators: packages/common/decorators/. For HTTP adapter logic: packages/core/adapters/. For adding integration tests: mirror the pattern in integration/auto-mock/ or integration/discovery/ โ create src/, test/ or e2e/, and a tsconfig.json. For build changes: edit gulpfile.js.
Traps & gotchas
- reflect-metadata must be imported once at the application entry point before any decorators fire โ missing this causes silent DI failures. 2) The integration test suites each have their own node_modules and tsconfig.json; running npm install at the repo root does NOT install integration test dependencies. 3) Gulp build order matters โ packages/common must build before packages/core; skipping steps breaks type resolution. 4) The framework requires TypeScript experimentalDecorators and emitDecoratorMetadata flags set to true in tsconfig.json โ omitting either causes all @Injectable and @Module decorators to silently no-op.
Concepts to learn
- Inversion of Control (IoC) Container โ NestJS's entire module and provider system is built on an IoC container that resolves and injects dependencies โ understanding this is essential to debug DI errors or extend the framework.
- Decorator Metadata (reflect-metadata) โ NestJS decorators like @Injectable() and @Module() store type metadata at runtime via reflect-metadata, which the DI container reads to autowire dependencies โ the foundation of the entire framework.
- Aspect-Oriented Programming via Interceptors โ NestJS interceptors implement AOP patterns (logging, caching, response transformation) as first-class framework concepts, wrapping controller execution using RxJS Observables.
- Dependency Injection Scopes (Singleton, Request, Transient) โ NestJS providers have configurable lifetimes โ singleton (default), request-scoped, or transient โ choosing the wrong scope causes subtle state-sharing bugs in multi-tenant or stateful services.
- Module Encapsulation and Re-export โ NestJS modules form a directed graph where providers are only visible within their declaring module unless explicitly exported โ misunderstanding this causes 'Nest can't resolve dependencies' errors.
- Execution Context Abstraction โ Guards, interceptors, and filters receive an ExecutionContext object that abstracts over HTTP, WebSocket, and gRPC transports โ platform-specific code must use this abstraction to remain transport-agnostic.
Related repos
expressjs/expressโ NestJS uses Express as its default HTTP adapter; understanding Express middleware is essential for NestJS middleware/guards.fastify/fastifyโ NestJS's alternative HTTP adapter โ used when performance benchmarks require it, tested directly in integration/cors/e2e/fastify.spec.ts.nestjs/typeormโ Official NestJS integration for TypeORM โ the most common persistence layer companion used with this framework.nestjs/swaggerโ Official OpenAPI/Swagger module for NestJS that extends the decorator system to generate API docs automatically.loopbackio/loopback-nextโ Direct alternative solving the same problem (structured TypeScript Node.js APIs with DI) but with a different decorator/IoC approach.
PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add missing e2e tests for CORS integration covering edge cases in both Express and Fastify adapters
Looking at integration/cors/e2e/express.spec.ts and integration/cors/e2e/fastify.spec.ts, these tests likely cover basic CORS scenarios but are missing tests for edge cases such as preflight OPTIONS requests with custom headers, wildcard origin vs explicit origin lists, credentials with CORS, and dynamic origin callbacks. These are common real-world CORS pitfalls that NestJS users encounter, and having them covered in the integration suite would prevent regressions and serve as documentation.
- [ ] Review existing integration/cors/e2e/express.spec.ts and integration/cors/e2e/fastify.spec.ts to identify which CORS scenarios are already tested
- [ ] Add test cases in express.spec.ts for: preflight OPTIONS request returning correct Access-Control-Allow-Headers, dynamic origin callback (function-based origin), and credentials: true with specific origin
- [ ] Mirror the same new test cases in fastify.spec.ts to ensure parity between adapters
- [ ] Update integration/cors/src/app.module.ts and integration/cors/src/app.controller.ts if new routes or CORS config variants are needed to support the new test scenarios
- [ ] Run the integration suite locally to confirm all tests pass with both adapters
Add e2e tests for the Discovery module covering providers decorated with non-applied decorators
The integration/discovery directory contains a non-applied decorator at integration/discovery/src/decorators/non-applied.decorator.ts, but the only e2e spec is integration/discovery/e2e/discover-by-meta.spec.ts. There are no tests verifying that the DiscoveryService correctly handles (or ignores) providers decorated with non-applied decorators, nor tests for the webhooks explorer (integration/discovery/src/webhooks.explorer.ts) scanning both flush and cleanup webhook handlers. This is a gap that could mask bugs in the DiscoveryService metadata scanning logic.
- [ ] Read integration/discovery/src/decorators/non-applied.decorator.ts to understand its intent and how it differs from webhook.decorators.ts
- [ ] Add test cases in integration/discovery/e2e/discover-by-meta.spec.ts (or a new spec file) asserting that providers using the non-applied decorator are NOT returned by DiscoveryService when scanning by the webhook metadata key
- [ ] Add test cases asserting that integration/discovery/src/webhooks.explorer.ts correctly finds both integration/discovery/src/my-webhook/flush.webhook.ts and integration/discovery/src/my-webhook/cleanup.webhook.ts and excludes non-decorated providers
- [ ] Verify that the integration/discovery/src/app.module.ts registers all necessary providers for the new test scenarios
- [ ] Run the discovery integration tests to confirm all assertions pass
Add unit tests for the auto-mock integration covering dependency chain resolution between FooService and BarService
The integration/auto-mock directory only has integration/auto-mock/test/bar.service.spec.ts, but there is no corresponding spec file for integration/auto-mock/src/foo.service.ts. Given that BarService likely depends on FooService (a common pattern for demonstrating auto-mocking), the absence of foo.service.spec.ts means the auto-mock behavior when FooService is the subject-under-test (with BarService auto-mocked) is untested. This is a concrete gap that could hide regressions in NestJS's testing utilities.
- [ ] Inspect integration/auto-mock/src/foo.service.ts and integration/auto-mock/src/bar.service.ts to understand the dependency relationship between them
- [ ] Create integration/auto-mock/test/foo.service.spec.ts that uses NestJS's Test.createTestingModule with auto-mocking to instantiate FooService with BarService auto-mocked
- [ ] Write assertions verifying that the auto-mocked Bar
Good first issues
- integration/discovery/src/decorators/non-applied.decorator.ts has no corresponding spec โ add an e2e test in integration/discovery/e2e/ verifying that decorators not applied to any class are correctly excluded from DiscoveryService results. 2) integration/cors/src/app.controller.ts lacks tests for preflight OPTIONS request handling โ add a case to both express.spec.ts and fastify.spec.ts for OPTIONS method assertions. 3) integration/auto-mock/ only tests bar.service.spec.ts but foo.service.ts has no test file โ add integration/auto-mock/test/foo.service.spec.ts covering its auto-mocked dependencies.
Top contributors
- @kamilmysliwiec โ 50 commits
- @renovate[bot] โ 24 commits
- @dependabot[bot] โ 16 commits
- @Mysh3ll โ 4 commits
- @MatthiasBrehmer โ 2 commits
Recent commits
041fb7cโ Merge pull request #16883 from nestjs/renovate/amqplib-1.x (kamilmysliwiec)38fc9e5โ chore(deps): update dependency amqplib to v1.0.4 (renovate[bot])aeec17dโ Merge pull request #16877 from nestjs/renovate/globals-17.x (kamilmysliwiec)12af2feโ Merge pull request #16876 from nestjs/renovate/eslint-monorepo (kamilmysliwiec)b363eb2โ chore(deps): update dependency globals to v17.6.0 (renovate[bot])e306133โ chore(deps): update dependency eslint to v10.3.0 (renovate[bot])52030c9โ chore: revert typescript eslint (kamilmysliwiec)5bb4c3aโ chore: revert typescript eslint (kamilmysliwiec)fe1f277โ Merge pull request #16817 from nestjs/renovate/typescript-eslint-monorepo (kamilmysliwiec)0cb8479โ Merge pull request #16867 from nestjs/dependabot/npm_and_yarn/nestjs/graphql-13.4.0 (kamilmysliwiec)
Security observations
- Medium ยท Hardcoded Token in README/CI Badge URL โ
Readme.md / .circleci/config.yml. The README.md contains a CircleCI badge URL with a hardcoded token parameter 'token=abc123def456'. While this appears to be a placeholder, it demonstrates a pattern where CI tokens could be accidentally committed in documentation or configuration files. Fix: Ensure all CI tokens are stored as environment variables or secrets in the CI/CD system. Remove any token query parameters from public badge URLs and use tokenless badge URLs where possible. - Medium ยท Insufficient Security Policy Detail โ
SECURITY.md. The SECURITY.md only provides an email address for reporting vulnerabilities without specifying a response SLA, severity classification criteria, a PGP key for encrypted reporting, or a coordinated disclosure timeline. This may delay handling of critical issues. Fix: Enhance the security policy to include: expected response times, a PGP public key for encrypted vulnerability reports, a defined disclosure timeline (e.g., 90 days), severity classification guidance, and a bug bounty scope if applicable. - Medium ยท CORS Configuration Potentially Misconfigured โ
integration/cors/src/app.module.ts, integration/cors/e2e/express.spec.ts, integration/cors/e2e/fastify.spec.ts. The integration test structure includes CORS configuration for both Express and Fastify adapters. Without reviewing the actual CORS settings, there is a risk that wildcard origins ('') or overly permissive CORS policies may be used in example or default configurations, which could be copied into production. Fix: Ensure CORS configurations explicitly whitelist trusted origins. Avoid using wildcard '' for origins in production. Verify that credentials mode is not used in combination with wildcard origins. - Medium ยท GraphQL Introspection Potentially Exposed โ
integration/graphql-code-first/src/app.module.ts, integration/graphql-schema-first/src/. The integration tests for both code-first and schema-first GraphQL implementations suggest introspection and potentially unrestricted query depth/complexity are available. In production deployments, this can allow attackers to enumerate the entire schema and craft denial-of-service attacks via deeply nested queries. Fix: Disable GraphQL introspection in production environments. Implement query depth limiting and query complexity analysis. Consider using persisted queries in production. Apply authentication guards to sensitive resolvers. - Low ยท Request-Scoped GraphQL Without Proper Input Validation โ
integration/graphql-schema-first/e2e/graphql-request-scoped.spec.ts, integration/graphql-code-first/src/recipes/dto/. The graphql-schema-first integration includes request-scoped providers (graphql-request-scoped.spec.ts). Without explicit input validation on GraphQL inputs, there is a risk of injection through malformed GraphQL variables or arguments. Fix: Apply class-validator decorators on all DTO classes. Use the ValidationPipe globally with 'whitelist: true' and 'forbidNonWhitelisted: true' to strip and reject unexpected fields. - Low ยท Dependency Security Not Verified โ
package.json (not provided). No dependency file content (package.json, package-lock.json, or yarn.lock) was provided for analysis. The project uses multiple integration dependencies including GraphQL, Express, and Fastify adapters. Without reviewing exact versions, known CVEs in transitive dependencies cannot be assessed. Fix: Regularly run 'npm audit' or use tools like Snyk or Dependabot (already configured via .github/dependabot.yml) to detect and remediate vulnerable dependencies. Pin dependency versions and review Dependabot alerts promptly. - Low ยท Husky Git Hooks Could Be Bypassed โ
.husky/pre-commit, .husky/commit-msg. The .husky/pre-commit and .husky/commit-msg hooks are used for linting and commit message validation. These hooks can be bypassed using 'git commit --no-verify', potentially allowing unvalidated or malicious code to be committed. Fix: Do not rely solely on client-side hooks for security enforcement. Implement server-side CI checks (already present via CircleCI and CodeQL) that cannot be bypassed. Use branch protection rules requiring CI to pass before merging.
LLM-derived; treat as a starting point, not a security audit.
Where to read next
- Open issues โ current backlog
- Recent PRs โ what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals โ see the live page for receipts. Re-run on a new commit to refresh.