# valentinratigniet-byte/projet-21-entrepot-transport architecture

> Architecture diagram of the GitHub repository valentinratigniet-byte/projet-21-entrepot-transport, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/valentinratigniet-byte/projet-21-entrepot-transport
- Repository: https://github.com/valentinratigniet-byte/projet-21-entrepot-transport

## Overview

TransVal is a transport-analytics warehouse and reporting project: simulated operational systems feed incremental raw imports, dbt transforms them into analytics models and KPIs, and a shared Power BI semantic model serves 23 subject reports. The README documents the domain stages and daily n8n operations; source excerpts show generation, ingestion, semantic-model construction, and execution reporting. The dbt internals and n8n workflow details are unsampled, so their paths and documented relationships are shown at subsystem level.

Main entry points: [`ingestion/load_raw.py`](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/ingestion/load_raw.py) (Raw ingestion), [`dbt/models/marts`](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/dbt/models/marts) (Analytics marts), [`powerbi/build_model.py`](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/powerbi/build_model.py) (Semantic model build), [`powerbi`](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/powerbi) (Subject reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Source generation"]
  node_sources["Simulated sources<br/>[generate.py]"]
  node_source_complements["Data complements<br/>[complements.py]"]
  node_legacy["Legacy reports"]
end

subgraph group_warehouse["Data warehouse"]
  node_ingestion["Raw ingestion<br/>[load_raw.py]"]
  node_raw_db[("DuckDB raw layer")]
  node_staging["Staging models"]
  node_marts["Analytics marts"]
  node_kpi["KPI models"]
  node_warehouse_db[("DuckDB warehouse")]
end

subgraph group_analytics["Power BI analytics"]
  node_semantic_build["Semantic model build<br/>[build_model.py]"]
  node_measures["DAX measures<br/>[mesures.py]"]
  node_semantic_model["TransVal model"]
  node_reports["Subject reports"]
  node_lineage["Report lineage<br/>[exposures_dbt.py]"]
end

subgraph group_operations["Operations"]
  node_execution_report["Execution report"]
  node_orchestration["Daily orchestration"]
end

node_analyst(("Report user"))
node_external_sources(("Operational systems"))

node_sources -->|"uses complements"| node_source_complements
node_sources -->|"supplies data"| node_ingestion
node_source_complements -->|"adds source data"| node_ingestion
node_external_sources -->|"simulates imports"| node_ingestion
node_ingestion -->|"writes raw tables"| node_raw_db
node_raw_db -->|"transforms raw"| node_staging
node_staging -->|"conforms data"| node_marts
node_marts -->|"derives KPIs"| node_kpi
node_marts -->|"stores models"| node_warehouse_db
node_kpi -->|"stores KPI results"| node_warehouse_db
node_warehouse_db -->|"exports tables"| node_semantic_build
node_semantic_build -->|"loads measures"| node_measures
node_semantic_build -->|"writes model"| node_semantic_model
node_semantic_model -->|"serves reports"| node_reports
node_reports -->|"presents insights"| node_analyst
node_legacy -->|"reads directly"| node_external_sources
node_legacy -->|"compares KPI parity"| node_warehouse_db
node_reports -->|"registers lineage"| node_lineage
node_warehouse_db -->|"reads freshness and quality"| node_execution_report
node_execution_report -->|"feeds alert decisions"| node_orchestration
node_orchestration -->|"triggers daily refresh"| node_ingestion

click node_sources "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/sources/generate.py"
click node_source_complements "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/sources/complements.py"
click node_legacy "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/legacy/rapports_powerbi.py"
click node_ingestion "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/ingestion/load_raw.py"
click node_staging "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/dbt/models/staging"
click node_marts "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/dbt/models/marts"
click node_kpi "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/dbt/models/marts/kpi"
click node_semantic_build "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/powerbi/build_model.py"
click node_measures "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/powerbi/mesures.py"
click node_semantic_model "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/powerbi"
click node_reports "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/powerbi"
click node_lineage "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/powerbi/exposures_dbt.py"
click node_execution_report "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/ops/rapport_execution.py"
click node_orchestration "https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/n8n"

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_sources,node_source_complements,node_legacy,node_analyst toneBlue
class node_ingestion,node_raw_db,node_staging,node_marts,node_kpi,node_warehouse_db toneAmber
class node_semantic_build,node_measures,node_semantic_model,node_reports,node_lineage toneMint
class node_execution_report,node_orchestration toneRose
class node_external_sources toneIndigo
```

## Components

### Source generation

- [Simulated sources](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/sources/generate.py): `sources/generate.py`
- [Data complements](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/sources/complements.py): `sources/complements.py`
- [Legacy reports](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/legacy/rapports_powerbi.py): `legacy/rapports_powerbi.py`

### Data warehouse

- [Raw ingestion](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/ingestion/load_raw.py): `ingestion/load_raw.py`
- **DuckDB raw layer**
- [Staging models](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/dbt/models/staging): `dbt/models/staging`
- [Analytics marts](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/dbt/models/marts): `dbt/models/marts`
- [KPI models](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/dbt/models/marts/kpi): `dbt/models/marts/kpi`
- **DuckDB warehouse**

### Power BI analytics

- [Semantic model build](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/powerbi/build_model.py): `powerbi/build_model.py`
- [DAX measures](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/powerbi/mesures.py): `powerbi/mesures.py`
- [TransVal model](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/powerbi): `powerbi`
- [Subject reports](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/powerbi): `powerbi`
- [Report lineage](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/powerbi/exposures_dbt.py): `powerbi/exposures_dbt.py`

### Operations

- [Execution report](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/blob/main/ops/rapport_execution.py): `ops/rapport_execution.py`
- [Daily orchestration](https://github.com/valentinratigniet-byte/projet-21-entrepot-transport/tree/main/n8n): `n8n`

### Other components

- **Report user**
- **Operational systems**

## Connections

- Simulated sources → Data complements: uses complements (evidence: `sources/generate.py`)
- Simulated sources → Raw ingestion: supplies data (evidence: `README.md`)
- Data complements → Raw ingestion: adds source data (evidence: `README.md`)
- Operational systems → Raw ingestion: simulates imports (evidence: `README.md`)
- Raw ingestion → DuckDB raw layer: writes raw tables (evidence: `ingestion/load_raw.py`)
- DuckDB raw layer → Staging models: transforms raw (evidence: `README.md`)
- Staging models → Analytics marts: conforms data (evidence: `README.md`)
- Analytics marts → KPI models: derives KPIs (evidence: `README.md`)
- Analytics marts → DuckDB warehouse: stores models (evidence: `README.md`)
- KPI models → DuckDB warehouse: stores KPI results (evidence: `README.md`)
- DuckDB warehouse → Semantic model build: exports tables (evidence: `powerbi/build_model.py`)
- Semantic model build → DAX measures: loads measures (evidence: `powerbi/build_model.py`)
- Semantic model build → TransVal model: writes model (evidence: `powerbi/build_model.py`)
- TransVal model → Subject reports: serves reports (evidence: `README.md`)
- Subject reports → Report user: presents insights (evidence: `README.md`)
- Legacy reports → Operational systems: reads directly (evidence: `legacy/rapports_powerbi.py`)
- Legacy reports → DuckDB warehouse: compares KPI parity (evidence: `README.md`)
- Subject reports → Report lineage: registers lineage (evidence: `powerbi/exposures_dbt.py`)
- DuckDB warehouse → Execution report: reads freshness and quality (evidence: `ops/rapport_execution.py`)
- Execution report → Daily orchestration: feeds alert decisions (evidence: `ops/rapport_execution.py`)
- Daily orchestration → Raw ingestion: triggers daily refresh (evidence: `README.md`)
