# quen9669/openlux architecture

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

- Interactive diagram: https://gitdiagram.com/quen9669/openlux
- Repository: https://github.com/quen9669/openlux

## Overview

OpenLux Hub fédère des flux publics luxembourgeois, les collecte et les transforme en tables analytiques Gold, puis les expose via API, MCP et publication open data. Le parcours principal passe de la configuration des sources à la collecte/normalisation Bronze, aux modèles SQL dbt et aux exports Parquet. La CLI orchestre ce parcours; l’API et le serveur MCP sont des canaux de lecture. Les liens reposent sur les extraits et les déclarations du README; les sous-étapes dbt non échantillonnées sont limitées aux relations documentées.

Main entry points: [`src/openlux/core/collector.py`](https://github.com/quen9669/openlux/blob/main/src/openlux/core/collector.py) (Collecte réseau), [`src/openlux/cli.py`](https://github.com/quen9669/openlux/blob/main/src/openlux/cli.py) (CLI orchestreur), [`src/openlux/api/main.py`](https://github.com/quen9669/openlux/blob/main/src/openlux/api/main.py) (API REST et portail), [`data/gold`](https://github.com/quen9669/openlux/tree/main/data/gold) (Tables Gold)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration et sources"]
  node_source_registry["Registre sources<br/>[sources.toml]"]
  node_config_loader["Validation config<br/>[config.py]"]
  node_cli["CLI orchestreur<br/>[cli.py]"]
end

subgraph group_ingestion["Collecte et normalisation"]
  node_collector["Collecte réseau<br/>[collector.py]"]
  node_traffic_parsers["Parseurs trafic<br/>[parsers.py]"]
  node_city_parsers["Parseurs mobilité<br/>[parsers_city.py]"]
  node_civic_parsers["Parseurs civiques<br/>[parsers_civic.py]"]
  node_culture_parsers["Parseurs culture<br/>[parsers_culture.py]"]
  node_environment_parsers["Parseurs environnement<br/>[parsers_env.py]"]
  node_file_parsers["Parseurs fichiers<br/>[parsers_files.py]"]
  node_transit_parsers["Parseurs transport<br/>[parsers_transit.py]"]
  node_sanitizer["Filtrage données<br/>[sanitizer.py]"]
  node_bronze[("Archives Bronze")]
end

subgraph group_analytics["Modélisation analytique"]
  node_dbt_models["Modèles Silver Gold"]
  node_gold_export["Export Parquet Gold<br/>[gold.py]"]
  node_gold_tables[("Tables Gold")]
end

subgraph group_quality["Qualité et supervision"]
  node_checks["Vérifications sources<br/>[checks.py]"]
  node_quality["Trust Scores<br/>[quality.py]"]
  node_monitoring["État et historique<br/>[monitoring.py]"]
end

subgraph group_access["Accès et publication"]
  node_gold_query["Requêtes Gold<br/>[gold_query.py]"]
  node_rest_api["API REST et portail<br/>[main.py]"]
  node_web_portal["Portail web"]
  node_mcp["Outils MCP<br/>[server.py]"]
  node_catalog_publish["Catalogue et publication<br/>[opendata_lu.py]"]
end

node_operator(("Opérateur"))
node_data_public_lu(("data.public.lu"))

node_operator -->|"lance"| node_cli
node_cli -->|"charge config"| node_config_loader
node_config_loader -->|"lit"| node_source_registry
node_cli -->|"orchestre collecte"| node_collector
node_collector -->|"dispatch parse"| node_traffic_parsers
node_collector -->|"dispatch parse"| node_city_parsers
node_collector -->|"dispatch parse"| node_civic_parsers
node_collector -->|"dispatch parse"| node_culture_parsers
node_collector -->|"dispatch parse"| node_environment_parsers
node_collector -->|"dispatch parse"| node_file_parsers
node_collector -->|"dispatch parse"| node_transit_parsers
node_collector -->|"nettoie"| node_sanitizer
node_collector -->|"écrit archives"| node_bronze
node_cli -->|"exécute dbt"| node_dbt_models
node_dbt_models -->|"produit modèles"| node_gold_export
node_gold_export -->|"écrit Parquet"| node_gold_tables
node_cli -->|"vérifie sources"| node_checks
node_cli -->|"enregistre scores"| node_quality
node_quality -->|"alimente état"| node_monitoring
node_rest_api -->|"requête données"| node_gold_query
node_gold_query -->|"lit Parquet"| node_gold_tables
node_rest_api -->|"expose santé"| node_monitoring
node_rest_api -->|"construit catalogue"| node_catalog_publish
node_rest_api -->|"sert interface"| node_web_portal
node_mcp -->|"interroge tables"| node_gold_query
node_mcp -->|"lit contexte"| node_gold_tables
node_mcp -->|"lit état"| node_monitoring
node_catalog_publish -->|"décrit datasets"| node_gold_tables
node_catalog_publish -.->|"publie catalogue"| node_data_public_lu

click node_source_registry "https://github.com/quen9669/openlux/blob/main/config/sources.toml"
click node_config_loader "https://github.com/quen9669/openlux/blob/main/src/openlux/config.py"
click node_cli "https://github.com/quen9669/openlux/blob/main/src/openlux/cli.py"
click node_collector "https://github.com/quen9669/openlux/blob/main/src/openlux/core/collector.py"
click node_traffic_parsers "https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers.py"
click node_city_parsers "https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_city.py"
click node_civic_parsers "https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_civic.py"
click node_culture_parsers "https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_culture.py"
click node_environment_parsers "https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_env.py"
click node_file_parsers "https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_files.py"
click node_transit_parsers "https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_transit.py"
click node_sanitizer "https://github.com/quen9669/openlux/blob/main/src/openlux/core/sanitizer.py"
click node_bronze "https://github.com/quen9669/openlux/tree/main/data"
click node_dbt_models "https://github.com/quen9669/openlux/tree/main/dbt_project/models"
click node_gold_export "https://github.com/quen9669/openlux/blob/main/src/openlux/core/gold.py"
click node_gold_tables "https://github.com/quen9669/openlux/tree/main/data/gold"
click node_checks "https://github.com/quen9669/openlux/blob/main/src/openlux/core/checks.py"
click node_quality "https://github.com/quen9669/openlux/blob/main/src/openlux/core/quality.py"
click node_monitoring "https://github.com/quen9669/openlux/blob/main/src/openlux/core/monitoring.py"
click node_gold_query "https://github.com/quen9669/openlux/blob/main/src/openlux/core/gold_query.py"
click node_rest_api "https://github.com/quen9669/openlux/blob/main/src/openlux/api/main.py"
click node_web_portal "https://github.com/quen9669/openlux/tree/main/web_v2"
click node_mcp "https://github.com/quen9669/openlux/blob/main/src/openlux/mcp/server.py"
click node_catalog_publish "https://github.com/quen9669/openlux/blob/main/src/openlux/publish/opendata_lu.py"

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_source_registry,node_config_loader,node_cli toneBlue
class node_collector,node_traffic_parsers,node_city_parsers,node_civic_parsers,node_culture_parsers,node_environment_parsers,node_file_parsers,node_transit_parsers,node_sanitizer,node_bronze toneAmber
class node_dbt_models,node_gold_export,node_gold_tables toneMint
class node_checks,node_quality,node_monitoring toneRose
class node_gold_query,node_rest_api,node_web_portal,node_mcp,node_catalog_publish,node_operator,node_data_public_lu toneIndigo
```

## Components

### Orchestration et sources

- [Registre sources](https://github.com/quen9669/openlux/blob/main/config/sources.toml): `config/sources.toml`
- [Validation config](https://github.com/quen9669/openlux/blob/main/src/openlux/config.py): `src/openlux/config.py`
- [CLI orchestreur](https://github.com/quen9669/openlux/blob/main/src/openlux/cli.py): `src/openlux/cli.py`

### Collecte et normalisation

- [Collecte réseau](https://github.com/quen9669/openlux/blob/main/src/openlux/core/collector.py): `src/openlux/core/collector.py`
- [Parseurs trafic](https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers.py): `src/openlux/core/parsers.py`
- [Parseurs mobilité](https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_city.py): `src/openlux/core/parsers_city.py`
- [Parseurs civiques](https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_civic.py): `src/openlux/core/parsers_civic.py`
- [Parseurs culture](https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_culture.py): `src/openlux/core/parsers_culture.py`
- [Parseurs environnement](https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_env.py): `src/openlux/core/parsers_env.py`
- [Parseurs fichiers](https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_files.py): `src/openlux/core/parsers_files.py`
- [Parseurs transport](https://github.com/quen9669/openlux/blob/main/src/openlux/core/parsers_transit.py): `src/openlux/core/parsers_transit.py`
- [Filtrage données](https://github.com/quen9669/openlux/blob/main/src/openlux/core/sanitizer.py): `src/openlux/core/sanitizer.py`
- [Archives Bronze](https://github.com/quen9669/openlux/tree/main/data): `data`

### Modélisation analytique

- [Modèles Silver Gold](https://github.com/quen9669/openlux/tree/main/dbt_project/models): `dbt_project/models`
- [Export Parquet Gold](https://github.com/quen9669/openlux/blob/main/src/openlux/core/gold.py): `src/openlux/core/gold.py`
- [Tables Gold](https://github.com/quen9669/openlux/tree/main/data/gold): `data/gold`

### Qualité et supervision

- [Vérifications sources](https://github.com/quen9669/openlux/blob/main/src/openlux/core/checks.py): `src/openlux/core/checks.py`
- [Trust Scores](https://github.com/quen9669/openlux/blob/main/src/openlux/core/quality.py): `src/openlux/core/quality.py`
- [État et historique](https://github.com/quen9669/openlux/blob/main/src/openlux/core/monitoring.py): `src/openlux/core/monitoring.py`

### Accès et publication

- [Requêtes Gold](https://github.com/quen9669/openlux/blob/main/src/openlux/core/gold_query.py): `src/openlux/core/gold_query.py`
- [API REST et portail](https://github.com/quen9669/openlux/blob/main/src/openlux/api/main.py): `src/openlux/api/main.py`
- [Portail web](https://github.com/quen9669/openlux/tree/main/web_v2): `web_v2`
- [Outils MCP](https://github.com/quen9669/openlux/blob/main/src/openlux/mcp/server.py): `src/openlux/mcp/server.py`
- [Catalogue et publication](https://github.com/quen9669/openlux/blob/main/src/openlux/publish/opendata_lu.py): `src/openlux/publish/opendata_lu.py`

### Other components

- **Opérateur**
- **data.public.lu**

## Connections

- Opérateur → CLI orchestreur: lance (evidence: `README.md`)
- CLI orchestreur → Validation config: charge config (evidence: `src/openlux/cli.py`)
- Validation config → Registre sources: lit (evidence: `src/openlux/config.py`)
- CLI orchestreur → Collecte réseau: orchestre collecte (evidence: `src/openlux/cli.py`)
- Collecte réseau → Parseurs trafic: dispatch parse (evidence: `src/openlux/core/collector.py`)
- Collecte réseau → Parseurs mobilité: dispatch parse (evidence: `src/openlux/core/collector.py`)
- Collecte réseau → Parseurs civiques: dispatch parse (evidence: `src/openlux/core/collector.py`)
- Collecte réseau → Parseurs culture: dispatch parse (evidence: `src/openlux/core/collector.py`)
- Collecte réseau → Parseurs environnement: dispatch parse (evidence: `src/openlux/core/collector.py`)
- Collecte réseau → Parseurs fichiers: dispatch parse (evidence: `src/openlux/core/collector.py`)
- Collecte réseau → Parseurs transport: dispatch parse (evidence: `src/openlux/core/collector.py`)
- Collecte réseau → Filtrage données: nettoie (evidence: `src/openlux/core/collector.py`)
- Collecte réseau → Archives Bronze: écrit archives (evidence: `src/openlux/core/collector.py`)
- CLI orchestreur → Modèles Silver Gold: exécute dbt (evidence: `src/openlux/cli.py`)
- Modèles Silver Gold → Export Parquet Gold: produit modèles (evidence: `README.md`)
- Export Parquet Gold → Tables Gold: écrit Parquet (evidence: `src/openlux/core/gold.py`)
- CLI orchestreur → Vérifications sources: vérifie sources (evidence: `src/openlux/cli.py`)
- CLI orchestreur → Trust Scores: enregistre scores (evidence: `src/openlux/cli.py`)
- Trust Scores → État et historique: alimente état (evidence: `src/openlux/core/quality.py`)
- API REST et portail → Requêtes Gold: requête données (evidence: `src/openlux/api/main.py`)
- Requêtes Gold → Tables Gold: lit Parquet (evidence: `src/openlux/core/gold_query.py`)
- API REST et portail → État et historique: expose santé (evidence: `src/openlux/api/main.py`)
- API REST et portail → Catalogue et publication: construit catalogue (evidence: `src/openlux/api/main.py`)
- API REST et portail → Portail web: sert interface (evidence: `src/openlux/api/main.py`)
- Outils MCP → Requêtes Gold: interroge tables (evidence: `src/openlux/mcp/server.py`)
- Outils MCP → Tables Gold: lit contexte (evidence: `src/openlux/mcp/server.py`)
- Outils MCP → État et historique: lit état (evidence: `src/openlux/mcp/server.py`)
- Catalogue et publication → Tables Gold: décrit datasets (evidence: `src/openlux/publish/opendata_lu.py`)
- Catalogue et publication → data.public.lu: publie catalogue (evidence: `README.md`)
