> For the complete documentation index, see [llms.txt](https://gruntsass.gitbook.io/template-api-nodejs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gruntsass.gitbook.io/template-api-nodejs/nodejs/premium-template-rest-api/core-modules.md).

# Core Modules

### **HTTP Module**

* **http.module.ts**: The main module for handling HTTP logic.
* **auth.module.ts**: Contains authentication logic, with `auth.controller.ts` managing authentication endpoints.
* **profile.module.ts**: Handles profile-related functionality, with `profile.controller.ts` managing user profiles.
* **user.module.ts**: Manages user data and includes `user.service.ts` for user management.

***

### D**atabase Module**

* **database.module.ts**: Responsible for managing database connections and queries.

### P**erformance Module**

* **performance.module.ts**: Optimizes performance through various middlewares like compression and response-time tracking.
* **compression.service.ts**, **morgan.service.ts**, **response-time.service.ts**: Individual services for performance enhancements.

***

### Se**curity Module**

* **security.module.ts**: Manages application security with guards like `captcha.guard.ts` and `csrf.guard.ts`.
* **cors-config.service.ts**, **helmet-config.service.ts**, **rate-limit-config.service.ts**: Services responsible for security configurations.
* **captcha-config.service.ts** and **csrf-config.service.ts**: Specific services for handling CAPTCHA and CSRF security measures.

***

### Services <a href="#services" id="services"></a>

Each module has its own services that encapsulate the business logic. Notable services include:

Exemple :&#x20;

* **user.service.ts**: Provides user-related operations like creation, updates, and retrieval.
* **dynamic-modules-loader.service.ts**: Dynamically loads submodules and components at runtime.
* **performance-service-impl.ts**: Implements performance-related optimizations.
* **security-service-impl.ts**: Implements security measures like CSRF, rate-limiting, and CORS.
