🦅 NestJS Beginner

What is a Module in NestJS?

Answer

A Module in NestJS is a class decorated with @Module() that organizes the application into cohesive blocks of functionality. Every NestJS application has at least one module — the root module (AppModule). The @Module() decorator takes an object with four properties: imports (other modules whose exported providers this module needs), controllers (controllers defined in this module), providers (services, guards, pipes, interceptors), and exports (providers that should be available to modules that import this one). Modules create the dependency injection scope and help organize code by feature or domain.