# nest | nestjs | Knowledge Base | Instagit

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀

GitHub Stars: 74.8k

Repository: https://github.com/nestjs/nest

---

## Articles

### [How to Implement Hybrid Microservices in NestJS: HTTP and TCP Together](/nestjs/nest/how-to-implement-hybrid-microservices-http-tcp)

Learn how to implement hybrid microservices in NestJS combining HTTP and TCP. Start your NestJS app, connect a TCP microservice, and launch them together seamlessly.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Use NestJS Graph Inspector for Debugging: A Complete Guide](/nestjs/nest/how-to-use-graph-inspector-for-debugging)

Debug your NestJS app efficiently with the Graph Inspector. Visualize and export your dependency graph to find circular dependencies and understand module wiring.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Use the Fastify Adapter in NestJS: A Complete Guide](/nestjs/nest/how-to-use-fastify-adapter-instead-of-express)

Learn to use the Fastify adapter in NestJS to boost performance. Install @nestjs/platform-fastify and switch from Express with our complete guide.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Implement Custom Exception Filters in NestJS: A Complete Guide](/nestjs/nest/how-to-implement-custom-exception-filters)

Learn to implement custom exception filters in NestJS. Create a class, use @Catch decorator, and handle errors effectively for better application management.

- Tags: how-to-guide
- Published: 2026-03-01

### [How NestJS MetadataScanner Works: Prototype Introspection for Route Discovery](/nestjs/nest/how-does-the-metadatascanner-work-in-nestjs)

Discover how NestJS MetadataScanner uses prototype introspection and memoization to efficiently scan class inheritance chains for route discovery at startup. Learn its core functionality.

- Tags: internals
- Published: 2026-03-01

### [How to Implement NestJS Lifecycle Hooks: OnModuleInit and OnModuleDestroy](/nestjs/nest/how-to-implement-lifecycle-hooks-onmoduleinit-onmoduledestroy)

Learn to implement NestJS lifecycle hooks OnModuleInit and OnModuleDestroy. Execute custom logic on module initialization and before application shutdown.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Use a Global Prefix for Routes in NestJS: Complete Implementation Guide](/nestjs/nest/how-to-use-global-prefix-for-routes)

Learn to set a global prefix for NestJS routes using app.setGlobalPrefix() in your bootstrap function. This guide explains prepend common path segments for all controllers with optional exclusions.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Implement API Versioning in NestJS: URI, Header, and Custom Strategies](/nestjs/nest/how-to-implement-api-versioning-in-nestjs)

Learn to implement API versioning in NestJS using URI, header, and custom strategies. Master request routing for robust API management with this comprehensive guide.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Resolve Circular Dependencies in NestJS: Complete Guide to forwardRef()](/nestjs/nest/how-to-implement-circular-dependency-resolution)

Resolve circular dependencies in NestJS by implementing forwardRef() to defer class resolution and complete your module graph.

- Tags: tutorial
- Published: 2026-03-01

### [How to Use Decorators for Dependency Injection in NestJS](/nestjs/nest/how-to-use-decorators-for-dependency-injection)

Master NestJS dependency injection using decorators like @Injectable() and @Inject(). Learn how NestJS uses metadata for automatic provider registration, token resolution, and scope management.

- Tags: tutorial
- Published: 2026-03-01

### [How Does the Module System Work in NestJS: A Deep Dive into the IoC Container Architecture](/nestjs/nest/how-does-the-module-system-work-in-nestjs)

Understand NestJS modules and their IoC container architecture. Learn how the framework uses decorators and reflection to build a runtime graph for dependency resolution. Dive deep into ModuleRef and ModulesContainer.

- Tags: deep-dive
- Published: 2026-03-01

### [How to Test NestJS Applications with the Nest Testing Package](/nestjs/nest/how-to-test-nestjs-applications-with-testing-package)

Learn how to test NestJS applications using the official nest testing package. Discover how to create a testing module to compile configure and execute unit and E2E tests efficiently.

- Tags: testing
- Published: 2026-03-01

### [How to Implement Microservices with NestJS: A Complete Guide to TCP, Redis, and Beyond](/nestjs/nest/how-to-implement-microservices-with-nestjs)

Learn to implement microservices with NestJS using `NestFactory.createMicroservice` and decorators like `MessagePattern`. Build robust, scalable applications efficiently.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Implement WebSocket Gateways in NestJS: A Complete Developer Guide](/nestjs/nest/how-to-implement-websocket-gateways-in-nestjs)

Master NestJS WebSocket gateways. Learn to create gateways, handle messages with SubscribeMessage, and manage connections for real-time applications. Your complete developer guide.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Use Middleware in NestJS Applications: Class-Based and Functional Patterns](/nestjs/nest/how-to-use-middleware-in-nestjs-applications)

Master NestJS middleware with class-based and functional patterns. Learn how to implement custom logic before route handlers efficiently and effectively.

- Tags: how-to-guide
- Published: 2026-03-01

### [How Exception Handling Works in NestJS: A Complete Guide to the Filter Architecture](/nestjs/nest/how-does-exception-handling-work-in-nestjs)

Understand NestJS exception handling with our complete guide. Learn how the filter architecture intercepts errors and translates them into HTTP responses through its four-step pipeline.

- Tags: deep-dive
- Published: 2026-03-01

### [How to Implement Custom Interceptors for Response Transformation in NestJS](/nestjs/nest/how-to-implement-custom-interceptors-for-response-transformation)

Learn how to implement custom interceptors for response transformation in NestJS. Modify data before serialization using the NestInterceptor interface and RxJS map operator.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Implement Custom Pipes for Request Validation in NestJS](/nestjs/nest/how-to-implement-custom-pipes-for-request-validation)

Learn to implement custom pipes in NestJS for robust request validation. Create a PipeTransform class to validate incoming data and ensure valid payloads reach your route handlers.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Implement Custom Guards in NestJS: Authorization and Access Control](/nestjs/nest/how-to-implement-custom-guards-in-nestjs)

Implement custom guards in NestJS to control access. Learn to define authorization logic in your canActivate method and apply guards using @UseGuards() for route or global protection.

- Tags: how-to-guide
- Published: 2026-03-01

### [How to Create Dynamic Modules in NestJS: The Complete Guide](/nestjs/nest/how-to-create-dynamic-modules-in-nestjs)

Learn to create dynamic modules in NestJS using register and registerAsync factory methods. Build reusable, configurable modules with runtime metadata for your applications.

- Tags: how-to-guide
- Published: 2026-03-01

### [How NestJS Dependency Injection Works with Providers: Complete Guide to the DI Container](/nestjs/nest/how-does-nestjs-dependency-injection-work-with-providers)

Understand NestJS dependency injection and providers. Learn how the DI container automatically resolves dependencies by scanning constructor parameters and injecting instances.

- Tags: deep-dive
- Published: 2026-03-01

