Gallery · Architecture explained · Score · TypeScript
NestJS architecture: modules, API surface, dependency graph
A progressive Node.js framework for building server-side applications. Generated from nestjs/nest at 62647d3, MIT.
Scanned @nestjs/common, @nestjs/core, and platform-express. The rest of the monorepo is left out so the job stays small.
- Files
- 430
- Modules
- 43
- API routes
- 1
- Documents
- 17
TypeScriptNode.jsExpressFastify
Executive Summary
At a Glance
| Aspect | Summary |
|---|---|
| What | NestJS is a well-structured API service |
| Built With | Express, Fastify + TypeScript, Node.js |
| Scale | 43 modules across 430 files |
| Maturity | Well-structured (2/3 indicators) |
What This System Does
NestJS is a Express, Fastify API service built with TypeScript, Node.js. It exposes 1 API endpoint, designed for programmatic access by client applications, mobile apps, or external services.
Business Capabilities
The system is organized around 8 functional domains, each representing a distinct business capability:
| Domain | Capability | Scale |
|---|---|---|
| Shared Utilities | path packages/common/interfaces matches common | 13 modules, 228 files |
| Core Engine | path packages/core/router matches core | 20 modules, 164 files |
| Other | Uncategorized module | 2 modules, 20 files |
| API Layer | path packages/core/middleware matches middleware | 1 modules, 8 files |
| Integrations | path packages/platform-express/adapters matches adapter | 1 modules, 4 files |
| Search & Discovery | path packages/common/index.ts matches index | 3 modules, 3 files |
| +2 more | Additional functional areas | — |
Technical Foundation
| Layer | Technologies | Purpose |
|---|---|---|
| Application | Express, Fastify | Core runtime framework |
| Language | TypeScript, Node.js | Primary development language |
| Build | Vite | Compilation and bundling |
| Testing | Vitest | Quality assurance |
Module Composition
The codebase follows a layered architecture with clear separation of concerns:
| Layer | Count | Key Modules | Responsibility |
|---|---|---|---|
| Shared Libraries | 9 | interfaces, decorators | Provides shared utilities and abstractions used across modules |
| Route/Page Modules | 1 | router | Maps URL paths to page components and handles navigation |
| core | 4 | injector, errors | Supporting application functionality |
| Other Modules | 1 | multer | General purpose functionality |
Monorepo Structure
This is a npm/yarn workspaces monorepo containing 3 packages. This structure enables:
- Independent versioning and deployment of packages
- Shared code reuse across internal projects
- Coordinated development with clear ownership boundaries
Key packages:
@nestjs/common— packages/common@nestjs/core— packages/core@nestjs/platform-express— packages/platform-express
Codebase Health
Overall Health: 🟡 70/100
| Metric | Value | Status |
|---|---|---|
| Internal imports | 1229 edges | ✅ Connected |
| External Packages | 27 | ✅ Manageable |
| Circular Dependencies | 50 | 🔴 50 detected |
| Orphan Files | 2 | ⚠️ 2 unused |
Key Insights
- 🔴 Architectural concern — 50 circular dependencies detected. These create tight coupling and make testing difficult.
Key Data Flows
The system processes information through 6 identified flows:
- internal Request Flow (critical) — Import chain starting from
packages/core/internal— traces how this entry point depends on 5 downstream modules - core Request Flow (critical) — Import chain starting from
packages/core— traces how this entry point depends on 5 downstream modules - internal Request Flow (critical) — Import chain starting from
packages/common/internal— traces how this entry point depends on 1 downstream module - platform-express Request Flow — Import chain starting from
packages/platform-express— traces how this entry point depends on 3 downstream modules - controllers Request Flow — Import chain starting from
packages/common/interfaces/controllers— traces how this entry point depends on 1 downstream module
Strategic Observations
- The codebase follows Core/kernel architecture — `packages/core/router`, `packages/core/injector`, `packages/core/helpers` (+23 more); high fan-in, Middleware pipeline — `packages/core/middleware`, Analysis pipeline — `packages/core/inspector`, Shared utility layer — `packages/common/utils`, `packages/common/module-utils`, `packages/core/helpers`; high fan-in, Integration adapters — `packages/platform-express/adapters`, `packages/core/adapters`, ⚠️ 50 circular dependency cycle(s) detected architectural patterns, providing a familiar structure for developers.
- With 8 distinct domains, the system has clear separation of concerns suitable for team-based development.
This executive summary was generated from comprehensive repository analysis including dependency graphs, data flow detection, and architectural pattern recognition. Enable AI enhancement with `GITHUB_TOKEN` for strategic recommendations, risk assessments, and plain-language explanations tailored for non-technical stakeholders.
<!-- repolens:docs-badge -->  · Examples
System Overview
The Big Picture
NestJS is a medium-sized codebase with clear structure, containing 43 modules spread across 430 files.
| Dimension | Details |
|---|---|
| Total Files | 430 |
| Module Count | 43 |
| Functional Domains | 8 |
| API Endpoints | 1 |
Technology Stack
The system is built on a modern technology foundation:
| Layer | Technologies | Purpose |
|---|---|---|
| Runtime | Express, Fastify | HTTP server and middleware, High-performance HTTP server |
| Language | TypeScript, Node.js | Primary development language |
| Build | Vite | Compilation and asset processing |
| Quality | Vitest | Automated testing |
Architecture Patterns
The codebase follows 6 identified architectural patterns:
- Core/kernel architecture — `packages/core/router`, `packages/core/injector`, `packages/core/helpers` (+23 more); high fan-in — A structured approach to organizing code and managing complexity.
- Middleware pipeline — `packages/core/middleware` — A structured approach to organizing code and managing complexity.
- Analysis pipeline — `packages/core/inspector` — A structured approach to organizing code and managing complexity.
- Shared utility layer — `packages/common/utils`, `packages/common/module-utils`, `packages/core/helpers`; high fan-in — A structured approach to organizing code and managing complexity.
- Integration adapters — `packages/platform-express/adapters`, `packages/core/adapters` — A structured approach to organizing code and managing complexity.
- ⚠️ 50 circular dependency cycle(s) detected — A structured approach to organizing code and managing complexity.
Module Architecture
The system is organized into 4 architectural layers:
| Layer | Modules | Key Examples | Responsibility |
|---|---|---|---|
| Shared Libraries | 9 | interfaces, decorators | Provides shared utilities and abstractions used across modules |
| Route/Page Modules | 1 | router | Maps URL paths to page components and handles navigation |
| core | 4 | injector, errors | Supporting application functionality |
| Other Modules | 1 | multer | General purpose functionality |
Layer Details
Shared Libraries — 9 modules
packages/common/interfaces— 71 files — Core application modulepackages/common/decorators— 29 files — Core application modulepackages/core/helpers— 27 files — Utility and helper functionspackages/common/exceptions— 24 files — Core application module- +5 more modules
Route/Page Modules — 1 module
packages/core/router— 32 files — API layer and route handlers
core — 4 modules
packages/core/injector— 30 files — Core application modulepackages/core/errors— 26 files — Core application modulepackages/core/repl— 16 files — Core application modulepackages/core/inspector— 15 files — Test infrastructure
Other Modules — 1 module
packages/platform-express/multer— 15 files — Core application module
Functional Domains
The following domains represent the largest functional areas by file count:
| Rank | Domain | Scale | Business Capability |
|---|---|---|---|
| 1 | Shared Utilities | 228 files | path packages/common/interfaces matches common |
| 2 | Core Engine | 164 files | path packages/core/router matches core |
| 3 | Other | 20 files | Uncategorized module |
| 4 | API Layer | 8 files | path packages/core/middleware matches middleware |
| 5 | Integrations | 4 files | path packages/platform-express/adapters matches adapter |
| 6 | Search & Discovery | 3 files | path packages/common/index.ts matches index |
| — | +2 more | — | Additional domains |
Route Summary
The system surfaces 1 API endpoint (ALL).
API Endpoints (1)
| Endpoint | Methods | Purpose |
|---|---|---|
*path | ALL | Data operations |
Dependency Graph
Codebase Health: 🟡 70/100
| Metric | Value | Assessment |
|---|---|---|
| Internal Imports | 1229 | Modules are connected |
| External Packages | 27 | Lean dependencies |
| Circular Dependencies | 50 | ⚠️ Needs attention |
| Orphan Files | 2 | ⚠️ 2 unused |
Monorepo Structure
This is a npm/yarn workspaces monorepo containing 3 packages:
| Package | Location | Description |
|---|---|---|
@nestjs/common | packages/common | Utility libraries |
@nestjs/core | packages/core | Core functionality and shared code |
@nestjs/platform-express | packages/platform-express | Package functionality |
This system overview was generated from comprehensive repository analysis. Enable AI enhancement with `GITHUB_TOKEN` for narrative context, architectural rationale, technology trade-off analysis, and scalability recommendations.
<!-- repolens:docs-badge -->  · Examples
Business Domains
Overview
NestJS is organized into 8 functional domains, each representing a distinct area of business capability. This document maps the technical structure to business-oriented functional areas.
Quick Reference:
| Domain | Modules | Files | Primary Capability |
|---|---|---|---|
| Shared Utilities | 13 | 228 | Cross-cutting utility functions |
| Core Engine | 20 | 164 | Supporting business operations |
| Other | 2 | 20 | Supporting business operations |
| API Layer | 1 | 8 | External API interface layer |
| Integrations | 1 | 4 | Supporting business operations |
| Search & Discovery | 3 | 3 | Search and content discovery |
| Configuration | 2 | 2 | Application configuration |
| State Management | 1 | 1 | Application state and data flow management |
1. Shared Utilities
Business Capability
path packages/common/interfaces matches common
This is a major domain with 13 modules and 228 source files.
Key Modules
| Module | Purpose |
|---|---|
packages/common/interfaces | Core application module |
packages/common/decorators | Core application module |
packages/core/helpers | Utility and helper functions |
packages/common/exceptions | Core application module |
packages/common/pipes | Core application module |
Business Impact
- Change Frequency Impact: High — Changes here affect 228 files
- Domain Complexity: Complex (multiple modules)
- Recommendation: Ensure comprehensive testing before modifying this domain
2. Core Engine
Business Capability
path packages/core/router matches core
This is a major domain with 20 modules and 164 source files.
Key Modules
| Module | Purpose |
|---|---|
packages/core/router | API layer and route handlers |
packages/core/injector | Core application module |
packages/core/errors | Core application module |
packages/core/repl | Core application module |
packages/core/inspector | Test infrastructure |
Business Impact
- Change Frequency Impact: High — Changes here affect 164 files
- Domain Complexity: Complex (multiple modules)
- Recommendation: Ensure comprehensive testing before modifying this domain
3. Other
Business Capability
Uncategorized module
This is a focused domain with 2 modules and 20 source files.
Key Modules
| Module | Purpose |
|---|---|
packages/platform-express/multer | Core application module |
packages/platform-express/interfaces | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 20 files
- Domain Complexity: Simple
4. API Layer
Business Capability
path packages/core/middleware matches middleware
This is a focused domain with 1 module and 8 source files.
Key Modules
| Module | Purpose |
|---|---|
packages/core/middleware | Request/response middleware |
Business Impact
- Change Frequency Impact: Low — Changes here affect 8 files
- Domain Complexity: Simple
5. Integrations
Business Capability
path packages/platform-express/adapters matches adapter
This is a focused domain with 1 module and 4 source files.
Key Modules
| Module | Purpose |
|---|---|
packages/platform-express/adapters | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 4 files
- Domain Complexity: Simple
6. Search & Discovery
Business Capability
path packages/common/index.ts matches index
This is a focused domain with 3 modules and 3 source files.
Key Modules
| Module | Purpose |
|---|---|
packages/common/index.ts | Core application module |
packages/core/index.ts | Core application module |
packages/platform-express/index.ts | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 3 files
- Domain Complexity: Moderate
7. Configuration
Business Capability
path packages/core/application-config.ts matches config
This is a focused domain with 2 modules and 2 source files.
Key Modules
| Module | Purpose |
|---|---|
packages/core/application-config.ts | Configuration management |
packages/core/constants.ts | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 2 files
- Domain Complexity: Simple
8. State Management
Business Capability
path packages/core/nest-application-context.ts matches context
This is a focused domain with 1 module and 1 source file.
Key Modules
| Module | Purpose |
|---|---|
packages/core/nest-application-context.ts | Core application module |
Business Impact
- Change Frequency Impact: Low — Changes here affect 1 file
- Domain Complexity: Simple
Domain Health Summary
| Metric | Value | Assessment |
|---|---|---|
| Total Domains | 8 | Well-balanced |
| Avg Files/Domain | 54 | Appropriate size |
| Largest Domain | Shared Utilities (228 files) | Consider breaking down |
| Domain Concentration | 53% in largest | ✅ Well distributed |
Domain mapping is based on directory naming conventions and code organization patterns. Enable AI enhancement with `GITHUB_TOKEN` for business-language descriptions, stakeholder impact analysis, strategic recommendations, and cross-domain relationship narratives.
<!-- repolens:docs-badge -->  · Examples
Architecture Overview
Architectural Philosophy
NestJS follows a Core/kernel architecture — `packages/core/router`, `packages/core/injector`, `packages/core/helpers` (+23 more); high fan-in architecture with elements of Middleware pipeline — `packages/core/middleware`, Analysis pipeline — `packages/core/inspector`, Shared utility layer — `packages/common/utils`, `packages/common/module-utils`, `packages/core/helpers`; high fan-in, Integration adapters — `packages/platform-express/adapters`, `packages/core/adapters`, ⚠️ 50 circular dependency cycle(s) detected.
Pattern Analysis
Core/kernel architecture — `packages/core/router`, `packages/core/injector`, `packages/core/helpers` (+23 more); high fan-in
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Middleware pipeline — `packages/core/middleware`
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Analysis pipeline — `packages/core/inspector`
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Shared utility layer — `packages/common/utils`, `packages/common/module-utils`, `packages/core/helpers`; high fan-in
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Integration adapters — `packages/platform-express/adapters`, `packages/core/adapters`
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
⚠️ 50 circular dependency cycle(s) detected
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
System Layers
The system is organized into 8 functional layers, each encapsulating a distinct area of responsibility:
| Layer | Responsibility | Scale | Key Insight |
|---|---|---|---|
| Shared Utilities | path packages/common/interfaces matches common | 228 files | Large domain — consider breaking down |
| Core Engine | path packages/core/router matches core | 164 files | Large domain — consider breaking down |
| Other | Uncategorized module | 20 files | Standard domain |
| API Layer | path packages/core/middleware matches middleware | 8 files | External interface — versioning important |
| Integrations | path packages/platform-express/adapters matches adapter | 4 files | Standard domain |
| Search & Discovery | path `packages/common/index | 3 files | Standard domain |
| Configuration | path `packages/core/application-config | 2 files | Standard domain |
| State Management | path `packages/core/nest-application-context | 1 files | Standard domain |
Module Layers
Modules are classified into 4 architectural roles:
Shared Libraries
Role: Provides shared utilities and abstractions used across modules
| Module | Files | Description |
|---|---|---|
packages/common/interfaces | 71 | Core application module |
packages/common/decorators | 29 | Core application module |
packages/core/helpers | 27 | Utility and helper functions |
packages/common/exceptions | 24 | Core application module |
packages/common/pipes | 21 | Core application module |
| +4 more | — | Additional modules |
Route/Page Modules
Role: Maps URL paths to page components and handles navigation
| Module | Files | Description |
|---|---|---|
packages/core/router | 32 | API layer and route handlers |
core
Role: Supporting application functionality
| Module | Files | Description |
|---|---|---|
packages/core/injector | 30 | Core application module |
packages/core/errors | 26 | Core application module |
packages/core/repl | 16 | Core application module |
packages/core/inspector | 15 | Test infrastructure |
Other Modules
Role: General purpose functionality
| Module | Files | Description |
|---|---|---|
packages/platform-express/multer | 15 | Core application module |
Technology Foundation
| Layer | Technologies | Architectural Implication |
|---|---|---|
| Application | Express, Fastify | Middleware pipeline, request/response cycle |
| Language | TypeScript, Node.js | Static typing enables tooling and refactoring confidence |
| Build | Vite | Modern bundling and optimization |
| Quality | Vitest | Enables confident refactoring |
Scale & Complexity Analysis
| Dimension | Value | Assessment |
|---|---|---|
| Total Files | 430 | large project |
| Module Count | 43 | medium complexity |
| Domain Spread | 8 domains | Good separation |
| API Surface | 1 endpoints | Compact API |
Dependency Health
Architecture Health Score: 🟡 70/100
| Metric | Value | Status | Recommendation |
|---|---|---|---|
| Import Edges | 1229 | ✅ | Healthy module connectivity |
| External Packages | 27 | ✅ | Lean dependency set |
| Circular Deps | 50 | 🔴 | Refactor to break cycles |
| Orphan Files | 2 | ⚠️ | Review for dead code |
Architectural Strengths
- Testing infrastructure — Automated testing with Vitest supports confident evolution.
Concerns
- Circular dependencies detected — 50 circular dependencies create tight coupling, complicate testing, and hinder refactoring. Priority: High.
Monorepo Architecture
This project uses a npm/yarn workspaces monorepo with 3 packages.
Package Structure
| Package | Location | Architectural Role |
|---|---|---|
@nestjs/common | packages/common | Utility libraries |
@nestjs/core | packages/core | Core functionality and shared code |
@nestjs/platform-express | packages/platform-express | Package functionality |
Monorepo Benefits
- Shared infrastructure — Common tooling and configurations
- Atomic changes — Cross-package updates in single commits
- Independent deployment — Each package can be released separately
- Clear ownership — Package boundaries define team responsibilities
This architecture overview was generated from comprehensive dependency graph analysis and pattern detection. Enable AI enhancement with `GITHUB_TOKEN` for architectural narratives, design rationale explanations, scalability analysis, and refactoring recommendations.
<!-- repolens:docs-badge -->  · Examples
Module Catalog
A complete inventory of all code modules in the repository, organized by location and size. Each module represents a distinct area of responsibility within the codebase.
Total modules: 43
Module Inventory
| Module | Files | Role |
|---|---|---|
packages/common/interfaces | 71 | Application module · Critical shared infrastructure (imported by 49 modules) |
packages/core/router | 32 | Core business logic and shared foundations · Critical shared infrastructure (imported by 33 modules) |
packages/core/injector | 30 | Core business logic and shared foundations · Critical shared infrastructure (imported by 108 modules) |
packages/common/decorators | 29 | Application module · Critical shared infrastructure (imported by 26 modules) |
packages/core/helpers | 27 | Core business logic and shared foundations · Critical shared infrastructure (imported by 57 modules) |
packages/core/errors | 26 | Core business logic and shared foundations · Critical shared infrastructure (imported by 29 modules) |
packages/common/exceptions | 24 | Application module · Orchestrator (coordinates 23 modules) |
packages/common/pipes | 21 | Application module · Orchestrator (coordinates 72 modules) |
packages/core/repl | 16 | Core business logic and shared foundations · Orchestrator (coordinates 9 modules) |
packages/common/utils | 15 | Shared utilities and helper functions · Critical shared infrastructure (imported by 65 modules) |
packages/core/inspector | 15 | Core business logic and shared foundations · Critical shared infrastructure (imported by 23 modules) |
packages/platform-express/multer | 15 | Application module · Leaf module (consumed only, 1 importer) |
packages/common/module-utils | 10 | Shared utilities and helper functions · Orchestrator (coordinates 8 modules) |
packages/common/services | 10 | Service layer and external integrations · Shared infrastructure (imported by 7 modules) |
packages/common/serializer | 8 | Application module · Orchestrator (coordinates 14 modules) |
packages/core/hooks | 8 | Core business logic and shared foundations · Orchestrator (coordinates 6 modules) |
packages/core/middleware | 8 | Core business logic and shared foundations · Shared infrastructure (imported by 6 modules) |
packages/core/exceptions | 7 | Core business logic and shared foundations · Shared infrastructure (imported by 11 modules) |
packages/common/enums | 6 | Application module · Critical shared infrastructure (imported by 41 modules) |
packages/common/file-stream | 5 | Application module · Connector (3 in, 3 out) |
packages/platform-express/interfaces | 5 | Application module · Leaf module (consumed only, 3 importers) |
packages/core/discovery | 4 | Core business logic and shared foundations · Orchestrator (coordinates 6 modules) |
packages/core/guards | 4 | Core business logic and shared foundations · Shared infrastructure (imported by 7 modules) |
packages/core/pipes | 4 | Core business logic and shared foundations · Shared infrastructure (imported by 7 modules) |
packages/platform-express/adapters | 4 | Application module · Connector (1 in, 2 out) |
packages/core/interceptors | 3 | Core business logic and shared foundations · Shared infrastructure (imported by 6 modules) |
packages/core/interfaces | 3 | Core business logic and shared foundations · Shared infrastructure (imported by 6 modules) |
packages/core/security | 3 | Core business logic and shared foundations · Connector (3 in, 4 out) |
packages/core/adapters | 2 | Core business logic and shared foundations · Shared infrastructure (imported by 6 modules) |
packages/core/services | 2 | Core business logic and shared foundations · Leaf module (consumed only, 3 importers) |
packages/common/constants.ts | 1 | Application module |
packages/common/index.ts | 1 | Application module |
packages/common/internal.ts | 1 | Application module |
packages/core/application-config.ts | 1 | Core business logic and shared foundations |
packages/core/constants.ts | 1 | Core business logic and shared foundations |
packages/core/index.ts | 1 | Core business logic and shared foundations |
packages/core/internal.ts | 1 | Core business logic and shared foundations |
packages/core/metadata-scanner.ts | 1 | Core business logic and shared foundations |
packages/core/nest-application-context.ts | 1 | Core business logic and shared foundations |
packages/core/nest-application.ts | 1 | Core business logic and shared foundations |
packages/core/nest-factory.ts | 1 | Core business logic and shared foundations |
packages/core/scanner.ts | 1 | Core business logic and shared foundations |
packages/platform-express/index.ts | 1 | Application module |
Module detection is based on the `module_roots` setting in your RepoLens configuration. Adjust this setting to change how modules are grouped.
<!-- repolens:docs-badge -->  · Examples
Route Map
A complete listing of user-facing pages and backend API endpoints. This map shows every URL a user or client can interact with, along with the source file that handles each route.
API Endpoints (1)
Backend services that handle data operations and business logic.
| Method | Path | Source File |
|---|---|---|
| ALL | *path | packages/platform-express/adapters/express-adapter.ts |
Paths starting with `/api/` are backend endpoints; all others are user-facing pages.
<!-- repolens:docs-badge -->  · Examples
API Surface
This page documents both the API endpoints the application exposes and the external services it integrates with. Use it as a reference for understanding the system's interfaces.
Internal API Endpoints
These are the backend services the application provides to handle incoming requests.
Total endpoints: 1
| Method | Path | Implementation |
|---|---|---|
| ALL | *path | packages/platform-express/adapters/express-adapter.ts |
External API Integrations
Third-party services the application connects to, grouped by category.
No external API integrations were detected. This section populates automatically when RepoLens identifies SDK imports or API client usage in your codebase.
Documented Exports
Exported functions with JSDoc/TSDoc documentation. Documentation coverage: 66%
Function Documentation
packages/common/decorators/core/apply-decorators.ts
`applyDecorators()`
Function that returns a new decorator that applies all decorators provided by param Useful to build new decorators (or a decorator factory) encapsulating multiple decorators related with the same feature
Parameters:
decorators(any): one or more decorators (e.g.,ApplyGuard(...))
packages/common/decorators/core/bind.decorator.ts
`Bind()`
Decorator that binds parameter decorators to the method that follows. Useful when the language doesn't provide a 'Parameter Decorator' feature (i.e., vanilla JavaScript).
Parameters:
decorators(any): one or more parameter decorators (e.g.,Req())
packages/common/decorators/core/catch.decorator.ts
`Catch()`
Decorator that marks a class as a Nest exception filter. An exception filter handles exceptions thrown by or not handled by your application code. The decorated class must implement the ExceptionFilter interface.
Parameters:
exceptions(any): one or more exception types specifying the exceptions to be caught and handled by this filter.
packages/common/decorators/core/controller.decorator.ts
`Controller()`
Decorator that marks a class as a Nest controller that can receive inbound requests and produce responses. An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses. It defines a class that provides the context for one or more related route handlers that correspond to HTTP request methods and associated routes for example GET /api/profile, POST /users/resume. A Microservice Controller responds to requests as well as events, running over a variety of transports (read more here). It defines a class that provides a context for one or more message or event handlers.
`Controller()`
Decorator that marks a class as a Nest controller that can receive inbound requests and produce responses. An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses. It defines a class that provides the context for one or more related route handlers that correspond to HTTP request methods and associated routes for example GET /api/profile, POST /users/resume. A Microservice Controller responds to requests as well as events, running over a variety of transports (read more here). It defines a class that provides a context for one or more message or event handlers.
Parameters:
prefix(string|Array): string that defines aroute path prefix. The prefix is pre-pended to the path specified in any request decorator in the class.
`Controller()`
Decorator that marks a class as a Nest controller that can receive inbound requests and produce responses. An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses. It defines a class that provides the context for one or more related route handlers that correspond to HTTP request methods and associated routes for example GET /api/profile, POST /users/resume. A Microservice Controller responds to requests as well as events, running over a variety of transports (read more here). It defines a class that provides a context for one or more message or event handlers.
Parameters:
options(object): configuration object specifying: -scope- symbol that determines the lifetime of a Controller instance. See Scope for more details. -prefix- string that defines aroute path prefix. The prefix is pre-pended to the path specified in any request decorator in the class. -version- string, array of strings, or Symbol that defines the version of all routes in the class. See Versioning for more details.
`Controller()`
Decorator that marks a class as a Nest controller that can receive inbound requests and produce responses. An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses. It defines a class that provides the context for one or more related route handlers that correspond to HTTP request methods and associated routes for example GET /api/profile, POST /users/resume A Microservice Controller responds to requests as well as events, running over a variety of transports (read more here). It defines a class that provides a context for one or more message or event handlers.
Parameters:
prefixOrOptions(any): aroute path prefixor aControllerOptionsobject. Aroute path prefixis pre-pended to the path specified in any request decorator in the class.ControllerOptionsis an options configuration object specifying: -scope- symbol that determines the lifetime of a Controller instance. See Scope for more details. -prefix- string that defines aroute path prefix. The prefix is pre-pended to the path specified in any request decorator in the class. -version- string, array of strings, or Symbol that defines the version of all routes in the class. See Versioning for more details.
packages/common/decorators/core/inject.decorator.ts
`Inject()`
Decorator that marks a constructor parameter as a target for Dependency Injection (DI). Any injected provider must be visible within the module scope (loosely speaking, the containing module) of the class it is being injected into. This can be done by: - defining the provider in the same module scope - exporting the provider from one module scope and importing that module into the module scope of the class being injected into - exporting the provider from a module that is marked as global using the @Global() decorator #### Injection tokens Can be types (class names), strings or symbols. This depends on how the provider with which it is associated was defined. Providers defined with the @Injectable() decorator use the class name. Custom Providers may use strings or symbols as the injection token.
Parameters:
token(any): lookup key for the provider to be injected (assigned to the constructor parameter).
packages/common/decorators/core/injectable.decorator.ts
`Injectable()`
Decorator that marks a class as a provider. Providers can be injected into other classes via constructor parameter injection using Nest's built-in Dependency Injection (DI) system. When injecting a provider, it must be visible within the module scope (loosely speaking, the containing module) of the class it is being injected into. This can be done by: - defining the provider in the same module scope - exporting the provider from one module scope and importing that module into the module scope of the class being injected into - exporting the provider from a module that is marked as global using the @Global() decorator Providers can also be defined in a more explicit and imperative form using various custom provider techniques that expose more capabilities of the DI system.
Parameters:
options(any): options specifying scope of injectable
packages/common/decorators/core/optional.decorator.ts
`Optional()`
Parameter decorator for an injected dependency marking the dependency as optional. For example: ``typescript constructor(@Optional() @Inject('HTTP_OPTIONS')private readonly httpClient: T) {} ``
packages/common/decorators/core/use-guards.decorator.ts
`UseGuards()`
Decorator that binds guards to the scope of the controller or method, depending on its context. When @UseGuards is used at the controller level, the guard will be applied to every handler (method) in the controller. When @UseGuards is used at the individual handler level, the guard will apply only to that specific method.
Parameters:
guards(any): a single guard instance or class, or a list of guard instances or classes.
packages/common/decorators/core/use-interceptors.decorator.ts
`UseInterceptors()`
Decorator that binds interceptors to the scope of the controller or method, depending on its context. When @UseInterceptors is used at the controller level, the interceptor will be applied to every handler (method) in the controller. When @UseInterceptors is used at the individual handler level, the interceptor will apply only to that specific method.
Parameters:
interceptors(any): a single interceptor instance or class, or a list of interceptor instances or classes.
packages/common/decorators/core/use-pipes.decorator.ts
`UsePipes()`
Decorator that binds pipes to the scope of the controller or method, depending on its context. When @UsePipes is used at the controller level, the pipe will be applied to every handler (method) in the controller. When @UsePipes is used at the individual handler level, the pipe will apply only to that specific method.
Parameters:
pipes(any): a single pipe instance or class, or a list of pipe instances or classes.
packages/common/decorators/core/version.decorator.ts
`Version()`
Sets the version of the endpoint to the passed version
packages/common/decorators/http/header.decorator.ts
`Header()`
Request method Decorator. Sets a response header. For example: @Header('Cache-Control', 'none') @Header('Cache-Control', () => 'none')
Parameters:
name(any): string to be used for header namevalue(any): string to be used for header value
packages/common/decorators/http/http-code.decorator.ts
`HttpCode()`
Request method Decorator. Defines the HTTP response status code. Overrides default status code for the decorated request method.
Parameters:
statusCode(any): HTTP response code to be returned by route handler.
packages/common/decorators/http/redirect.decorator.ts
`Redirect()`
Redirects request to the specified URL.
packages/common/decorators/http/render.decorator.ts
`Render()`
Route handler method Decorator. Defines a template to be rendered by the controller. For example: @Render('index')
Parameters:
template(any): name of the render engine template file
packages/common/decorators/http/route-params.decorator.ts
`UploadedFile()`
Route handler parameter decorator. Extracts the file object and populates the decorated parameter with the value of file. Used in conjunction with multer middleware for Express-based applications. For example: ``typescript uploadFile(@UploadedFile() file) { console.log(file); } ``
`UploadedFile()`
Route handler parameter decorator. Extracts the file object and populates the decorated parameter with the value of file. Used in conjunction with multer middleware for Express-based applications. For example: ``typescript uploadFile(@UploadedFile() file) { console.log(file); } ``
`UploadedFile()`
Route handler parameter decorator. Extracts the file object and populates the decorated parameter with the value of file. Used in conjunction with multer middleware for Express-based applications. For example: ``typescript uploadFile(@UploadedFile() file) { console.log(file); } ``
`UploadedFile()`
Route handler parameter decorator. Extracts the file object and populates the decorated parameter with the value of file. Used in conjunction with multer middleware for Express-based applications. For example: ``typescript uploadFile(@UploadedFile() file) { console.log(file); } ``
`UploadedFiles()`
Route handler parameter decorator. Extracts the files object and populates the decorated parameter with the value of files. Used in conjunction with multer middleware for Express-based applications. For example: ``typescript uploadFile(@UploadedFiles() files) { console.log(files); } ``
`UploadedFiles()`
Route handler parameter decorator. Extracts the files object and populates the decorated parameter with the value of files. Used in conjunction with multer middleware for Express-based applications. For example: ``typescript uploadFile(@UploadedFiles() files) { console.log(files); } ``
`UploadedFiles()`
Route handler parameter decorator. Extracts the files object and populates the decorated parameter with the value of files. Used in conjunction with multer middleware for Express-based applications. For example: ``typescript uploadFile(@UploadedFiles() files) { console.log(files); } ``
`Query()`
Route handler parameter decorator. Extracts the query property from the req object and populates the decorated parameter with the value of query. May also apply pipes to the bound query parameter. For example: ``typescript async find(@Query('user') user: string) ``
Parameters:
property(any): name of single property to extract from thequeryobjectpipes(any): one or more pipes to apply to the bound query parameter
`Query()`
Route handler parameter decorator. Extracts the query property from the req object and populates the decorated parameter with the value of query. May also apply pipes to the bound query parameter. For example: ``typescript async find(@Query('user') user: string) ``
Parameters:
property(any): name of single property to extract from thequeryobjectpipes(any): one or more pipes to apply to the bound query parameter
`Query()`
Route handler parameter decorator. Extracts the query property from the req object and populates the decorated parameter with the value of query. May also apply pipes to the bound query parameter. For example: ``typescript async find(@Query('user') user: string) ``
Parameters:
property(any): name of single property to extract from thequeryobjectpipes(any): one or more pipes to apply to the bound query parameter
`Query()`
Route handler parameter decorator. Extracts the query property from the req object and populates the decorated parameter with the value of query. May also apply pipes to the bound query parameter. For example: ``typescript async find(@Query('user') user: string) ``
Parameters:
property(any): name of single property to extract from thequeryobjectoptions(any): options object containing additional configuration for the decorator, such as pipes and schema
`Query()`
Route handler parameter decorator. Extracts the query property from the req object and populates the decorated parameter with the value of query. May also apply pipes to the bound query parameter. For example: ``typescript async find(@Query({ schema: z.object({ user: z.string() }) }) query) ``
Parameters:
options(any): options object containing additional configuration for the decorator, such as pipes and schema
Showing 30 of 97 documented exports.
Documentation Summary:
- Total exports: 147
- Documented: 97
- Undocumented: 50
- Coverage: 66%
HTTP method reference — GET: retrieve data, POST: create, PUT/PATCH: update, DELETE: remove.
<!-- repolens:docs-badge -->  · Examples
Data Flows
Understanding Data Movement
Data flows describe how information moves through NestJS — from external inputs through processing layers to storage or presentation. Understanding these flows is essential for debugging, performance optimization, and architectural decisions.
Flow Summary
6 data flows identified in the codebase:
| Flow | Type | Complexity | Critical |
|---|---|---|---|
| internal Request Flow | Integration | High (6 steps) | 🔴 Yes |
| core Request Flow | Integration | High (6 steps) | 🔴 Yes |
| internal Request Flow | Integration | Low (2 steps) | 🔴 Yes |
| platform-express Request Flow | Integration | Medium (4 steps) | — |
| controllers Request Flow | Integration | Low (2 steps) | — |
| API Integration Flow | Integration | Medium (5 steps) | — |
1. internal Request Flow 🔴 CRITICAL FLOW
Description
Import chain starting from packages/core/internal — traces how this entry point depends on 5 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 6 |
| Modules Involved | 6 |
| Criticality | Critical |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | internal (entry point, imports 36 modules) | Data acquisition |
| 2 | instance-wrapper (shared infrastructure, used by 34 files) | Processing step |
| 3 | module (shared infrastructure, used by 29 files) | Processing step |
| 4 | container (shared infrastructure, used by 23 files) | Processing step |
| 5 | application-config (shared infrastructure, used by 19 files) | Processing step |
| 6 | exclude-route-metadata.interface (shared infrastructure, used by 5 files) | Processing step |
Flow Diagram
┌─ START ─┐
│ `internal` (entry point, imports 36 modules) │
│ ↓
│ `instance-wrapper` (shared infrastructure, used... │
│ ↓
│ `module` (shared infrastructure, used by 29 files) │
│ ↓
│ `container` (shared infrastructure, used by 23 ... │
│ ↓
│ `application-config` (shared infrastructure, us... │
│ ↓
│ `exclude-route-metadata.interface` (shared infr... │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
internal | Core application module |
instance-wrapper | Core application module |
module | Core application module |
container | Core application module |
application-config | Configuration management |
exclude-route-metadata.interface | API layer and route handlers |
Dependencies
Shared libraries used: packages/common/utils, packages/common/module-utils
Insights
- ⚠️ Critical path — Failures here have significant business impact
- 📊 Consider adding monitoring and alerting
- 🧪 Ensure comprehensive test coverage
2. core Request Flow 🔴 CRITICAL FLOW
Description
Import chain starting from packages/core — traces how this entry point depends on 5 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 6 |
| Modules Involved | 6 |
| Criticality | Critical |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | core (entry point, imports 16 modules) | Data acquisition |
| 2 | application-config (shared infrastructure, used by 19 files) | Processing step |
| 3 | instance-wrapper (shared infrastructure, used by 34 files) | Processing step |
| 4 | module (shared infrastructure, used by 29 files) | Processing step |
| 5 | container (shared infrastructure, used by 23 files) | Processing step |
| 6 | modules-container (shared infrastructure, used by 9 files) | Processing step |
Flow Diagram
┌─ START ─┐
│ `core` (entry point, imports 16 modules) │
│ ↓
│ `application-config` (shared infrastructure, us... │
│ ↓
│ `instance-wrapper` (shared infrastructure, used... │
│ ↓
│ `module` (shared infrastructure, used by 29 files) │
│ ↓
│ `container` (shared infrastructure, used by 23 ... │
│ ↓
│ `modules-container` (shared infrastructure, use... │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
core | Core application module |
application-config | Configuration management |
instance-wrapper | Core application module |
module | Core application module |
container | Core application module |
modules-container | Core application module |
Dependencies
Shared libraries used: packages/common/utils, packages/common/module-utils
Insights
- ⚠️ Critical path — Failures here have significant business impact
- 📊 Consider adding monitoring and alerting
- 🧪 Ensure comprehensive test coverage
3. internal Request Flow 🔴 CRITICAL FLOW
Description
Import chain starting from packages/common/internal — traces how this entry point depends on 1 downstream module
Characteristics
| Property | Value |
|---|---|
| Steps | 2 |
| Modules Involved | 2 |
| Criticality | Critical |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | internal (entry point, imports 9 modules) | Data acquisition |
| 2 | shared.utils (shared infrastructure, used by 29 files) | Processing step |
Flow Diagram
┌─ START ─┐
│ `internal` (entry point, imports 9 modules) │
│ ↓
│ `shared.utils` (shared infrastructure, used by ... │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
internal | Core application module |
shared.utils | Utility and helper functions |
Dependencies
Shared libraries used: packages/common/utils, packages/common/module-utils
Insights
- ⚠️ Critical path — Failures here have significant business impact
- 📊 Consider adding monitoring and alerting
- 🧪 Ensure comprehensive test coverage
4. platform-express Request Flow
Description
Import chain starting from packages/platform-express — traces how this entry point depends on 3 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 4 |
| Modules Involved | 4 |
| Criticality | Standard |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | platform-express (entry point, imports 3 modules) | Data acquisition |
| 2 | adapters → imports 1 module | Data acquisition |
| 3 | express-adapter → imports 4 modules | Data acquisition |
| 4 | nest-express-body-parser.interface (leaf — no further dependencies) | Data transformation |
Flow Diagram
┌─ START ─┐
│ `platform-express` (entry point, imports 3 modu... │
│ ↓
│ `adapters` → imports 1 module │
│ ↓
│ `express-adapter` → imports 4 modules │
│ ↓
│ `nest-express-body-parser.interface` (leaf — no... │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
platform-express | Core application module |
adapters | Core application module |
express-adapter | Core application module |
nest-express-body-parser.interface | Core application module |
Dependencies
Shared libraries used: packages/common/utils, packages/common/module-utils
Insights
- Standard integration flow with 4 processing steps
5. controllers Request Flow
Description
Import chain starting from packages/common/interfaces/controllers — traces how this entry point depends on 1 downstream module
Characteristics
| Property | Value |
|---|---|
| Steps | 2 |
| Modules Involved | 2 |
| Criticality | Standard |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | controllers (entry point, imports 2 modules) | Data acquisition |
| 2 | controller-metadata.interface (leaf — no further dependencies) | Processing step |
Flow Diagram
┌─ START ─┐
│ `controllers` (entry point, imports 2 modules) │
│ ↓
│ `controller-metadata.interface` (leaf — no furt... │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
controllers | Core application module |
controller-metadata.interface | Core application module |
Dependencies
Shared libraries used: packages/common/utils, packages/common/module-utils
Insights
- Standard integration flow with 2 processing steps
6. API Integration Flow
Description
External service integrations and backend processing
Characteristics
| Property | Value |
|---|---|
| Steps | 5 |
| Modules Involved | 1 |
| Criticality | Standard |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | Frontend makes API request | Processing step |
| 2 | API route receives and validates request | Input validation |
| 3 | Business logic is executed | Observability |
| 4 | External services may be called | Processing step |
| 5 | Response is formatted and returned | Output generation |
Flow Diagram
┌─ START ─┐
│ Frontend makes API request │
│ ↓
│ API route receives and validates request │
│ ↓
│ Business logic is executed │
│ ↓
│ External services may be called │
│ ↓
│ Response is formatted and returned │
└─ END ───┘
Involved Modules
| Module | Role |
|---|---|
1 API endpoints detected | API layer and route handlers |
Dependencies
Shared libraries used: packages/common/utils, packages/common/module-utils
Insights
- Standard integration flow with 5 processing steps
Import Network
The system has 1229 internal import edges connecting 430 source files.
Network Topology
| Metric | Value | Meaning |
|---|---|---|
| Total Edges | 1229 | Direct import relationships |
| Hub Count | 0 | Central integration points |
| Avg Connections | ~2.9 per file | Coupling density |
Flow detection uses naming conventions, import patterns, and dependency graph analysis. Enable AI enhancement with `GITHUB_TOKEN` for end-to-end flow narratives, failure mode analysis, data transformation descriptions, and performance bottleneck identification.
<!-- repolens:docs-badge -->  · Examples
Architecture Diff
No changes detected.
<!-- repolens:docs-badge -->  · Examples
System Map
What is this? This visual diagram shows how different parts of your codebase connect to each other. Arrows indicate dependencies (which modules use which).
Showing: 30 modules and 84 relationships
Source: Real import analysis
Architecture Diagram
┌─────────────────────────────────────────────────────────────┐
│ 🏗️ SYSTEM ARCHITECTURE MAP │
└─────────────────────────────────────────────────────────────┘
⚙️ CORE LOGIC
│
├── router (32 files)
│ → errors
│ → helpers
│ → exceptions
│ ... +5 more
├── injector (30 files)
│ → errors
│ → discovery
│ ╌→ inspector
│ ... +5 more
├── helpers (27 files)
│ → injector
│ → router
│ → exceptions
│ ... +4 more
├── errors (26 files)
│ → injector
├── repl (16 files)
│ → injector
│ → router
├── hooks (8 files)
│ → injector
├── middleware (8 files)
│ → router
│ → helpers
│ → injector
│ ... +3 more
├── exceptions (7 files)
│ → helpers
│ → injector
│ → adapters
│ ... +2 more
├── discovery (4 files)
│ → injector
├── guards (4 files)
│ → helpers
│ → injector
├── pipes (4 files)
│ → helpers
│ → injector
├── interceptors (3 files)
│ → helpers
│ → injector
├── interfaces (3 files)
├── security (3 files)
│ → middleware
│ → router
├── adapters (2 files)
│ → helpers
└── services (2 files)
│
🔌 INTEGRATION
│
└── adapters (4 files)
→ interfaces
│
🛠️ UTILITIES
│
├── interfaces (71 files)
│ → services
│ → enums
├── decorators (29 files)
│ → interfaces
│ → utils
│ → enums
├── exceptions (24 files)
│ → enums
│ → interfaces
│ → utils
├── pipes (21 files)
│ → decorators
│ → interfaces
│ → utils
│ ... +2 more
├── utils (15 files)
│ → decorators
│ → interfaces
│ → enums
│ ... +2 more
├── module-utils (10 files)
│ → interfaces
│ → services
│ → utils
├── services (10 files)
│ → decorators
│ → utils
├── serializer (8 files)
│ → decorators
│ → file-stream
│ → interfaces
│ ... +1 more
├── enums (6 files)
└── file-stream (5 files)
→ enums
→ services
→ utils
│
✅ TESTING
│
└── inspector (15 files)
→ errors
→ injector
→ helpers
... +2 more
│
📦 OTHER
│
├── multer (15 files)
└── interfaces (5 files)
│
Legend:
→ imports / depends on
╌→ tests
Key Connections
Most depended-on modules (highest import count):
| Module | Imported by |
|---|---|
packages/core/injector | 82 modules |
packages/common/utils | 58 modules |
packages/common/interfaces | 48 modules |
packages/core/helpers | 41 modules |
packages/common/enums | 39 modules |
Most dependent modules (highest dependency count):
| Module | Depends on |
|---|---|
packages/common/pipes | 70 modules |
packages/core/router | 47 modules |
packages/core/injector | 41 modules |
packages/common/decorators | 39 modules |
packages/core/middleware | 34 modules |
<!-- repolens:docs-badge -->  · Examples
Developer Onboarding
Welcome to NestJS! 👋
This guide will help you get up to speed quickly. NestJS is a Express, Fastify project built with TypeScript, Node.js, containing 43 modules across 430 files.
What You'll Learn
- ✅ Repository structure and organization
- ✅ Technology stack and tools
- ✅ Key modules to understand first
- ✅ How data flows through the system
- ✅ How to start contributing
Quick Reference Card
| Aspect | Details |
|---|---|
| Languages | TypeScript, Node.js |
| Frameworks | Express, Fastify |
| Build Tools | Vite |
| Testing | Vitest |
| Size | 43 modules, 430 files |
| Domains | 8 functional areas |
| API | 1 endpoints |
Repository Structure
Understanding the directory layout is your first step to navigating the codebase:
| Directory | Purpose | Start Here? |
|---|---|---|
packages/common | Project files | — |
packages/core | Core logic and foundations | ⭐ Yes |
packages/platform-express | Project files | — |
Where to Begin
Focus on these directories first:
- `packages/core` — Core logic and foundations
Monorepo Navigation
This is a npm/yarn workspaces monorepo with 3 packages. Here's how to navigate:
| Package | Location | What It Does |
|---|---|---|
@nestjs/common | packages/common | Utility libraries |
@nestjs/core | packages/core | Core functionality and shared code |
@nestjs/platform-express | packages/platform-express | Package functionality |
Pro tip: Each package can typically be developed independently. Check the package's own README.md for specific setup instructions.
Technology Stack
| Layer | Technologies | What to Learn |
|---|---|---|
| Framework | Express, Fastify | Understand middleware chains and route handling |
| Language | TypeScript, Node.js | Strong typing — check types when debugging |
| Build | Vite | Understand the build pipeline |
| Testing | Vitest | Run existing tests to understand behavior |
Core Modules to Understand
These are the most important modules by size and centrality. Understanding them will unlock the rest of the codebase:
| Priority | Module | Files | Type | Why It Matters |
|---|---|---|---|---|
| ⭐ High | packages/common/interfaces | 71 | Shared Libraries | Shared code — reused throughout |
| ⭐ High | packages/core/router | 32 | Route/Page Modules | Large module — core functionality |
| ⭐ High | packages/core/injector | 30 | core | Large module — core functionality |
| Medium | packages/common/decorators | 29 | Shared Libraries | Shared code — reused throughout |
| Medium | packages/core/helpers | 27 | Shared Libraries | Shared code — reused throughout |
| Medium | packages/core/errors | 26 | core | Large module — core functionality |
| Low | packages/common/exceptions | 24 | Shared Libraries | Shared code — reused throughout |
| Low | packages/common/pipes | 21 | Shared Libraries | Shared code — reused throughout |
| Low | packages/core/repl | 16 | core | Key system component |
| Low | packages/common/utils | 15 | Shared Libraries | Shared code — reused throughout |
Key Routes
Understanding the routing structure helps you trace user interactions through the system.
API Endpoints
| Endpoint | Methods | File | Purpose |
|---|---|---|---|
*path | ALL | packages/platform-express/adapters/express-adapter.ts | Data operations |
How Data Flows
Understanding these flows helps you see how the system processes information end-to-end:
| Flow | Description | Key Modules |
|---|---|---|
| internal Request Flow | Import chain starting from packages/core/internal — traces... | internal, instance-wrapper |
| core Request Flow | Import chain starting from packages/core — traces how this... | core, application-config |
| internal Request Flow | Import chain starting from packages/common/internal — trac... | internal, shared.utils |
| platform-express Request Flow | Import chain starting from packages/platform-express — tra... | platform-express, adapters |
| controllers Request Flow | Import chain starting from `packages/common/interfaces/contr... | controllers, controller-metadata.interface |
Debugging tip: When investigating issues, trace the data flow from input to output to identify where problems occur.
Getting Started Checklist
Follow these steps to set up your development environment:
1. Clone and Install
git clone <repository-url>
cd nestjs
npm install # or yarn, pnpm
2. Explore the Structure
- Review the directory structure above
- Open the
README.mdfor project-specific instructions - Look for
CONTRIBUTING.mdfor contribution guidelines
3. Understand Core Modules
Start with the high-priority modules listed above. Read the code and comments to understand:
- What problem each module solves
- How modules interact with each other
- What data structures are used
4. Run the Tests
npm test # or: npx vitest run
Running tests helps you:
- Verify your setup is correct
- See expected behavior documented in test cases
- Understand module interfaces through test examples
5. Make Your First Change
Start small:
- Find a small bug or typo to fix
- Make the change in a feature branch
- Run tests to ensure nothing breaks
- Submit a pull request for review
Common Pitfalls
New contributors often run into these issues:
- Circular dependencies — This codebase has 50 circular imports. Be careful not to introduce more.
- Monorepo boundaries — Remember to build dependent packages when making changes.
- Environment setup — Check for
.env.examplefiles and ensure you have all required environment variables. - Branch naming — Follow the team's branch naming conventions (usually
feature/,fix/,docs/).
Additional Resources
| Resource | Purpose |
|---|---|
README.md | Project overview and quick start |
CONTRIBUTING.md | Contribution guidelines (if exists) |
CHANGELOG.md | Recent changes and release history |
package.json | Available scripts and dependencies |
Root package.json | Monorepo workspace configuration |
This onboarding guide was generated from comprehensive repository analysis. Enable AI enhancement with `GITHUB_TOKEN` for narrative walkthroughs, common pitfall documentation, debugging tips, architecture deep-dives, and personalized contribution recommendations.
Welcome to the team! Happy coding! 🚀
<!-- repolens:docs-badge -->  · Examples
GraphQL Schema
libraries: type-graphql
Libraries and Frameworks
The following GraphQL libraries and frameworks were detected in the project dependencies:
| Library | Status |
|---|---|
| type-graphql | Detected |
Generated by RepoLens extended analysis. Schema detection is based on static analysis of source files and may not capture runtime-only definitions.
<!-- repolens:docs-badge -->  · Examples
TypeScript Type Graph
265 file(s) with type declarations · 140 interface(s) · 103 type alias(es) · 154 class(es) · 7 enum(s) · 116 relationship(s)
This document maps the type system of the project, showing how interfaces, classes, and type aliases relate to one another. Understanding these relationships helps navigate the codebase and identify coupling between modules.
Interfaces
140 interfaces define the data contracts used across the application:
| Interface | Extends | Source |
|---|---|---|
ControllerOptions | ScopeOptions, VersionOptions | packages/common/decorators/core/controller.decorator.ts |
RequestMappingMetadata | — | packages/common/decorators/http/request-mapping.decorator.ts |
ParameterDecoratorOptions | — | packages/common/decorators/http/route-params.decorator.ts |
ResponseDecoratorOptions | — | packages/common/decorators/http/route-params.decorator.ts |
RouteParamMetadata | — | packages/common/decorators/http/route-params.decorator.ts |
SseOptions | — | packages/common/decorators/http/sse.decorator.ts |
HttpExceptionOptions | — | packages/common/exceptions/http.exception.ts |
DescriptionAndOptions | — | packages/common/exceptions/http.exception.ts |
StreamableHandlerResponse | — | packages/common/file-stream/interfaces/streamable-handler-response.interface.ts |
StreamableFileOptions | — | packages/common/file-stream/interfaces/streamable-options.interface.ts |
GetOrResolveOptions | — | packages/common/interfaces/nest-application-context.interface.ts |
INestApplicationContext | — | packages/common/interfaces/nest-application-context.interface.ts |
NestApplicationOptions | NestApplicationContextOptions | packages/common/interfaces/nest-application-options.interface.ts |
INestMicroservice | INestApplicationContext | packages/common/interfaces/nest-microservice.interface.ts |
RouteConflictPolicy | — | packages/common/interfaces/router-options.interface.ts |
ScopeOptions | — | packages/common/interfaces/scope-options.interface.ts |
ShutdownHooksOptions | — | packages/common/interfaces/shutdown-hooks-options.interface.ts |
VersionOptions | — | packages/common/interfaces/version-options.interface.ts |
HeaderVersioningOptions | — | packages/common/interfaces/version-options.interface.ts |
UriVersioningOptions | — | packages/common/interfaces/version-options.interface.ts |
MediaTypeVersioningOptions | — | packages/common/interfaces/version-options.interface.ts |
CustomVersioningOptions | — | packages/common/interfaces/version-options.interface.ts |
VersioningCommonOptions | — | packages/common/interfaces/version-options.interface.ts |
ControllerMetadata | — | packages/common/interfaces/controllers/controller-metadata.interface.ts |
ExceptionFilterMetadata | — | packages/common/interfaces/exceptions/exception-filter-metadata.interface.ts |
RpcExceptionFilterMetadata | — | packages/common/interfaces/exceptions/rpc-exception-filter-metadata.interface.ts |
ClassTransformOptions | — | packages/common/interfaces/external/class-transform-options.interface.ts |
CorsOptions | — | packages/common/interfaces/external/cors-options.interface.ts |
CorsOptionsCallback | — | packages/common/interfaces/external/cors-options.interface.ts |
HttpsOptions | — | packages/common/interfaces/external/https-options.interface.ts |
TransformerPackage | — | packages/common/interfaces/external/transformer-package.interface.ts |
ValidationError | — | packages/common/interfaces/external/validation-error.interface.ts |
ValidatorOptions | — | packages/common/interfaces/external/validator-options.interface.ts |
ValidatorPackage | — | packages/common/interfaces/external/validator-package.interface.ts |
HttpArgumentsHost | — | packages/common/interfaces/features/arguments-host.interface.ts |
WsArgumentsHost | — | packages/common/interfaces/features/arguments-host.interface.ts |
RpcArgumentsHost | — | packages/common/interfaces/features/arguments-host.interface.ts |
ArgumentsHost | — | packages/common/interfaces/features/arguments-host.interface.ts |
CanActivate | — | packages/common/interfaces/features/can-activate.interface.ts |
ExecutionContext | ArgumentsHost | packages/common/interfaces/features/execution-context.interface.ts |
BeforeApplicationShutdown | — | packages/common/interfaces/hooks/before-application-shutdown.interface.ts |
OnApplicationBootstrap | — | packages/common/interfaces/hooks/on-application-bootstrap.interface.ts |
OnApplicationShutdown | — | packages/common/interfaces/hooks/on-application-shutdown.interface.ts |
OnModuleDestroy | — | packages/common/interfaces/hooks/on-destroy.interface.ts |
OnModuleInit | — | packages/common/interfaces/hooks/on-init.interface.ts |
CookieSerializeOptions | — | packages/common/interfaces/http/cookie-options.interface.ts |
CookiesOptions | — | packages/common/interfaces/http/cookie-options.interface.ts |
HttpExceptionBody | — | packages/common/interfaces/http/http-exception-body.interface.ts |
HttpRedirectResponse | — | packages/common/interfaces/http/http-redirect-response.interface.ts |
RouteMatchingOptions | — | packages/common/interfaces/http/http-server.interface.ts |
MessageEvent | — | packages/common/interfaces/http/message-event.interface.ts |
ContentSecurityPolicyOptions | — | packages/common/interfaces/http/security-headers-options.interface.ts |
SecurityHeadersOptions | — | packages/common/interfaces/http/security-headers-options.interface.ts |
NestHybridApplicationOptions | — | packages/common/interfaces/microservices/nest-hybrid-application-options.interface.ts |
PreRequestHook | — | packages/common/interfaces/microservices/pre-request-hook.interface.ts |
ITransportServer | — | packages/common/interfaces/microservices/transport-server.interface.ts |
MiddlewareConfigProxy | — | packages/common/interfaces/middleware/middleware-config-proxy.interface.ts |
RouteInfo | — | packages/common/interfaces/middleware/middleware-configuration.interface.ts |
MiddlewareConsumer | — | packages/common/interfaces/middleware/middleware-consumer.interface.ts |
DynamicModule | ModuleMetadata | packages/common/interfaces/modules/dynamic-module.interface.ts |
IntrospectionResult | — | packages/common/interfaces/modules/introspection-result.interface.ts |
ModuleMetadata | — | packages/common/interfaces/modules/module-metadata.interface.ts |
NestModule | — | packages/common/interfaces/modules/nest-module.interface.ts |
ConfigurableModuleBuilderOptions | — | packages/common/module-utils/configurable-module.builder.ts |
ParseBoolPipeOptions | — | packages/common/pipes/parse-bool.pipe.ts |
ParseDatePipeOptions | — | packages/common/pipes/parse-date.pipe.ts |
ParseEnumPipeOptions | — | packages/common/pipes/parse-enum.pipe.ts |
ParseFloatPipeOptions | — | packages/common/pipes/parse-float.pipe.ts |
ParseIntPipeOptions | — | packages/common/pipes/parse-int.pipe.ts |
ParseUUIDPipeOptions | — | packages/common/pipes/parse-uuid.pipe.ts |
StandardSchemaValidationPipeOptions | — | packages/common/pipes/standard-schema-validation.pipe.ts |
ValidationPipeOptions | ValidatorOptions | packages/common/pipes/validation.pipe.ts |
ParseFileOptions | — | packages/common/pipes/file/parse-file-options.interface.ts |
IFile | — | packages/common/pipes/file/interfaces/file.interface.ts |
PlainLiteralObject | — | packages/common/serializer/class-serializer.interceptor.ts |
ClassSerializerInterceptorOptions | ClassTransformOptions | packages/common/serializer/class-serializer.interceptor.ts |
ClassSerializerContextOptions | ClassTransformOptions | packages/common/serializer/class-serializer.interfaces.ts |
PlainLiteralObject | — | packages/common/serializer/standard-schema-serializer.interceptor.ts |
StandardSchemaSerializerInterceptorOptions | — | packages/common/serializer/standard-schema-serializer.interceptor.ts |
StandardSchemaSerializerContextOptions | — | packages/common/serializer/standard-schema-serializer.interfaces.ts |
ConsoleLoggerOptions | — | packages/common/services/console-logger.service.ts |
LoggerService | — | packages/common/services/logger.service.ts |
LogBufferRecord | — | packages/common/services/logger.service.ts |
ApplicationProviderWrapper | — | packages/core/scanner.ts |
ModulesScanParameters | — | packages/core/scanner.ts |
FilterByInclude | — | packages/core/discovery/discovery-service.ts |
FilterByMetadataKey | — | packages/core/discovery/discovery-service.ts |
ContextIdResolver | — | packages/core/helpers/context-id-factory.ts |
ParamsFactory | — | packages/core/helpers/external-context-creator.ts |
ExternalContextOptions | — | packages/core/helpers/external-context-creator.ts |
HandlerMetadata | — | packages/core/helpers/handler-metadata-storage.ts |
ExternalHandlerMetadata | — | packages/core/helpers/interfaces/external-handler-metadata.interface.ts |
ParamMetadata | — | packages/core/helpers/interfaces/params-metadata.interface.ts |
ModuleFactory | — | packages/core/injector/compiler.ts |
PropertyDependency | — | packages/core/injector/injector.ts |
InjectorDependencyContext | — | packages/core/injector/injector.ts |
ResolutionContext | — | packages/core/injector/injector.ts |
HostComponentInfo | — | packages/core/injector/instance-wrapper.ts |
ContextId | — | packages/core/injector/instance-wrapper.ts |
PropertyMetadata | — | packages/core/injector/instance-wrapper.ts |
InstanceMetadataStore | — | packages/core/injector/instance-wrapper.ts |
ModuleRefGetOrResolveOpts | — | packages/core/injector/module-ref.ts |
SettlementSignalRef | — | packages/core/injector/settlement-signal.ts |
LazyModuleLoaderLoadOptions | — | packages/core/injector/lazy-module-loader/lazy-module-loader-options.interface.ts |
ModuleOpaqueKeyFactory | — | packages/core/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.ts |
Edge | — | packages/core/inspector/interfaces/edge.interface.ts |
EnhancerMetadataCacheEntry | — | packages/core/inspector/interfaces/enhancer-metadata-cache-entry.interface.ts |
AttachedEnhancerDefinition | — | packages/core/inspector/interfaces/extras.interface.ts |
OrphanedEnhancerDefinition | — | packages/core/inspector/interfaces/extras.interface.ts |
Extras | — | packages/core/inspector/interfaces/extras.interface.ts |
SerializedGraphJson | — | packages/core/inspector/interfaces/serialized-graph-json.interface.ts |
SerializedGraphMetadata | — | packages/core/inspector/interfaces/serialized-graph-metadata.interface.ts |
ModuleOverride | — | packages/core/interfaces/module-override.interface.ts |
RouteDefinition | — | packages/core/router/paths-explorer.ts |
PathSegment | — | packages/core/router/route-conflict-detector.ts |
ParamProperties | — | packages/core/router/router-execution-context.ts |
RouteDefinition | — | packages/core/router/router-explorer.ts |
CustomHeader | — | packages/core/router/router-response-controller.ts |
RedirectResponse | — | packages/core/router/router-response-controller.ts |
ReadHeaders | — | packages/core/router/sse-stream.ts |
WriteHeaders | — | packages/core/router/sse-stream.ts |
ExceptionsFilter | — | packages/core/router/interfaces/exceptions-filter.interface.ts |
ExcludeRouteMetadata | — | packages/core/router/interfaces/exclude-route-metadata.interface.ts |
ResolvedRoute | — | packages/core/router/interfaces/resolved-route.interface.ts |
Resolver | — | packages/core/router/interfaces/resolver.interface.ts |
RouteConflict | — | packages/core/router/interfaces/route-conflict.interface.ts |
IRouteParamsFactory | — | packages/core/router/interfaces/route-params-factory.interface.ts |
RoutePathMetadata | — | packages/core/router/interfaces/route-path-metadata.interface.ts |
RouteResolutionOptions | — | packages/core/router/interfaces/route-resolution-options.interface.ts |
RouteTree | — | packages/core/router/interfaces/routes.interface.ts |
CrossOriginRequestInfo | — | packages/core/security/cross-origin-protection.ts |
CrossOriginExemptions | — | packages/core/security/cross-origin-protection.ts |
ResolvedSecurityHeaders | — | packages/core/security/security-headers.ts |
NestExpressBodyParserOptions | — | packages/platform-express/interfaces/nest-express-body-parser-options.interface.ts |
NestExpressBodyParserOptionsMap | — | packages/platform-express/interfaces/nest-express-body-parser.interface.ts |
ServeStaticOptions | — | packages/platform-express/interfaces/serve-static-options.interface.ts |
MulterOptionsFactory | — | packages/platform-express/multer/interfaces/files-upload-module.interface.ts |
MulterLimits | — | packages/platform-express/multer/interfaces/multer-options.interface.ts |
MulterOptions | — | packages/platform-express/multer/interfaces/multer-options.interface.ts |
MulterField | — | packages/platform-express/multer/interfaces/multer-options.interface.ts |
Classes
154 classes provide concrete implementations:
| Class | Extends | Implements | Source |
|---|---|---|---|
BadGatewayException | HttpException | — | packages/common/exceptions/bad-gateway.exception.ts |
BadRequestException | HttpException | — | packages/common/exceptions/bad-request.exception.ts |
ConflictException | HttpException | — | packages/common/exceptions/conflict.exception.ts |
ForbiddenException | HttpException | — | packages/common/exceptions/forbidden.exception.ts |
GatewayTimeoutException | HttpException | — | packages/common/exceptions/gateway-timeout.exception.ts |
GoneException | HttpException | — | packages/common/exceptions/gone.exception.ts |
HttpVersionNotSupportedException | HttpException | — | packages/common/exceptions/http-version-not-supported.exception.ts |
HttpException | IntrinsicException | — | packages/common/exceptions/http.exception.ts |
ImATeapotException | HttpException | — | packages/common/exceptions/im-a-teapot.exception.ts |
InternalServerErrorException | HttpException | — | packages/common/exceptions/internal-server-error.exception.ts |
IntrinsicException | Error | — | packages/common/exceptions/intrinsic.exception.ts |
MethodNotAllowedException | HttpException | — | packages/common/exceptions/method-not-allowed.exception.ts |
MisdirectedException | HttpException | — | packages/common/exceptions/misdirected.exception.ts |
NotAcceptableException | HttpException | — | packages/common/exceptions/not-acceptable.exception.ts |
NotFoundException | HttpException | — | packages/common/exceptions/not-found.exception.ts |
NotImplementedException | HttpException | — | packages/common/exceptions/not-implemented.exception.ts |
PayloadTooLargeException | HttpException | — | packages/common/exceptions/payload-too-large.exception.ts |
PreconditionFailedException | HttpException | — | packages/common/exceptions/precondition-failed.exception.ts |
RequestTimeoutException | HttpException | — | packages/common/exceptions/request-timeout.exception.ts |
ServiceUnavailableException | HttpException | — | packages/common/exceptions/service-unavailable.exception.ts |
UnauthorizedException | HttpException | — | packages/common/exceptions/unauthorized.exception.ts |
UnprocessableEntityException | HttpException | — | packages/common/exceptions/unprocessable-entity.exception.ts |
UnsupportedMediaTypeException | HttpException | — | packages/common/exceptions/unsupported-media-type.exception.ts |
StreamableFile | — | — | packages/common/file-stream/streamable-file.ts |
NestApplicationContextOptions | — | — | packages/common/interfaces/nest-application-context-options.interface.ts |
InternalModuleClass | — | — | packages/common/module-utils/configurable-module.builder.ts |
IntegrationModule | ConfigurableModuleCls | — | packages/common/module-utils/interfaces/configurable-module-host.interface.ts |
IntegrationModule | ConfigurableModuleCls | — | packages/common/module-utils/interfaces/configurable-module-host.interface.ts |
IntegrationModule | ConfigurableModuleCls | — | packages/common/module-utils/interfaces/configurable-module-host.interface.ts |
ParseArrayPipe | — | PipeTransform | packages/common/pipes/parse-array.pipe.ts |
ParseBoolPipe | — | PipeTransform | packages/common/pipes/parse-bool.pipe.ts |
ParseDatePipe | — | PipeTransform | packages/common/pipes/parse-date.pipe.ts |
ParseFloatPipe | — | PipeTransform | packages/common/pipes/parse-float.pipe.ts |
ParseIntPipe | — | PipeTransform | packages/common/pipes/parse-int.pipe.ts |
ParseUUIDPipe | — | PipeTransform | packages/common/pipes/parse-uuid.pipe.ts |
StandardSchemaValidationPipe | — | PipeTransform | packages/common/pipes/standard-schema-validation.pipe.ts |
ValidationPipe | — | PipeTransform | packages/common/pipes/validation.pipe.ts |
ParseFilePipeBuilder | — | — | packages/common/pipes/file/parse-file-pipe.builder.ts |
ParseFilePipe | — | PipeTransform | packages/common/pipes/file/parse-file.pipe.ts |
ClassSerializerInterceptor | — | NestInterceptor | packages/common/serializer/class-serializer.interceptor.ts |
StandardSchemaSerializerInterceptor | — | NestInterceptor | packages/common/serializer/standard-schema-serializer.interceptor.ts |
return | — | — | packages/common/serializer/standard-schema-serializer.interceptor.ts |
ConsoleLogger | — | LoggerService | packages/common/services/console-logger.service.ts |
Logger | — | LoggerService | packages/common/services/logger.service.ts |
InvalidDecoratorItemException | Error | — | packages/common/utils/validate-each.util.ts |
ApplicationConfig | — | — | packages/core/application-config.ts |
MetadataScanner | — | — | packages/core/metadata-scanner.ts |
NestFactoryStatic | — | — | packages/core/nest-factory.ts |
DependenciesScanner | — | — | packages/core/scanner.ts |
DiscoverableMetaHostCollection | — | — | packages/core/discovery/discoverable-meta-host-collection.ts |
DiscoveryModule | — | — | packages/core/discovery/discovery-module.ts |
DiscoveryService | — | — | packages/core/discovery/discovery-service.ts |
ExceptionHandler | — | — | packages/core/errors/exception-handler.ts |
ExceptionsZone | — | — | packages/core/errors/exceptions-zone.ts |
CircularDependencyException | RuntimeException | — | packages/core/errors/exceptions/circular-dependency.exception.ts |
InvalidClassModuleException | RuntimeException | — | packages/core/errors/exceptions/invalid-class-module.exception.ts |
InvalidClassScopeException | RuntimeException | — | packages/core/errors/exceptions/invalid-class-scope.exception.ts |
InvalidClassException | RuntimeException | — | packages/core/errors/exceptions/invalid-class.exception.ts |
InvalidExceptionFilterException | RuntimeException | — | packages/core/errors/exceptions/invalid-exception-filter.exception.ts |
InvalidMiddlewareConfigurationException | RuntimeException | — | packages/core/errors/exceptions/invalid-middleware-configuration.exception.ts |
InvalidMiddlewareException | RuntimeException | — | packages/core/errors/exceptions/invalid-middleware.exception.ts |
InvalidModuleException | RuntimeException | — | packages/core/errors/exceptions/invalid-module.exception.ts |
InvalidProviderException | RuntimeException | — | packages/core/errors/exceptions/invalid-provider.exception.ts |
RequestScopedCreateException | RuntimeException | — | packages/core/errors/exceptions/request-scoped-create.exception.ts |
RequestScopedGlobalEnhancerException | RuntimeException | — | packages/core/errors/exceptions/request-scoped-global-enhancer.exception.ts |
RouteConflictException | RuntimeException | — | packages/core/errors/exceptions/route-conflict.exception.ts |
RuntimeException | Error | — | packages/core/errors/exceptions/runtime.exception.ts |
UndefinedDependencyException | RuntimeException | — | packages/core/errors/exceptions/undefined-dependency.exception.ts |
UndefinedForwardRefException | RuntimeException | — | packages/core/errors/exceptions/undefined-forwardref.exception.ts |
UndefinedModuleException | RuntimeException | — | packages/core/errors/exceptions/undefined-module.exception.ts |
UninstantiatedGlobalEnhancerException | RuntimeException | — | packages/core/errors/exceptions/uninstantiated-global-enhancer.exception.ts |
UnknownDependenciesException | RuntimeException | — | packages/core/errors/exceptions/unknown-dependencies.exception.ts |
UnknownElementException | RuntimeException | — | packages/core/errors/exceptions/unknown-element.exception.ts |
UnknownExportException | RuntimeException | — | packages/core/errors/exceptions/unknown-export.exception.ts |
UnknownModuleException | RuntimeException | — | packages/core/errors/exceptions/unknown-module.exception.ts |
UnknownRequestMappingException | RuntimeException | — | packages/core/errors/exceptions/unknown-request-mapping.exception.ts |
BaseExceptionFilterContext | ContextCreator | — | packages/core/exceptions/base-exception-filter-context.ts |
ExceptionsHandler | BaseExceptionFilter | — | packages/core/exceptions/exceptions-handler.ts |
ExternalExceptionFilterContext | BaseExceptionFilterContext | — | packages/core/exceptions/external-exception-filter-context.ts |
ExternalExceptionsHandler | ExternalExceptionFilter | — | packages/core/exceptions/external-exceptions-handler.ts |
GuardsConsumer | — | — | packages/core/guards/guards-consumer.ts |
GuardsContextCreator | ContextCreator | — | packages/core/guards/guards-context-creator.ts |
Barrier | — | — | packages/core/helpers/barrier.ts |
ContextCreator | — | — | packages/core/helpers/context-creator.ts |
ContextIdFactory | — | — | packages/core/helpers/context-id-factory.ts |
ContextUtils | — | — | packages/core/helpers/context-utils.ts |
ExecutionContextHost | — | ExecutionContext | packages/core/helpers/execution-context-host.ts |
ExternalContextCreator | — | — | packages/core/helpers/external-context-creator.ts |
ExternalErrorProxy | — | — | packages/core/helpers/external-proxy.ts |
RouterMethodFactory | — | — | packages/core/helpers/router-method-factory.ts |
CookieSigner | — | — | packages/core/helpers/cookies/cookie-signer.ts |
AbstractInstanceResolver | — | — | packages/core/injector/abstract-instance-resolver.ts |
ModuleCompiler | — | — | packages/core/injector/compiler.ts |
NestContainer | — | — | packages/core/injector/container.ts |
HostSettlementRef | — | — | packages/core/injector/injector.ts |
Injector | — | — | packages/core/injector/injector.ts |
InstanceLinksHost | — | — | packages/core/injector/instance-links-host.ts |
InternalProvidersStorage | — | — | packages/core/injector/internal-providers-storage.ts |
ModuleRef | AbstractInstanceResolver | — | packages/core/injector/module-ref.ts |
Module | — | — | packages/core/injector/module.ts |
SettlementSignal | — | — | packages/core/injector/settlement-signal.ts |
SilentLogger | Logger | — | packages/core/injector/helpers/silent-logger.ts |
InternalCoreModuleFactory | — | — | packages/core/injector/internal-core-module/internal-core-module-factory.ts |
InternalCoreModule | — | — | packages/core/injector/internal-core-module/internal-core-module.ts |
LazyModuleLoader | — | — | packages/core/injector/lazy-module-loader/lazy-module-loader.ts |
ByReferenceModuleOpaqueKeyFactory | — | ModuleOpaqueKeyFactory | packages/core/injector/opaque-key-factory/by-reference-module-opaque-key-factory.ts |
DeepHashedModuleOpaqueKeyFactory | — | ModuleOpaqueKeyFactory | packages/core/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.ts |
TopologyTree | — | — | packages/core/injector/topology-tree/topology-tree.ts |
DeterministicUuidRegistry | — | — | packages/core/inspector/deterministic-uuid-registry.ts |
GraphInspector | — | — | packages/core/inspector/graph-inspector.ts |
InitializeOnPreviewAllowlist | — | — | packages/core/inspector/initialize-on-preview.allowlist.ts |
PartialGraphHost | — | — | packages/core/inspector/partial-graph.host.ts |
SerializedGraph | — | — | packages/core/inspector/serialized-graph.ts |
UuidFactory | — | — | packages/core/inspector/uuid-factory.ts |
InterceptorsConsumer | — | — | packages/core/interceptors/interceptors-consumer.ts |
InterceptorsContextCreator | ContextCreator | — | packages/core/interceptors/interceptors-context-creator.ts |
MiddlewareBuilder | — | MiddlewareConsumer | packages/core/middleware/builder.ts |
MiddlewareContainer | — | — | packages/core/middleware/container.ts |
MiddlewareResolver | — | — | packages/core/middleware/resolver.ts |
RouteInfoPathExtractor | — | — | packages/core/middleware/route-info-path-extractor.ts |
RoutesMapper | — | — | packages/core/middleware/routes-mapper.ts |
ParamsTokenFactory | — | — | packages/core/pipes/params-token-factory.ts |
PipesConsumer | — | — | packages/core/pipes/pipes-consumer.ts |
PipesContextCreator | ContextCreator | — | packages/core/pipes/pipes-context-creator.ts |
ReplContext | — | — | packages/core/repl/repl-context.ts |
ReplLogger | ConsoleLogger | — | packages/core/repl/repl-logger.ts |
DebugReplFn | ReplFunction | — | packages/core/repl/native-functions/debug-repl-fn.ts |
GetReplFn | ReplFunction | — | packages/core/repl/native-functions/get-repl-fn.ts |
HelpReplFn | ReplFunction | — | packages/core/repl/native-functions/help-repl-fn.ts |
MethodsReplFn | ReplFunction | — | packages/core/repl/native-functions/methods-repl-fn.ts |
ResolveReplFn | ReplFunction | — | packages/core/repl/native-functions/resolve-repl-fn.ts |
SelectReplFn | ReplFunction | — | packages/core/repl/native-functions/select-relp-fn.ts |
LegacyRouteConverter | — | — | packages/core/router/legacy-route-converter.ts |
PathsExplorer | — | — | packages/core/router/paths-explorer.ts |
RouteConflictDetector | — | — | packages/core/router/route-conflict-detector.ts |
RouteParamsFactory | — | IRouteParamsFactory | packages/core/router/route-params-factory.ts |
RoutePathFactory | — | — | packages/core/router/route-path-factory.ts |
RouteSpecificitySorter | — | — | packages/core/router/route-specificity-sorter.ts |
RouterExceptionFilters | BaseExceptionFilterContext | — | packages/core/router/router-exception-filters.ts |
RouterExecutionContext | — | — | packages/core/router/router-execution-context.ts |
RouterExplorer | — | — | packages/core/router/router-explorer.ts |
RouterModule | — | — | packages/core/router/router-module.ts |
RouterProxy | — | — | packages/core/router/router-proxy.ts |
RouterResponseController | — | — | packages/core/router/router-response-controller.ts |
RoutesResolver | — | Resolver | packages/core/router/routes-resolver.ts |
SseStream | Transform | — | packages/core/router/sse-stream.ts |
SecurityHeadersConfigurationError | Error | — | packages/core/security/security-headers.ts |
Reflector | — | — | packages/core/services/reflector.service.ts |
MulterModule | — | — | packages/platform-express/multer/multer.module.ts |
MixinInterceptor | — | NestInterceptor | packages/platform-express/multer/interceptors/any-files.interceptor.ts |
MixinInterceptor | — | NestInterceptor | packages/platform-express/multer/interceptors/file-fields.interceptor.ts |
MixinInterceptor | — | NestInterceptor | packages/platform-express/multer/interceptors/file.interceptor.ts |
MixinInterceptor | — | NestInterceptor | packages/platform-express/multer/interceptors/files.interceptor.ts |
MixinInterceptor | — | NestInterceptor | packages/platform-express/multer/interceptors/no-files.interceptor.ts |
Type Aliases
103 type aliases define computed or composite types:
| Type | References | Source |
|---|---|---|
EnhancerSubtype | ENHANCER_KEY_TO_SUBTYPE_MAP | packages/common/constants.ts |
InjectableOptions | ScopeOptions | packages/common/decorators/core/injectable.decorator.ts |
CustomDecorator | MethodDecorator, ClassDecorator, KEY, TKey | packages/common/decorators/core/set-metadata.decorator.ts |
ParamDecoratorEnhancer | ParameterDecorator | packages/common/decorators/http/create-route-param-metadata.decorator.ts |
ParamData | — | packages/common/decorators/http/route-params.decorator.ts |
Injectable | — | packages/common/interfaces/injectable.interface.ts |
SelectOptions | NestApplicationContextOptions | packages/common/interfaces/nest-application-context.interface.ts |
RouteConflictPolicyLevel | — | packages/common/interfaces/router-options.interface.ts |
RouteResolutionStrategy | — | packages/common/interfaces/router-options.interface.ts |
VersionValue | VERSION_NEUTRAL | packages/common/interfaces/version-options.interface.ts |
VersioningOptions | VersioningCommonOptions, HeaderVersioningOptions, UriVersioningOptions, MediaTypeVersioningOptions, CustomVersioningOptions | packages/common/interfaces/version-options.interface.ts |
Controller | — | packages/common/interfaces/controllers/controller.interface.ts |
StaticOrigin | — | packages/common/interfaces/external/cors-options.interface.ts |
CustomOrigin | StaticOrigin | packages/common/interfaces/external/cors-options.interface.ts |
ContextType | — | packages/common/interfaces/features/arguments-host.interface.ts |
CustomParamFactory | TData, ExecutionContext, TOutput | packages/common/interfaces/features/custom-route-param-factory.interface.ts |
Paramtype | — | packages/common/interfaces/features/paramtype.interface.ts |
Transform | T, ArgumentMetadata | packages/common/interfaces/features/pipe-transform.interface.ts |
HttpExceptionBodyMessage | — | packages/common/interfaces/http/http-exception-body.interface.ts |
ErrorHandler | TRequest, TResponse, Function | packages/common/interfaces/http/http-server.interface.ts |
RequestHandler | TRequest, TResponse, Function | packages/common/interfaces/http/http-server.interface.ts |
SecurityRequestHook | TRequest | packages/common/interfaces/http/http-server.interface.ts |
RawBodyRequest | T | packages/common/interfaces/http/raw-body-request.interface.ts |
ContentSecurityPolicyDirectiveValue | — | packages/common/interfaces/http/security-headers-options.interface.ts |
ReferrerPolicyToken | — | packages/common/interfaces/http/security-headers-options.interface.ts |
NestMicroserviceOptions | NestApplicationContextOptions | packages/common/interfaces/microservices/nest-microservice-options.interface.ts |
InjectionToken | Type, T, Abstract, Function | packages/common/interfaces/modules/injection-token.interface.ts |
OptionalFactoryDependency | InjectionToken | packages/common/interfaces/modules/optional-factory-dependency.interface.ts |
Provider | Type, ClassProvider, T, ValueProvider, FactoryProvider, ExistingProvider | packages/common/interfaces/modules/provider.interface.ts |
ConfigurableModuleOptionsFactory | FactoryClassMethodKey, ModuleOptions | packages/common/module-utils/interfaces/configurable-module-async-options.interface.ts |
ConfigurableModuleCls | — | packages/common/module-utils/interfaces/configurable-module-cls.interface.ts |
ParseArrayOptions | ParseArrayPipeOptions | packages/common/pipes/parse-array.pipe.ts |
UUIDVersion | — | packages/common/pipes/parse-uuid.pipe.ts |
ValidationErrorFormat | — | packages/common/pipes/validation.pipe.ts |
FileTypeValidatorContext | FileValidatorContext, FileTypeValidatorOptions | packages/common/pipes/file/file-type.validator.ts |
FileTypeValidatorOptions | Expected, Can, MIME, A, Match | packages/common/pipes/file/file-type.validator.ts |
FileValidatorContext | IFile | packages/common/pipes/file/file-validator-context.interface.ts |
MaxFileSizeValidatorContext | FileValidatorContext, MaxFileSizeValidatorOptions | packages/common/pipes/file/max-file-size.validator.ts |
MaxFileSizeValidatorOptions | Maximum | packages/common/pipes/file/max-file-size.validator.ts |
JsonLogObject | LogLevel | packages/common/services/console-logger.service.ts |
LogLevel | LOG_LEVELS | packages/common/services/log-levels.constant.ts |
Redactor | — | packages/common/services/utils/redact.util.ts |
ColorTextFn | — | packages/common/utils/cli-colors.util.ts |
ErrorHttpStatusCode | HttpStatus, BAD_GATEWAY, BAD_REQUEST, CONFLICT, FORBIDDEN, GATEWAY_TIMEOUT, GONE, HTTP_VERSION_NOT_SUPPORTED, I_AM_A_TEAPOT, INTERNAL_SERVER_ERROR, METHOD_NOT_ALLOWED, MISDIRECTED, NOT_ACCEPTABLE, NOT_FOUND, NOT_IMPLEMENTED, PAYLOAD_TOO_LARGE, PRECONDITION_FAILED, REQUEST_TIMEOUT, SERVICE_UNAVAILABLE, UNAUTHORIZED, UNPROCESSABLE_ENTITY, UNSUPPORTED_MEDIA_TYPE | packages/common/utils/http-error-by-code.util.ts |
Constructor | T | packages/common/utils/merge-with-values.util.ts |
IEntryNestModule | Type, DynamicModule, ForwardReference, IEntryNestModule | packages/core/nest-factory.ts |
DiscoveryOptions | FilterByInclude, FilterByMetadataKey | packages/core/discovery/discovery-service.ts |
DiscoverableDecorator | T, CustomDecorator, KEY | packages/core/discovery/discovery-service.ts |
ContextIdResolverFn | HostComponentInfo, ContextId | packages/core/helpers/context-id-factory.ts |
HandleResponseFn | HandlerResponseBasicFn, HandleSseResponseFn | packages/core/helpers/handler-metadata-storage.ts |
HandlerResponseBasicFn | TResult, TResponse, Observable, StreamableFile | packages/core/helpers/handler-metadata-storage.ts |
HandleSseResponseFn | TResult, Observable, TResponse, HeaderStream, TRequest, IncomingMessage | packages/core/helpers/handler-metadata-storage.ts |
InstanceDecorator | — | packages/core/helpers/safe-instance-decorator.ts |
CookieRecord | — | packages/core/helpers/cookies/parse-cookie-header.ts |
ParamPropertiesWithMetatype | ParamProperties, T | packages/core/helpers/interfaces/external-handler-metadata.interface.ts |
ParamsMetadata | ParamMetadata | packages/core/helpers/interfaces/params-metadata.interface.ts |
ModuleMetatype | Type, DynamicModule | packages/core/injector/container.ts |
ModuleScope | Type | packages/core/injector/container.ts |
InjectorDependency | InjectionToken | packages/core/injector/injector.ts |
HostCollection | — | packages/core/injector/instance-links-host.ts |
SerializedGraphStatus | — | packages/core/inspector/serialized-graph.ts |
CommonEdgeMetadata | — | packages/core/inspector/interfaces/edge.interface.ts |
ModuleToModuleEdgeMetadata | — | packages/core/inspector/interfaces/edge.interface.ts |
ClassToClassEdgeMetadata | — | packages/core/inspector/interfaces/edge.interface.ts |
HttpEntrypointMetadata | — | packages/core/inspector/interfaces/entrypoint.interface.ts |
MiddlewareEntrypointMetadata | — | packages/core/inspector/interfaces/entrypoint.interface.ts |
Entrypoint | — | packages/core/inspector/interfaces/entrypoint.interface.ts |
ModuleNode | — | packages/core/inspector/interfaces/node.interface.ts |
ClassNode | — | packages/core/inspector/interfaces/node.interface.ts |
Node | — | packages/core/inspector/interfaces/node.interface.ts |
ModuleDefinition | ForwardReference, Type, DynamicModule | packages/core/interfaces/module-definition.interface.ts |
ModuleKey | — | packages/core/repl/repl-context.ts |
ModuleDebugEntry | InjectionToken | packages/core/repl/repl-context.ts |
ReplScope | — | packages/core/repl/repl-context.ts |
ReplFnDefinition | Function, Note, JavaScript | packages/core/repl/repl.interfaces.ts |
ReplFunctionClass | ReplContext, ReplFunction | packages/core/repl/repl.interfaces.ts |
SegmentKind | — | packages/core/router/route-conflict-detector.ts |
SegmentKindOrMissing | — | packages/core/router/route-specificity-sorter.ts |
RouterProxyCallback | TRequest, TResponse | packages/core/router/router-proxy.ts |
AdditionalHeaders | — | packages/core/router/sse-stream.ts |
AdditionalHeadersSource | AdditionalHeaders | packages/core/router/sse-stream.ts |
StatusCodeSource | — | packages/core/router/sse-stream.ts |
WritableHeaderStream | NodeJS, WritableStream, WriteHeaders | packages/core/router/sse-stream.ts |
HeaderStream | WritableHeaderStream, ReadHeaders | packages/core/router/sse-stream.ts |
ResolvedRouteHandler | — | packages/core/router/interfaces/resolved-route.interface.ts |
ConflictKind | — | packages/core/router/interfaces/route-conflict.interface.ts |
Routes | RouteTree | packages/core/router/interfaces/routes.interface.ts |
CrossOriginAllowedReason | — | packages/core/security/cross-origin-protection.ts |
CrossOriginDeniedReason | — | packages/core/security/cross-origin-protection.ts |
CrossOriginDecision | — | packages/core/security/cross-origin-protection.ts |
OptionObject | Extract, NonNullable, SecurityHeadersOptions, K | packages/core/security/security-headers.ts |
CreateDecoratorWithTransformOptions | CreateDecoratorOptions, TParam, TTransformed | packages/core/services/reflector.service.ts |
ReflectableDecorator | TParam, CustomDecorator, KEY | packages/core/services/reflector.service.ts |
VersionedRoute | TRequest, TResponse | packages/platform-express/adapters/express-adapter.ts |
Express | — | packages/platform-express/interfaces/nest-express-body-parser.interface.ts |
NestExpressBodyParserType | NestExpressBodyParserOptionsMap | packages/platform-express/interfaces/nest-express-body-parser.interface.ts |
NestExpressBodyParserOptionsFor | NestExpressBodyParserOptionsMap, ParserType | packages/platform-express/interfaces/nest-express-body-parser.interface.ts |
MulterInstance | — | packages/platform-express/multer/interceptors/any-files.interceptor.ts |
MulterInstance | — | packages/platform-express/multer/interceptors/file-fields.interceptor.ts |
MulterInstance | — | packages/platform-express/multer/interceptors/file.interceptor.ts |
MulterInstance | — | packages/platform-express/multer/interceptors/files.interceptor.ts |
MulterInstance | — | packages/platform-express/multer/interceptors/no-files.interceptor.ts |
MulterModuleOptions | MulterOptions | packages/platform-express/multer/interfaces/files-upload-module.interface.ts |
Enums
7 enums define named constant sets:
| Enum | Source |
|---|---|
HttpStatus | packages/common/enums/http-status.enum.ts |
RequestMethod | packages/common/enums/request-method.enum.ts |
RouteParamtypes | packages/common/enums/route-paramtypes.enum.ts |
ShutdownSignal | packages/common/enums/shutdown-signal.enum.ts |
VersioningType | packages/common/enums/version-type.enum.ts |
Scope | packages/common/interfaces/scope-options.interface.ts |
UuidFactoryMode | packages/core/inspector/uuid-factory.ts |
Type Relationships
The following diagram shows inheritance, implementation, and reference relationships between types:
ControllerOptions
├── extends → ScopeOptions
└── extends → VersionOptions
InjectableOptions
└── uses → ScopeOptions
BadGatewayException
└── extends → HttpException
BadRequestException
└── extends → HttpException
ConflictException
└── extends → HttpException
ForbiddenException
└── extends → HttpException
GatewayTimeoutException
└── extends → HttpException
GoneException
└── extends → HttpException
HttpVersionNotSupportedException
└── extends → HttpException
HttpException
└── extends → IntrinsicException
ImATeapotException
└── extends → HttpException
InternalServerErrorException
└── extends → HttpException
MethodNotAllowedException
└── extends → HttpException
MisdirectedException
└── extends → HttpException
NotAcceptableException
└── extends → HttpException
NotFoundException
└── extends → HttpException
NotImplementedException
└── extends → HttpException
PayloadTooLargeException
└── extends → HttpException
PreconditionFailedException
└── extends → HttpException
RequestTimeoutException
└── extends → HttpException
ServiceUnavailableException
└── extends → HttpException
UnauthorizedException
└── extends → HttpException
UnprocessableEntityException
└── extends → HttpException
UnsupportedMediaTypeException
└── extends → HttpException
SelectOptions
└── uses → NestApplicationContextOptions
NestApplicationOptions
└── extends → NestApplicationContextOptions
INestMicroservice
└── extends → INestApplicationContext
VersioningOptions
├── uses → VersioningCommonOptions
├── uses → HeaderVersioningOptions
├── uses → UriVersioningOptions
├── uses → MediaTypeVersioningOptions
└── uses → CustomVersioningOptions
CustomOrigin
└── uses → StaticOrigin
CustomParamFactory
└── uses → ExecutionContext
ExecutionContext
└── extends → ArgumentsHost
NestMicroserviceOptions
└── uses → NestApplicationContextOptions
DynamicModule
└── extends → ModuleMetadata
OptionalFactoryDependency
└── uses → InjectionToken
IntegrationModule
└── extends → ConfigurableModuleCls
ValidationPipeOptions
└── extends → ValidatorOptions
FileTypeValidatorContext
├── uses → FileValidatorContext
└── uses → FileTypeValidatorOptions
FileValidatorContext
└── uses → IFile
MaxFileSizeValidatorContext
├── uses → FileValidatorContext
└── uses → MaxFileSizeValidatorOptions
ClassSerializerInterceptorOptions
└── extends → ClassTransformOptions
ClassSerializerContextOptions
└── extends → ClassTransformOptions
JsonLogObject
└── uses → LogLevel
ConsoleLogger
└── implements → LoggerService
Logger
└── implements → LoggerService
ErrorHttpStatusCode
└── uses → HttpStatus
IEntryNestModule
└── uses → DynamicModule
DiscoveryOptions
├── uses → FilterByInclude
└── uses → FilterByMetadataKey
DiscoverableDecorator
└── uses → CustomDecorator
CircularDependencyException
└── extends → RuntimeException
InvalidClassModuleException
└── extends → RuntimeException
InvalidClassScopeException
└── extends → RuntimeException
InvalidClassException
└── extends → RuntimeException
InvalidExceptionFilterException
└── extends → RuntimeException
InvalidMiddlewareConfigurationException
└── extends → RuntimeException
InvalidMiddlewareException
└── extends → RuntimeException
InvalidModuleException
└── extends → RuntimeException
InvalidProviderException
└── extends → RuntimeException
RequestScopedCreateException
└── extends → RuntimeException
RequestScopedGlobalEnhancerException
└── extends → RuntimeException
RouteConflictException
└── extends → RuntimeException
UndefinedDependencyException
└── extends → RuntimeException
UndefinedForwardRefException
└── extends → RuntimeException
UndefinedModuleException
└── extends → RuntimeException
UninstantiatedGlobalEnhancerException
└── extends → RuntimeException
UnknownDependenciesException
└── extends → RuntimeException
UnknownElementException
└── extends → RuntimeException
UnknownExportException
└── extends → RuntimeException
UnknownModuleException
└── extends → RuntimeException
UnknownRequestMappingException
└── extends → RuntimeException
BaseExceptionFilterContext
└── extends → ContextCreator
ExternalExceptionFilterContext
└── extends → BaseExceptionFilterContext
GuardsContextCreator
└── extends → ContextCreator
ContextIdResolverFn
├── uses → HostComponentInfo
└── uses → ContextId
ExecutionContextHost
└── implements → ExecutionContext
HandleResponseFn
├── uses → HandlerResponseBasicFn
└── uses → HandleSseResponseFn
HandlerResponseBasicFn
└── uses → StreamableFile
HandleSseResponseFn
└── uses → HeaderStream
ParamPropertiesWithMetatype
└── uses → ParamProperties
ParamsMetadata
└── uses → ParamMetadata
ModuleMetatype
└── uses → DynamicModule
InjectorDependency
└── uses → InjectionToken
ModuleRef
└── extends → AbstractInstanceResolver
SilentLogger
└── extends → Logger
ByReferenceModuleOpaqueKeyFactory
└── implements → ModuleOpaqueKeyFactory
DeepHashedModuleOpaqueKeyFactory
└── implements → ModuleOpaqueKeyFactory
InterceptorsContextCreator
└── extends → ContextCreator
ModuleDefinition
└── uses → DynamicModule
MiddlewareBuilder
└── implements → MiddlewareConsumer
PipesContextCreator
└── extends → ContextCreator
ModuleDebugEntry
└── uses → InjectionToken
ReplLogger
└── extends → ConsoleLogger
ReplFunctionClass
└── uses → ReplContext
RouteParamsFactory
└── implements → IRouteParamsFactory
RouterExceptionFilters
└── extends → BaseExceptionFilterContext
RoutesResolver
└── implements → Resolver
AdditionalHeadersSource
└── uses → AdditionalHeaders
WritableHeaderStream
└── uses → WriteHeaders
HeaderStream
├── uses → WritableHeaderStream
└── uses → ReadHeaders
SseStream
└── extends → Transform
Routes
└── uses → RouteTree
OptionObject
└── uses → SecurityHeadersOptions
ReflectableDecorator
└── uses → CustomDecorator
NestExpressBodyParserType
└── uses → NestExpressBodyParserOptionsMap
NestExpressBodyParserOptionsFor
└── uses → NestExpressBodyParserOptionsMap
MulterModuleOptions
└── uses → MulterOptions
Generated by RepoLens static analysis. Type detection uses regex-based parsing and may not capture all advanced TypeScript patterns.
<!-- repolens:docs-badge -->  · Examples
Dependency Graph
430 files · 1229 imports · 27 external packages · ⚠️ 50 circular dependency cycle(s) · 2 orphan file(s)
This document maps every import relationship in the codebase, identifies the most-connected modules, and flags circular dependencies that may complicate refactoring or increase build times.
Overview
| Metric | Value |
|---|---|
| Source files | 430 |
| Import edges | 1229 |
| External packages | 27 |
| Circular dependencies | 50 |
| Orphan files (no imports or importers) | 2 |
Circular Dependencies
50 circular dependency chains were detected. Circular imports can cause initialization errors, increase bundle sizes, and make modules harder to test in isolation. Consider refactoring shared logic into a separate module.
packages/common/interfaces→packages/common/interfaces/features/can-activate.interface→packages/common/interfaces/features/execution-context.interface→packages/common/interfacespackages/common/interfaces/middleware/middleware-config-proxy.interface→packages/common/interfaces/middleware/middleware-consumer.interface→packages/common/interfaces/middleware/middleware-config-proxy.interfacepackages/common/decorators/core→packages/common/decorators/core/catch.decorator→packages/common/interfaces→packages/common/interfaces/http→packages/common/interfaces/http/http-server.interface→packages/common/interfaces/nest-application-options.interface→packages/common/interfaces/nest-application-context-options.interface→packages/common/services/logger.service→packages/common/decorators/corepackages/common/decorators/core→packages/common/decorators/core/catch.decorator→packages/common/interfaces→packages/common/interfaces/http→packages/common/interfaces/http/http-server.interface→packages/common/interfaces/nest-application-options.interface→packages/common/interfaces/nest-application-context-options.interface→packages/common/services/logger.service→packages/common/services/console-logger.service→packages/common/decorators/corepackages/common/services/logger.service→packages/common/services/console-logger.service→packages/common/services/logger.servicepackages/common/services/logger.service→packages/common/services/console-logger.service→packages/common/services/utils/is-log-level-enabled.util→packages/common/services/logger.servicepackages/common/interfaces/modules/dynamic-module.interface→packages/common/interfaces/modules/module-metadata.interface→packages/common/interfaces/modules/dynamic-module.interfacepackages/common/interfaces→packages/common/interfaces/nest-application.interface→packages/common/interfacespackages/common→packages/common/decorators→packages/common/decorators/core→packages/common/decorators/core/exception-filters.decorator→packages/commonpackages/common→packages/common/decorators→packages/common/decorators/http→packages/common/decorators/http/route-params.decorator→packages/commonpackages/common→packages/common/decorators→packages/common/decorators/http→packages/common/decorators/http/create-route-param-metadata.decorator→packages/commonpackages/common→packages/common/pipes→packages/common/pipes/parse-enum.pipe→packages/commonpackages/common→packages/common/pipes→packages/common/pipes/parse-float.pipe→packages/commonpackages/core/injector/instance-wrapper→packages/core/injector/constants→packages/core/injector/instance-wrapperpackages/core/application-config→packages/core/injector/instance-wrapper→packages/core/injector/module→packages/core/application-configpackages/core/errors/exceptions→packages/core/errors/exceptions/invalid-class-scope.exception→packages/core/errors/messages→packages/core/injector/injector→packages/core/errors/exceptionspackages/core/injector/injector→packages/core/errors/exceptions/undefined-dependency.exception→packages/core/injector/injectorpackages/core/injector/module→packages/core/errors/exceptions→packages/core/errors/exceptions/invalid-class-scope.exception→packages/core/errors/messages→packages/core/injector/injector→packages/core/errors/exceptions/undefined-dependency.exception→packages/core/injector/modulepackages/core/errors/messages→packages/core/injector/injector→packages/core/errors/exceptions/undefined-dependency.exception→packages/core/errors/messagespackages/core/injector/injector→packages/core/errors/exceptions/unknown-dependencies.exception→packages/core/injector/injector
...and 30 more cycles
External Dependencies
The codebase imports 27 external packages. These are third-party modules (not the language standard library):
| Package |
| --------- |
@nestjs/common |
@nestjs/core |
@nestjs/microservices |
@nestjs/platform-express |
@nestjs/websockets |
async_hooks |
class-transformer |
class-validator |
cors |
crypto |
express |
fast-safe-stringify |
file-type |
http |
https |
iterare |
module |
multer |
os |
path-to-regexp |
perf_hooks |
reflect-metadata |
repl |
rxjs |
stream |
uid |
util |
Generated by RepoLens import analysis. Dependency detection covers JavaScript and TypeScript (ES modules, dynamic import, CommonJS, re-exports; comments, strings, and type-only imports are skipped), Python (`import` / `from ... import`, including relative imports), and Go (`go.mod` module paths). Go `_test.go` files are not part of the graph.*
<!-- repolens:docs-badge -->  · Examples
Architecture Drift
No baseline found. Run
repolens publishonce to establish a baseline.
A baseline snapshot of the current architecture has been saved. On subsequent runs, this report will track structural changes across the following dimensions:
| Dimension | What is Tracked |
|---|---|
| Modules | New, removed, or significantly resized modules |
| API Endpoints | Added or removed backend routes |
| Dependencies | Changes to external package imports |
| Frameworks | Technology stack additions or removals |
| Circular Dependencies | Increases in dependency cycles |
| GraphQL Schema | Type additions or removals |
| Codebase Scale | Overall file count changes |
<!-- repolens:docs-badge -->  · Examples
Security Hotspots
15 security finding(s) · 15 low severity · across 11 file(s)
This report identifies code patterns that are commonly associated with security vulnerabilities. Each finding includes the relevant CWE classification and a recommended remediation.
Severity Overview
| Severity | Count |
|---|---|
| 🔵 Low | 15 |
430 source files scanned · 11 files with findings
Prototype Pollution
Deep merge utilities may be vulnerable to prototype pollution if they don't check hasOwnProperty. Verify the implementation.
| File | Line | Pattern | Severity | CWE |
|---|---|---|---|---|
packages/common/pipes/default-value.pipe.ts | 52 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/common/pipes/validation.pipe.ts | 437 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/common/services/console-logger.service.ts | 893 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/common/utils/merge-with-values.util.ts | 15 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/core/helpers/execution-context-host.ts | 43 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/core/helpers/execution-context-host.ts | 50 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/core/helpers/execution-context-host.ts | 58 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/core/injector/injector.ts | 1045 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/core/injector/instance-wrapper.ts | 675 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/core/middleware/middleware-module.ts | 381 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/core/router/router-explorer.ts | 257 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/core/router/router-explorer.ts | 334 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
packages/core/router/router-explorer.ts | 522 | Recursive object merge without prototype check | 🔵 Low | CWE-1321 |
ReDoS
Dynamic regex construction from user input can cause ReDoS. Use static regex or input validation.
| File | Line | Pattern | Severity | CWE |
|---|---|---|---|---|
packages/common/pipes/file/file-type.validator.ts | 212 | Potentially catastrophic regex | 🔵 Low | CWE-1333 |
Insecure Randomness
Math.random() is not cryptographically secure. Use crypto.randomUUID() or crypto.getRandomValues() for security tokens.
| File | Line | Pattern | Severity | CWE |
|---|---|---|---|---|
packages/core/helpers/context-id-factory.ts | 14 | Math.random() for security-sensitive operation | 🔵 Low | CWE-330 |
Affected Files
packages/common/pipes/default-value.pipe.tspackages/common/pipes/validation.pipe.tspackages/common/pipes/file/file-type.validator.tspackages/common/services/console-logger.service.tspackages/common/utils/merge-with-values.util.tspackages/core/helpers/context-id-factory.tspackages/core/helpers/execution-context-host.tspackages/core/injector/injector.tspackages/core/injector/instance-wrapper.tspackages/core/middleware/middleware-module.tspackages/core/router/router-explorer.ts
Generated by RepoLens security pattern analysis. Detection is regex-based and may produce false positives. Findings should be triaged by a security-aware engineer.
<!-- repolens:docs-badge -->  · Examples
Code Health Report
430 files analyzed · Average health: 93/100 · 377 A, 21 B, 26 C, 6 D, 0 F
This report synthesizes complexity, coupling, documentation, and security signals into a single health score per module. Lower scores indicate higher risk and maintenance burden.
Overview
| Metric | Value |
|---|---|
| Files analyzed | 430 |
| Average health score | 93/100 |
| Average complexity | 9 |
| Hotspots (score < 60) | 20 |
Grade Distribution
| Grade | Count | Meaning |
|---|---|---|
| 🟢 A (80–100) | 377 | Healthy — low complexity, well-documented |
| 🔵 B (60–79) | 21 | Acceptable — minor improvements possible |
| 🟡 C (40–59) | 26 | Needs attention — elevated complexity or coupling |
| 🟠 D (20–39) | 6 | At risk — multiple quality signals degraded |
| 🔴 F (0–19) | 0 | Critical — immediate refactoring recommended |
Hotspots — Priority Refactoring Targets
These modules have the lowest health scores and should be prioritized for improvement:
| Module | Score | Grade | Complexity | Coupling | Doc% | Security |
|---|---|---|---|---|---|---|
packages/core/injector/injector.ts | 30 | 🟠 D | 219 | 17↓ 12↑ | — | 1 (0 high) |
packages/core/injector/instance-wrapper.ts | 30 | 🟠 D | 132 | 34↓ 9↑ | — | 1 (0 high) |
packages/core/injector/module.ts | 30 | 🟠 D | 69 | 29↓ 12↑ | — | — |
packages/core/nest-application.ts | 37 | 🟠 D | 71 | 3↓ 21↑ | — | — |
packages/core/middleware/utils.ts | 38 | 🟠 D | 55 | 4↓ 3↑ | 40% | — |
packages/core/router/router-explorer.ts | 38 | 🟠 D | 38 | 2↓ 28↑ | — | 3 (0 high) |
packages/common/services/logger.service.ts | 41 | 🟡 C | 64 | 8↓ 5↑ | — | — |
packages/core/scanner.ts | 42 | 🟡 C | 72 | 4↓ 20↑ | — | — |
packages/common/pipes/validation.pipe.ts | 44 | 🟡 C | 89 | 2↓ 14↑ | — | 1 (0 high) |
packages/common/interfaces/http/http-server.interface.ts | 45 | 🟡 C | 47 | 2↓ 5↑ | — | — |
packages/common/pipes/parse-array.pipe.ts | 45 | 🟡 C | 39 | 1↓ 8↑ | — | — |
packages/common/services/console-logger.service.ts | 45 | 🟡 C | 179 | 2↓ 7↑ | — | 1 (0 high) |
packages/core/helpers/external-context-creator.ts | 45 | 🟡 C | 42 | 3↓ 15↑ | — | — |
packages/core/router/route-conflict-detector.ts | 45 | 🟡 C | 66 | 2↓ 4↑ | — | — |
packages/core/router/route-path-factory.ts | 45 | 🟡 C | 42 | 3↓ 4↑ | — | — |
packages/core/router/router-execution-context.ts | 45 | 🟡 C | 85 | 1↓ 14↑ | — | — |
packages/core/router/router-response-controller.ts | 45 | 🟡 C | 53 | 1↓ 3↑ | — | — |
packages/core/router/sse-stream.ts | 45 | 🟡 C | 44 | 3↓ 0↑ | — | — |
packages/core/security/security-headers.ts | 45 | 🟡 C | 77 | 1↓ 0↑ | 100% | — |
packages/platform-express/adapters/express-adapter.ts | 45 | 🟡 C | 62 | 1↓ 4↑ | — | — |
Most Complex Functions
These functions have the highest cyclomatic complexity and are the most likely sources of bugs:
| Function | File | Line | Complexity |
|---|---|---|---|
serializeNested() | packages/common/services/console-logger.service.ts | 609 | 71 |
lookup() | packages/core/injector/injector.ts | 1413 | 51 |
isOptionalFactoryDependency() | packages/core/injector/injector.ts | 532 | 50 |
doneOnce() | packages/platform-express/adapters/express-adapter.ts | 113 | 49 |
canActivateFn() | packages/core/router/router-execution-context.ts | 444 | 42 |
identity() | packages/core/injector/injector.ts | 850 | 37 |
isCommentOnly() | packages/core/router/sse-stream.ts | 54 | 37 |
addExportedUnit() | packages/core/injector/module.ts | 470 | 35 |
getBodyProperty() | packages/core/router/route-params-factory.ts | 20 | 32 |
onClose() | packages/core/router/router-response-controller.ts | 205 | 32 |
errorHandler() | packages/core/nest-application.ts | 441 | 31 |
toClassInstance() | packages/common/pipes/parse-array.pipe.ts | 111 | 26 |
concatPaths() | packages/core/router/route-path-factory.ts | 122 | 26 |
add() | packages/core/security/security-headers.ts | 269 | 26 |
serializeCookie() | packages/core/helpers/cookies/serialize-cookie.ts | 40 | 25 |
All Modules by Health Score
Showing 50 of 430 modules (sorted worst-first)
| Module | Score | Grade | Lines | Complexity | Fan-In | Fan-Out |
|---|---|---|---|---|---|---|
packages/core/injector/injector.ts | 30 | 🟠 D | 1749 | 219 | 17 | 12 |
packages/core/injector/instance-wrapper.ts | 30 | 🟠 D | 717 | 132 | 34 | 9 |
packages/core/injector/module.ts | 30 | 🟠 D | 692 | 69 | 29 | 12 |
packages/core/nest-application.ts | 37 | 🟠 D | 766 | 71 | 3 | 21 |
packages/core/middleware/utils.ts | 38 | 🟠 D | 380 | 55 | 4 | 3 |
packages/core/router/router-explorer.ts | 38 | 🟠 D | 541 | 38 | 2 | 28 |
packages/common/services/logger.service.ts | 41 | 🟡 C | 359 | 64 | 8 | 5 |
packages/core/scanner.ts | 42 | 🟡 C | 832 | 72 | 4 | 20 |
packages/common/pipes/validation.pipe.ts | 44 | 🟡 C | 495 | 89 | 2 | 14 |
packages/common/interfaces/http/http-server.interface.ts | 45 | 🟡 C | 720 | 47 | 2 | 5 |
packages/common/pipes/parse-array.pipe.ts | 45 | 🟡 C | 230 | 39 | 1 | 8 |
packages/common/services/console-logger.service.ts | 45 | 🟡 C | 972 | 179 | 2 | 7 |
packages/core/helpers/external-context-creator.ts | 45 | 🟡 C | 405 | 42 | 3 | 15 |
packages/core/router/route-conflict-detector.ts | 45 | 🟡 C | 443 | 66 | 2 | 4 |
packages/core/router/route-path-factory.ts | 45 | 🟡 C | 245 | 42 | 3 | 4 |
packages/core/router/router-execution-context.ts | 45 | 🟡 C | 706 | 85 | 1 | 14 |
packages/core/router/router-response-controller.ts | 45 | 🟡 C | 400 | 53 | 1 | 3 |
packages/core/router/sse-stream.ts | 45 | 🟡 C | 250 | 44 | 3 | 0 |
packages/core/security/security-headers.ts | 45 | 🟡 C | 508 | 77 | 1 | 0 |
packages/platform-express/adapters/express-adapter.ts | 45 | 🟡 C | 778 | 62 | 1 | 4 |
packages/platform-express/multer/multer/multer.utils.ts | 45 | 🟡 C | 157 | 35 | 5 | 3 |
packages/common/services/utils/redact.util.ts | 46 | 🟡 C | 268 | 56 | 1 | 0 |
packages/core/nest-application-context.ts | 48 | 🟡 C | 543 | 48 | 3 | 11 |
packages/core/errors/messages.ts | 48 | 🟡 C | 320 | 33 | 19 | 2 |
packages/common/pipes/file/file-type.validator.ts | 50 | 🟡 C | 215 | 35 | 2 | 4 |
packages/core/injector/container.ts | 51 | 🟡 C | 375 | 29 | 23 | 15 |
packages/common/decorators/http/route-params.decorator.ts | 54 | 🟡 C | 1133 | 56 | 4 | 6 |
packages/common/exceptions/http.exception.ts | 57 | 🟡 C | 211 | 29 | 22 | 3 |
packages/core/nest-factory.ts | 58 | 🟡 C | 431 | 44 | 2 | 16 |
packages/core/exceptions/base-exception-filter.ts | 59 | 🟡 C | 134 | 32 | 3 | 3 |
packages/core/router/route-params-factory.ts | 59 | 🟡 C | 84 | 32 | 1 | 2 |
packages/core/security/cross-origin-protection.ts | 59 | 🟡 C | 425 | 32 | 1 | 3 |
packages/core/middleware/route-info-path-extractor.ts | 60 | 🔵 B | 290 | 39 | 3 | 6 |
packages/common/interfaces/http/security-headers-options.interface.ts | 67 | 🔵 B | 159 | 28 | 2 | 0 |
packages/core/middleware/middleware-module.ts | 67 | 🔵 B | 387 | 28 | 1 | 22 |
packages/common/decorators/http/create-route-param-metadata.decorator.ts | 69 | 🔵 B | 106 | 26 | 2 | 8 |
packages/common/module-utils/configurable-module.builder.ts | 71 | 🔵 B | 376 | 24 | 1 | 6 |
packages/core/services/reflector.service.ts | 71 | 🔵 B | 276 | 24 | 2 | 0 |
packages/core/injector/module-ref.ts | 73 | 🔵 B | 226 | 31 | 4 | 10 |
packages/core/metadata-scanner.ts | 74 | 🔵 B | 122 | 21 | 9 | 0 |
packages/common/interfaces/nest-application-context.interface.ts | 75 | 🔵 B | 166 | 20 | 3 | 6 |
packages/common/pipes/parse-float.pipe.ts | 75 | 🔵 B | 100 | 20 | 1 | 5 |
packages/common/pipes/parse-enum.pipe.ts | 76 | 🔵 B | 122 | 19 | 1 | 5 |
packages/common/utils/shared.utils.ts | 76 | 🔵 B | 72 | 19 | 29 | 0 |
packages/core/adapters/http-adapter.ts | 76 | 🔵 B | 689 | 19 | 3 | 1 |
packages/core/pipes/pipes-context-creator.ts | 76 | 🔵 B | 124 | 19 | 3 | 5 |
packages/common/pipes/standard-schema-validation.pipe.ts | 77 | 🔵 B | 174 | 18 | 1 | 7 |
packages/common/serializer/standard-schema-serializer.interceptor.ts | 77 | 🔵 B | 145 | 18 | 1 | 6 |
packages/core/guards/guards-context-creator.ts | 77 | 🔵 B | 129 | 18 | 2 | 5 |
packages/core/interceptors/interceptors-context-creator.ts | 77 | 🔵 B | 128 | 18 | 3 | 5 |
Scoring Methodology
The health score (0–100) is computed from four dimensions:
| Factor | Weight | How It's Measured |
|---|---|---|
| Complexity | –1/pt above 10, –2/pt above 30 | Cyclomatic complexity for JavaScript/TypeScript, Python, and Go (regex, not AST) |
| Function complexity | –2/pt above 8 per function | Highest complexity function in the file |
| Coupling | –1/5 units above 20 | Fan-in × Fan-out (import connections) |
| Documentation | –10 if <50%, –5 if <80% | JSDoc/TSDoc coverage of exports |
| Security | –10/high, –5/medium finding | Security anti-pattern findings in file |
Generated by RepoLens code health analysis. Complexity covers JavaScript/TypeScript, Python, and Go. It is regex-based and may differ from AST-based tools. Scores are relative indicators, not absolute quality measures.
<!-- repolens:docs-badge -->  · Examples