# Smart City Digital Twin - Data Flow Diagram

Updated: 2026-05-06 - Architecture with 3 IoT Agents (one per MQTT broker)

graph TB subgraph Simulateur["🖥️ Simulateur (Host Python)"] SIM[Smart City Simulator
10 capteurs
Intervalle: configurable] end subgraph MQTT_Brokers["📡 MQTT Brokers"] EMQ[EMQX
port 11883] MOS[Mosquitto
port 1883] BUN[BunkerM
port 1900
MQTTS/TLS] end subgraph IoT_Agent["🤖 3 IoT Agents (NGSI-LD)"] IOTA_EMQ[IoT-Agent-EMQX
port 4041
Ecoute EMQX] IOTA_MOS[IoT-Agent-Mosquitto
port 4042
Ecoute Mosquitto] IOTA_BUN[IoT-Agent-BunkerM
port 4043
Ecoute BunkerM] end subgraph CB["🔗 Context Brokers (NGSI-LD)"] ORI[Orion-LD
NGSI-v2
port 1026] STE[Stellio
NGSI-LD
port 8080] FRO[FROST-Server
SensorThings
port 8080] end subgraph Analytics["📈 Analytics & Time-Series"] QL[QuantumLeap
NGSI-LD → CrateDB
port 8668] CRATEDB[CrateDB
PostgreSQL-compatible
port 4200/5432] end subgraph Storage["💾 Stockage & Métriques"] INF[InfluxDB
Bucket: iot_data
port 8086] PRO[Prometheus
Scrape: /metrics
port 9090] GEO[GeoServer
WMS/WFS/WMTS
port 8080] end subgraph IoT_Platform["🏢 Plateforme IoT"] ORM[OpenRemote Manager
MQTT Agent
port 8080] KC[Keycloak
port 8080] end subgraph VIZ["📊 Visualisation"] GRA[Grafana
Dashboards
port 3001] MAP[MapStore
WMS/WFS
port 8080] end %% ── Flux Simulateur ────────────────────────────────────────── SIM -->|"1️⃣ MQTT publish
smartcity-api-key/{id}/attrs"| EMQ SIM -->|"1️⃣ MQTT publish"| MOS SIM -->|"1️⃣ MQTT publish"| BUN SIM -->|"5️⃣ InfluxDB v2 API
async non-bloquant"| INF %% ── Flux MQTT → IoT Agents ────────────────────────────────── EMQ -->|"MQTT subscribe
smartcity-api-key/#"| IOTA_EMQ MOS -->|"MQTT subscribe"| IOTA_MOS BUN -->|"MQTT subscribe"| IOTA_BUN %% ── Flux IoT Agents → Context Brokers ─────────────────────── IOTA_EMQ -->|"2️⃣ NGSI-v2 POST
/v2/entities"| ORI IOTA_MOS -->|"2️⃣ NGSI-v2 POST"| ORI IOTA_BUN -->|"2️⃣ NGSI-v2 POST"| ORI %% ── Flux Context Brokers → QuantumLeap ─────────────────── ORI -->|"NGSI-v2 Subscription
→ QuantumLeap"| QL %% ── Flux QuantumLeap → CrateDB ──────────────────────────── QL -->|"Insert
PostgreSQL wire"| CRATEDB %% ── Visualisation ─────────────────────────────────────────── CRATEDB -->|"PostgreSQL Datasource"| GRA INF -->|"Datasource Flux IoT"| GRA ORI -->|"NGSI-v2 Datasource"| GRA GEO -->|"WMS/WMTS"| MAP ORM -->|MapSettings
Martinique| MAP ORM -->|"Live assets
REST"| GRA %% ── OpenRemote MQTT Agent ─────────────────────────────────── EMQ -->|"6️⃣ Subscribe
city/sensors/#"| ORM MOS -->|"6️⃣ Subscribe"| ORM BUN -->|"6️⃣ Subscribe"| ORM %% ── Métriques Prometheus ─────────────────────────────────── SIM -->|"7️⃣ /metrics
port 8001"| PRO EMQ -->|"/api/v5/metrics"| PRO STE -->|"/actuator/prometheus"| PRO INF -->|"/metrics"| PRO ORM -->|"/actuator/prometheus"| PRO GRA -->|"/metrics"| PRO IOTA_EMQ -->|"/metrics"| PRO IOTA_MOS -->|"/metrics"| PRO IOTA_BUN -->|"/metrics"| PRO QL -->|"/metrics"| PRO