# zeyadelbadawi/atlas-backend architecture

> Architecture diagram of the GitHub repository zeyadelbadawi/atlas-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zeyadelbadawi/atlas-backend
- Repository: https://github.com/zeyadelbadawi/atlas-backend
- Video tour (about a minute): https://gitdiagram.com/zeyadelbadawi/atlas-backend/video

## Overview

Atlas Backend is a NestJS API whose README identifies its current scope as Phase P0 foundation, not the business features suggested by many later-phase directories in the tree. Its principal workflow is API startup with validated configuration and shared request protections, followed by a health request that checks PostgreSQL and Redis. The graph focuses on those documented runtime responsibilities; the README describes Redis integration, but its implementation path is absent from the supplied tree, so no Redis adapter node is included.

Main entry points: [`src/main.ts`](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/main.ts) (Bootstrap), [`src/app.module.ts`](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/app.module.ts) (Root module), [`src/health/health.controller.ts`](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/health/health.controller.ts) (Health endpoint), [`src/database/prisma.service.ts`](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/database/prisma.service.ts) (Prisma service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bootstrap["API startup"]
  node_main["Bootstrap<br/>[main.ts]"]
  node_app["Root module<br/>[app.module.ts]"]
end

subgraph group_foundation["Shared foundation"]
  node_config["Configuration<br/>[configuration.ts]"]
  node_env["Environment validation<br/>[env.validation.ts]"]
  node_filter["Error filter"]
  node_request["Request context"]
  node_prisma["Prisma service<br/>[prisma.service.ts]"]
end

subgraph group_health["Health checks"]
  node_healthmodule["Health module<br/>[health.module.ts]"]
  node_health["Health endpoint"]
  node_prismaindicator["Postgres indicator"]
  node_redisindicator["Redis indicator"]
end

node_client(("API client"))
node_db[("PostgreSQL")]
node_redis[("Redis")]

node_main -->|"starts"| node_app
node_main -->|"loads configuration"| node_config
node_main -->|"validates environment"| node_env
node_main -->|"registers filter"| node_filter
node_main -->|"registers middleware"| node_request
node_app -->|"wires"| node_healthmodule
node_app -->|"wires"| node_prisma
node_prisma -->|"connects"| node_db
node_client -->|"requests health"| node_health
node_health -->|"checks"| node_prismaindicator
node_health -->|"checks"| node_redisindicator
node_prismaindicator -->|"probes"| node_db
node_redisindicator -->|"probes"| node_redis

click node_main "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/main.ts"
click node_app "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/app.module.ts"
click node_config "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/config/configuration.ts"
click node_env "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/config/env.validation.ts"
click node_filter "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/common/filters/all-exceptions.filter.ts"
click node_request "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/common/middleware/request-context.middleware.ts"
click node_prisma "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/database/prisma.service.ts"
click node_healthmodule "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/health/health.module.ts"
click node_health "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/health/health.controller.ts"
click node_prismaindicator "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/health/indicators/prisma-health.indicator.ts"
click node_redisindicator "https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/health/indicators/redis-health.indicator.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app,node_client toneBlue
class node_config,node_env,node_filter,node_request,node_prisma,node_db,node_redis toneAmber
class node_healthmodule,node_health,node_prismaindicator,node_redisindicator toneMint
```

## Components

### API startup

- [Bootstrap](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/main.ts): `src/main.ts`
- [Root module](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/app.module.ts): `src/app.module.ts`

### Shared foundation

- [Configuration](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/config/configuration.ts): `src/config/configuration.ts`
- [Environment validation](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/config/env.validation.ts): `src/config/env.validation.ts`
- [Error filter](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/common/filters/all-exceptions.filter.ts): `src/common/filters/all-exceptions.filter.ts`
- [Request context](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/common/middleware/request-context.middleware.ts): `src/common/middleware/request-context.middleware.ts`
- [Prisma service](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/database/prisma.service.ts): `src/database/prisma.service.ts`

### Health checks

- [Health module](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/health/health.module.ts): `src/health/health.module.ts`
- [Health endpoint](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/health/health.controller.ts): `src/health/health.controller.ts`
- [Postgres indicator](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/health/indicators/prisma-health.indicator.ts): `src/health/indicators/prisma-health.indicator.ts`
- [Redis indicator](https://github.com/zeyadelbadawi/atlas-backend/blob/main/src/health/indicators/redis-health.indicator.ts): `src/health/indicators/redis-health.indicator.ts`

### Other components

- **API client**
- **PostgreSQL**
- **Redis**

## Connections

- Bootstrap → Root module: starts
- Bootstrap → Configuration: loads configuration
- Bootstrap → Environment validation: validates environment
- Bootstrap → Error filter: registers filter
- Bootstrap → Request context: registers middleware
- Root module → Health module: wires
- Root module → Prisma service: wires
- Prisma service → PostgreSQL: connects
- API client → Health endpoint: requests health
- Health endpoint → Postgres indicator: checks
- Health endpoint → Redis indicator: checks
- Postgres indicator → PostgreSQL: probes
- Redis indicator → Redis: probes
