# nostaze/formations architecture

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

- Interactive diagram: https://gitdiagram.com/nostaze/formations
- Repository: https://github.com/nostaze/formations

## Overview

This repository is a collection of small NestJS examples plus a standalone Axios fetch example. The clearest user-to-result workflow is the messages app: HTTP requests enter its controller, pass through a service to file-backed storage, and produce message responses. Other examples demonstrate basic routes and a simple outbound JSON request. The messages module and some demo entry points were not sampled, so their wiring is represented only where supported by the tree or explicit imports.

Main entry points: [`nest/prod/messages/src/messages/messages.controller.ts`](https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/messages.controller.ts) (Messages controller), [`nest/mycv/src/app.module.ts`](https://github.com/nostaze/formations/blob/main/nest/mycv/src/app.module.ts) (Greeting module), [`nest/fetchjson/index.ts`](https://github.com/nostaze/formations/blob/main/nest/fetchjson/index.ts) (Todo fetch script), [`nest/prod/messages/src/messages/messages.service.ts`](https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/messages.service.ts) (Messages service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_messages["Messages API"]
  node_messages_main["Server bootstrap<br/>[main.ts]"]
  node_messages_module["Messages module<br/>[messages.module.ts]"]
  node_messages_controller["Messages controller"]
  node_message_dto["Create message DTO"]
  node_messages_service["Messages service"]
  node_messages_repository["Messages repository"]
  node_messages_file[("Message JSON file<br/>[messages.json]")]
end

subgraph group_demos["NestJS Demos"]
  node_mycv_controller["Greeting controller<br/>[app.controller.ts]"]
  node_mycv_service["Greeting service<br/>[app.service.ts]"]
  node_mycv_module["Greeting module<br/>[app.module.ts]"]
  node_scratch_controller["Static route controller<br/>[app.controller.ts]"]
  node_scratch_main["Demo bootstrap<br/>[main.ts]"]
  node_scratch_module["Demo module<br/>[app.module.ts]"]
end

subgraph group_client["Fetch Example"]
  node_json_script["Todo fetch script<br/>[index.ts]"]
end

node_caller(("HTTP client"))
node_todo_api["JSONPlaceholder API"]
node_terminal(("Console output"))

node_caller -->|"sends requests"| node_messages_controller
node_messages_main -->|"starts app"| node_messages_module
node_messages_controller -->|"accepts body"| node_message_dto
node_messages_controller -->|"calls operations"| node_messages_service
node_messages_service -->|"delegates storage"| node_messages_repository
node_messages_repository -->|"reads and writes"| node_messages_file
node_messages_controller -->|"returns responses"| node_caller
node_mycv_controller -->|"calls greeting"| node_mycv_service
node_mycv_module -->|"registers"| node_mycv_controller
node_mycv_module -->|"provides"| node_mycv_service
node_scratch_main -->|"starts app"| node_scratch_module
node_scratch_module -->|"registers"| node_scratch_controller
node_json_script -->|"fetches todo"| node_todo_api
node_json_script -->|"logs result"| node_terminal

click node_messages_main "https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/main.ts"
click node_messages_module "https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/messages.module.ts"
click node_messages_controller "https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/messages.controller.ts"
click node_message_dto "https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/dtos/create-message.dto.ts"
click node_messages_service "https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/messages.service.ts"
click node_messages_repository "https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/messages.repository.ts"
click node_messages_file "https://github.com/nostaze/formations/blob/main/nest/prod/messages/messages.json"
click node_mycv_controller "https://github.com/nostaze/formations/blob/main/nest/mycv/src/app.controller.ts"
click node_mycv_service "https://github.com/nostaze/formations/blob/main/nest/mycv/src/app.service.ts"
click node_mycv_module "https://github.com/nostaze/formations/blob/main/nest/mycv/src/app.module.ts"
click node_scratch_controller "https://github.com/nostaze/formations/blob/main/nest/scratch/src/app.controller.ts"
click node_scratch_main "https://github.com/nostaze/formations/blob/main/nest/scratch/src/main.ts"
click node_scratch_module "https://github.com/nostaze/formations/blob/main/nest/scratch/src/app.module.ts"
click node_json_script "https://github.com/nostaze/formations/blob/main/nest/fetchjson/index.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_messages_main,node_messages_module,node_messages_controller,node_message_dto,node_messages_service,node_messages_repository,node_messages_file,node_caller toneBlue
class node_mycv_controller,node_mycv_service,node_mycv_module,node_scratch_controller,node_scratch_main,node_scratch_module toneAmber
class node_json_script,node_todo_api toneMint
class node_terminal toneIndigo
```

## Components

### Messages API

- [Server bootstrap](https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/main.ts): `nest/prod/messages/src/main.ts`
- [Messages module](https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/messages.module.ts): `nest/prod/messages/src/messages/messages.module.ts`
- [Messages controller](https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/messages.controller.ts): `nest/prod/messages/src/messages/messages.controller.ts`
- [Create message DTO](https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/dtos/create-message.dto.ts): `nest/prod/messages/src/messages/dtos/create-message.dto.ts`
- [Messages service](https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/messages.service.ts): `nest/prod/messages/src/messages/messages.service.ts`
- [Messages repository](https://github.com/nostaze/formations/blob/main/nest/prod/messages/src/messages/messages.repository.ts): `nest/prod/messages/src/messages/messages.repository.ts`
- [Message JSON file](https://github.com/nostaze/formations/blob/main/nest/prod/messages/messages.json): `nest/prod/messages/messages.json`

### NestJS Demos

- [Greeting controller](https://github.com/nostaze/formations/blob/main/nest/mycv/src/app.controller.ts): `nest/mycv/src/app.controller.ts`
- [Greeting service](https://github.com/nostaze/formations/blob/main/nest/mycv/src/app.service.ts): `nest/mycv/src/app.service.ts`
- [Greeting module](https://github.com/nostaze/formations/blob/main/nest/mycv/src/app.module.ts): `nest/mycv/src/app.module.ts`
- [Static route controller](https://github.com/nostaze/formations/blob/main/nest/scratch/src/app.controller.ts): `nest/scratch/src/app.controller.ts`
- [Demo bootstrap](https://github.com/nostaze/formations/blob/main/nest/scratch/src/main.ts): `nest/scratch/src/main.ts`
- [Demo module](https://github.com/nostaze/formations/blob/main/nest/scratch/src/app.module.ts): `nest/scratch/src/app.module.ts`

### Fetch Example

- [Todo fetch script](https://github.com/nostaze/formations/blob/main/nest/fetchjson/index.ts): `nest/fetchjson/index.ts`

### Other components

- **HTTP client**
- **JSONPlaceholder API**
- **Console output**

## Connections

- HTTP client → Messages controller: sends requests
- Server bootstrap → Messages module: starts app
- Messages controller → Create message DTO: accepts body
- Messages controller → Messages service: calls operations
- Messages service → Messages repository: delegates storage
- Messages repository → Message JSON file: reads and writes
- Messages controller → HTTP client: returns responses
- Greeting controller → Greeting service: calls greeting
- Greeting module → Greeting controller: registers
- Greeting module → Greeting service: provides
- Demo bootstrap → Demo module: starts app
- Demo module → Static route controller: registers
- Todo fetch script → JSONPlaceholder API: fetches todo
- Todo fetch script → Console output: logs result
