# eccureuil/api-formations-odc architecture

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

- Interactive diagram: https://gitdiagram.com/eccureuil/api-formations-odc
- Repository: https://github.com/eccureuil/api-formations-odc

## Overview

This is a small Express API for browsing a catalog of training formations. A client sends a request to the server, which mounts the formations routes; handlers return either the full catalog or one formation by ID as JSON. The catalog is a static in-memory array, not a persistent store. The model defines its TypeScript shape. No README was provided, so the map reflects the sampled source files only.

Main entry points: [`src/controllers/formationsController.ts`](https://github.com/eccureuil/api-formations-odc/blob/main/src/controllers/formationsController.ts) (Formation handlers), [`src/server.ts`](https://github.com/eccureuil/api-formations-odc/blob/main/src/server.ts) (HTTP server), [`src/app.ts`](https://github.com/eccureuil/api-formations-odc/blob/main/src/app.ts) (Express app), [`src/routes/formations.ts`](https://github.com/eccureuil/api-formations-odc/blob/main/src/routes/formations.ts) (Formation routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["HTTP runtime"]
  node_server["HTTP server<br/>[server.ts]"]
  node_app["Express app<br/>[app.ts]"]
  node_routes["Formation routes<br/>[formations.ts]"]
end

subgraph group_catalog["Formation catalog"]
  node_controller["Formation handlers"]
  node_data["Formation data<br/>[formations.ts]"]
  node_model["Formation type<br/>[Formation.ts]"]
end

node_client(("API client"))

node_client -->|"HTTP request"| node_server
node_server -->|"serves app"| node_app
node_app -->|"mounts routes"| node_routes
node_routes -->|"dispatches"| node_controller
node_controller -->|"reads catalog"| node_data
node_data -->|"typed as"| node_model
node_controller -->|"JSON response"| node_client

click node_server "https://github.com/eccureuil/api-formations-odc/blob/main/src/server.ts"
click node_app "https://github.com/eccureuil/api-formations-odc/blob/main/src/app.ts"
click node_routes "https://github.com/eccureuil/api-formations-odc/blob/main/src/routes/formations.ts"
click node_controller "https://github.com/eccureuil/api-formations-odc/blob/main/src/controllers/formationsController.ts"
click node_data "https://github.com/eccureuil/api-formations-odc/blob/main/src/data/formations.ts"
click node_model "https://github.com/eccureuil/api-formations-odc/blob/main/src/models/Formation.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_server,node_app,node_routes,node_client toneBlue
class node_controller,node_data,node_model toneAmber
```

## Components

### HTTP runtime

- [HTTP server](https://github.com/eccureuil/api-formations-odc/blob/main/src/server.ts): `src/server.ts`
- [Express app](https://github.com/eccureuil/api-formations-odc/blob/main/src/app.ts): `src/app.ts`
- [Formation routes](https://github.com/eccureuil/api-formations-odc/blob/main/src/routes/formations.ts): `src/routes/formations.ts`

### Formation catalog

- [Formation handlers](https://github.com/eccureuil/api-formations-odc/blob/main/src/controllers/formationsController.ts): `src/controllers/formationsController.ts`
- [Formation data](https://github.com/eccureuil/api-formations-odc/blob/main/src/data/formations.ts): `src/data/formations.ts`
- [Formation type](https://github.com/eccureuil/api-formations-odc/blob/main/src/models/Formation.ts): `src/models/Formation.ts`

### Other components

- **API client**

## Connections

- API client → HTTP server: HTTP request
- HTTP server → Express app: serves app
- Express app → Formation routes: mounts routes
- Formation routes → Formation handlers: dispatches
- Formation handlers → Formation data: reads catalog
- Formation data → Formation type: typed as
- Formation handlers → API client: JSON response
