---
title: "Module Map"
description: "This document provides an overview of the module structure within the apps/api directory, focusing on how different feature modules are organized and integrated into the main application. It detail..."
last_updated: "2026-05-06T07:29:41.642464+00:00"
canonical_url: "https://www.doc0.dev/docs/49c89830-117b-4def-8edc-b5bcc50766e0/technical/section-2/module-map"
---

<details>
<summary>Relevant source files</summary>

The following files were used as context for generating this wiki page:

- [apps/api/src/app.module.ts](https://github.com/blade47/comp/blob/main/apps/api/src/app.module.ts)
- [apps/api/src/health/health.module.ts](https://github.com/blade47/comp/blob/main/apps/api/src/health/health.module.ts)
- [apps/api/src/integration-platform/integration-platform.module.ts](https://github.com/blade47/comp/blob/main/apps/api/src/integration-platform/integration-platform.module.ts)
- [apps/api/src/questionnaire/questionnaire.module.ts](https://github.com/blade47/comp/blob/main/apps/api/src/questionnaire/questionnaire.module.ts)
</details>

This document provides an overview of the module structure within the `apps/api` directory, focusing on how different feature modules are organized and integrated into the main application. It details the `AppModule` as the root, along with specific examples like `HealthModule`, `IntegrationPlatformModule`, and `QuestionnaireModule`, illustrating their responsibilities and dependencies.

The architecture leverages NestJS modules to encapsulate related functionalities, promoting modularity and maintainability. Each module typically groups controllers, services, and repositories relevant to a specific domain, which are then imported into the `AppModule` to form the complete API application.

## Core Application Module (`AppModule`)

The `AppModule` serves as the root module for the NestJS API application. It aggregates all other feature modules, global configurations, and core services required for the application to function. This module is responsible for setting up global configurations like rate limiting and loading environment-specific settings.

### Global Configuration and Guards

The `AppModule` initializes several global configurations and guards:

*   **`ConfigModule`**: Configures the application to load environment variables and specific configuration objects (`awsConfig`, `betterAuthConfig`). It is set as global, making configuration available throughout the application.
*   **`ThrottlerModule`**: Implements rate limiting to protect the API from abuse. It is configured to allow 100 requests per minute (`ttl: 60000`, `limit: 100`) per IP address.
*   **`APP_GUARD`**: The `ThrottlerGuard` is provided globally using `APP_GUARD`, ensuring that rate limiting is applied to all routes by default.

Sources: [apps/api/src/app.module.ts:1-60](https://github.com/blade47/comp/blob/main/apps/api/src/app.module.ts#L1-L60)

### Feature Module Imports

The `AppModule` imports a wide array of feature modules, each responsible for a specific domain or functionality within the API. This modular approach helps in organizing the codebase and managing dependencies.

<Callout variant="info">
The `AppModule` imports 29 distinct feature modules, demonstrating a comprehensive microservices-like architecture within a single NestJS application.
</Callout>

The following diagram illustrates the primary modules imported by the `AppModule`:


Sources: [apps/api/src/app.module.ts:31-57](https://github.com/blade47/comp/blob/main/apps/api/src/app.module.ts#L31-L57)

## Health Module (`HealthModule`)

The `HealthModule` is a simple module dedicated to providing health check endpoints for the API. It contains only a controller, `HealthController`, which would typically expose endpoints to verify the application's operational status.


Sources: [apps/api/src/health/health.module.ts:1-6](https://github.com/blade47/comp/blob/main/apps/api/src/health/health.module.ts#L1-L6)

## Integration Platform Module (`IntegrationPlatformModule`)

The `IntegrationPlatformModule` is a comprehensive module responsible for managing various aspects of third-party integrations. It encompasses controllers for handling OAuth flows, managing connections, administrative tasks, and webhook processing. It also provides services for credential management, connection handling, and automated checks, supported by dedicated repositories for data persistence.

### Components

This module is structured with a clear separation of concerns, including:

*   **Controllers**: Handle incoming HTTP requests related to integrations.
*   **Services**: Encapsulate business logic for integration functionalities.
*   **Repositories**: Manage data access for integration-related entities.

The module also exports several services, making them available for use by other modules that import `IntegrationPlatformModule`.

<Callout variant="success">
Exporting services like `CredentialVaultService` and `ConnectionService` allows other modules to securely interact with integration functionalities without needing to know the internal implementation details of the `IntegrationPlatformModule`.
</Callout>

### Module Structure

The following diagram illustrates the internal components of the `IntegrationPlatformModule`:


Sources: [apps/api/src/integration-platform/integration-platform.module.ts:1-62](https://github.com/blade47/comp/blob/main/apps/api/src/integration-platform/integration-platform.module.ts#L1-L62)

## Questionnaire Module (`QuestionnaireModule`)

The `QuestionnaireModule` handles functionalities related to questionnaires. It includes a controller for API endpoints and a service for business logic. Notably, it imports the `TrustPortalModule`, indicating a dependency on trust portal functionalities, possibly for questionnaire publishing or data integration.


Sources: [apps/api/src/questionnaire/questionnaire.module.ts:1-11](https://github.com/blade47/comp/blob/main/apps/api/src/questionnaire/questionnaire.module.ts#L1-L11)

## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/49c89830-117b-4def-8edc-b5bcc50766e0/llms.txt) for all pages in this wiki.
