# Smart City Digital Twin Martinique — Architecture des Stacks

> Snapshot: 2026-05-23 12:00
> Total: 117 containers / 26 stacks

## 🌐 Infrastructure Réseau

| Réseau | Driver | Usage |
|--------|--------|-------|
| traefik | bridge | Reverse proxy principal |
| traefik-public | bridge |Services exposés |
| smartcity-shared | bridge | Réseau partagé smart city |
| mainflux-network | bridge | Stack Mainflux |
| emqx_default | bridge | Broker EMQX |
| contexus-iot-network | bridge | Stack Contexus |
| fiware-gis-quickstart_fiware | bridge | FIWARE |
| mapstore2_mapstore-network | bridge | MapStore |
| honcho_default | bridge | Honcho |
| digital-twin_digital-twin | bridge | NodeRed + Connector |
| openremote_default | bridge | OpenRemote (actuellement DOWN) |
| docker_default | bridge | Stack principale |
| bridge | bridge | Défaut Docker |

---

## 📦 Stacks Détaillées

### 1. TRAFICKO (1 container)
| Service | Image | Ports |
|---------|-------|-------|
| traefik | traefik:v3.1 | 80, 443, 8404 |

### 2. SMART-CITY-CORE (17 containers) ⚠️ 7 issues
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| smart-city-simulator | smart-city-digital-twin-martinique-simulator | 🔴 CRASH (exit 137, 896 restarts) | 8081 |
| smart-city-telegraf | telegraf:1.28 | 🔴 Restart boucle | - |
| smart-city-influxdb | influxdb:2.7-alpine | ✅ Healthy | 8086 |
| smart-city-grafana | grafana/grafana:10.2.0 | ✅ Up | 3001 |
| smart-city-loki | grafana/loki:latest | ✅ Up | 3100 |
| smart-city-promtail | grafana/promtail:latest | ✅ Up | - |
| smart-city-kepler | smart-city-kepler:latest | ✅ Up | 80, 8080 |
| smart-city-redpanda-console | redpandadata/console:v2.5.0 | ❌ Restart | - |

### 3. SMART-CITY-IOT (5 containers)
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| smart-city-ditto-gateway | eclipse/ditto-gateway:latest | ✅ Up | 8080 |
| smart-city-ditto-policies | eclipse/ditto-policies:latest | ✅ Up | 8080 |
| smart-city-ditto-mongodb | mongo:6 | ✅ Up | 27017 |
| smart-city-digital-twin-martinique-mosquitto-1 | eclipse-mosquitto:2 | ✅ Up | 1883 |
| smart-city-digital-twin-martinique-redis-1 | redis:7-alpine | ✅ Up | 6379 |

### 4. MAINFLUX (39 containers) ⚠️ 1 issue
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| mainfluxlabs-ui | mainfluxlabs/ui:v0.36.1 | ✅ Up | 3000 |
| mainfluxlabs-users | mainfluxlabs/users:v0.36.1 | ✅ Up | 8180, 8184 |
| mainfluxlabs-auth | mainfluxlabs/auth:v0.36.1 | ✅ Up | 8181, 8189 |
| mainfluxlabs-things | mainfluxlabs/things:v0.36.1 | ✅ Up | 8182-8183, 8989 |
| mainfluxlabs-mqtt | mainfluxlabs/mqtt:v0.36.1 | ✅ Up | - |
| mainfluxlabs-http | mainfluxlabs/http:v0.36.1 | ✅ Up | 8185 |
| mainfluxlabs-ws | mainfluxlabs/ws:v0.36.1 | ✅ Up | 8190 |
| mainfluxlabs-coap | mainfluxlabs/coap:v0.36.1 | ✅ Up | 5683 |
| mainfluxlabs-modbus | mainfluxlabs/modbus:v0.36.1 | ✅ Up | 9028 |
| mainfluxlabs-broker | nats:2.2.4-alpine | ✅ Up | 4222, 8222 |
| mainfluxlabs-mosquitto | eclipse-mosquitto:2.0 | ✅ Up | 1883 |
| + 28 autres services DB/writer/reader/notifier | | ✅ Up | |

### 5. THINGSBOARD (14 containers) ⚠️ 7 issues
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| docker_tb-web-ui1_1 | thingsboard/tb-web-ui:latest | ✅ Up | 32769→8080 |
| docker_tb-web-ui2_1 | thingsboard/tb-web-ui:latest | ✅ Up | 32770→8080 |
| docker_tb-js-executor_1-10 | thingsboard/tb-js-executor:latest | ⚠️ Redémarrages | - |
| docker_zookeeper_1 | zookeeper:3.8.1 | ✅ Up | 2181, 32768 |
| docker_tb-rule-engine1_1 | - | ⚠️ Created (pas démarré) | - |
| docker_tb-rule-engine2_1 | - | ⚠️ Created (pas démarré) | - |
| thingsboard-rabbitmq | rabbitmq:3.12-management | ✅ Healthy | 4369, 5671-5672 |
| thingsboard-postgres | postgres:15-alpine | ✅ Healthy | 5432 |

### 6. MAPSTORE (3 containers) ⚠️ 502 via Traefik
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| mapstore-proxy | nginx | ✅ Up | 80 |
| mapstore-app | geosolutionsit/mapstore2:latest | ✅ Up | 8080 |
| mapstore-postgres | geosolutions-mapstore/postgis | ✅ Healthy | 5432 |

### 7. GEOSERVER (1 container)
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| geoserver_stack-geoserver-1 | oscarfonts/geoserver:2.25.2 | ✅ Healthy | 8080 |

PostGIS dédié :
| postgis-smartcity | postgis/postgis:15-3.4 | ✅ Healthy | 5433 |

### 8. CONTXUS (3 containers) ⚠️ unhealthy
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| contexus-app | contexusio/contexus:latest | ⚠️ Unhealthy | 15000 |
| contexus-postgres | postgres:16 | ✅ Healthy | 5432 |
| contexus-redis | redis:7-alpine | ✅ Healthy | 6379 |

### 9. CHIRPSTACK (3 containers)
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| smart-city-digital-twin-martinique-chirpstack-1 | chirpstack/chirpstack:latest | ✅ Up | - |
| chirpstack/chirpstack-rest-api:4 | chirpstack/chirpstack-rest-api:4 | ✅ Up | - |
| chirpstack/chirpstack-gateway-bridge:4 | chirpstack/chirpstack-gateway-bridge:4 | ✅ Up | 1700/udp |
| chirpstack-mosquitto | eclipse-mosquitto:2 | ✅ Up | 1883 |
| chirpstack-redis | redis:7-alpine | ✅ Up | 6379 |
| chirpstack-postgres | postgres:14-alpine | ✅ Up | 5432 |

### 10. FIWARE (3 containers)
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| fiware-gis-quickstart-orion-1 | quay.io/fiware/orion-ld | ✅ Healthy | 2026→1026 |
| fiware-gis-quickstart-orionproxy-1 | fiware-gis-quickstart-orionproxy | ✅ Up | 1026→80 |
| fiware-gis-quickstart-mongo-db-1 | mongo:4.2 | ✅ Up | 27017 |

### 11. FROST (2 containers)
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| frost_allinone-web-1 | fraunhoferiosb/frost-server:latest | ✅ Up | 1883, 8089, 8090→8080 |
| frost_http-web-1 | fraunhoferiosb/frost-server-http:latest | ✅ Up | 8080 |

### 12. EMQX (1 container)
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| emqx_emqx_1 | emqx/emqx:latest | ✅ Up | 1883, 8883, 18083, 8081, 8083-8084, 11883, 38083 |

### 13. STELLIO (5 containers) ⚠️ 4 down
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| stellio-api-gateway | stellio/stellio-api-gateway:latest-dev | ✅ Up | 8080 |
| stellio-search-service | - | ❌ Exited | - |
| stellio-subscription-service | - | ❌ Exited | - |
| stellio-kafka | - | ❌ Exited | - |
| stellio-postgres | - | ❌ Exited | - |

### 14. DIGITAL-TWIN (2 containers)
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| digital-twin-nodered | nodered/node-red:3.1 | ✅ Healthy | 1880 |
| digital-twin-connector | python:3.11-slim | ✅ Up | - |

### 15. HONCHO (4 containers) ⚠️ API restart
| Service | Image | Status | Ports |
|---------|-------|--------|-------|
| honcho-api-1 | honcho:latest | ⚠️ Restart | - |
| honcho-deriver-1 | honcho-deriver | ✅ Healthy | 8000 |
| honcho-grafana-1 | grafana/grafana:11.4.0 | ✅ Healthy | 3088 |
| honcho-prometheus-1 | prom/prometheus:v3.2.1 | ✅ Healthy | 9091 |

### 16. Autres stacks
| Stack | Containers | Statut |
|-------|------------|--------|
| bunkerm | 1 | ⚠️ Unhealthy |
| phpipam | 2 | ✅ Up |
| gitea | 1 | ✅ Up |
| localai | 2 | ⚠️ Orphaned duplicate |
| agent-gateway | 1 | ✅ Up |
| yaade | 1 | ✅ Up |
| community-tools (docker-exporter) | 1 | ✅ Up |

---

## 🔌 Brokers MQTT (identifiés)

| Broker | Container | Port | Stack |
|--------|-----------|------|-------|
| Mosquitto (principal) | smart-city-digital-twin-martinique-mosquitto-1 | 1883 | smart-city-iot |
| Mosquitto (ChirpStack) | chirpstack-mosquitto-1 | 1883 | chirpstack |
| Mosquitto (Mainflux) | mainfluxlabs-mosquitto | 1883 | mainflux |
| MQTT Bridge (Mainflux) | mainfluxlabs-mqtt | - | mainflux |
| EMQX | emqx_emqx_1 | 1883, 8883, 11883 | emqx |
| RabbitMQ | thingsboard-rabbitmq | 5672 | thingsboard |
| RabbitMQ (OpenRemote) | (dans stack openremote - DOWN) | 5672 | openremote |
| NATS | mainfluxlabs-broker | 4222 | mainflux |

---

## 🔄 Flux de Données Validés

```
Simulateur IoT
    │
    ├──► Mosquitto (principal:1883)
    │       │
    │       ├──► Telegraf ──► InfluxDB (8086) ──► Grafana (3001)
    │       │
    │       ├──► Mainflux MQTT ──► Mainflux Broker (NATS) ──► Things/Users/Auth
    │       │
    │       └──► IoT-Agent FIWARE ──► Orion-LD (1026) ──► QuantumLeap ──► CrateDB
    │                                                              │
    │                                                              ▼
    │                                                           Grafana
    │
    ├──► EMQX (1883)
    │       │
    │       └──► Contexus MQTT Driver ──► Contexus Devices
    │
    └──► ChirpStack Mosquitto (1883)
            │
            └──► ChirpStack ──► ChirpStack REST API

OpenRemote Internal Artemis MQTT
    │
    └──► Agent MQTT ──► Assets (sensors) ──► Map Display
```

---

## ⚠️ Problèmes Connus (2026-05-23)

| Priorité | Problème | Impact |
|----------|----------|--------|
| 🔴 CRITIQUE | Simulator crash boucle (exit 137, 896 restarts) | Plus de données IoT |
| 🔴 CRITIQUE | OpenRemote Manager 502 | Pas de carte |
| 🟠 HAUTE | Telegraf restart boucle | Pas de données InfluxDB |
| 🟠 HAUTE | ThingsBoard executors instables | TB partiellement fonctionnel |
| 🟠 HAUTE | MapStore 502 via Traefik | Pas d'accès web |
| 🟡 MOYENNE | Contexus unhealthy | API fonctionnelle mais healthcheck KO |
| 🟡 MOYENNE | Stellio 4 services arrêtés | Search/Sub/Kafka/Postgres down |
| 🟡 MOYENNE | Ditto gateway UP mais pas de HTTP | API inaccessible |
| 🟡 MOYENNE | Bunkerm unhealthy | Monitoring down |
| 🔵 BASSE | Honcho API restartant | Mémoire/agentiel intermittent |
| 🔵 BASSE | Redpanda console restart | Console indisponible |

---

## 📝 Snapshots & Restauration

### Créer un snapshot
```bash
# État des containers
docker ps -a --format "table {{.Names}}\t{{.Image}}\t{{.Status}}" > snapshots/DATE/containers-state.txt

# Sauvegarder les images d'une stack
docker save -o snapshots/DATE/simulator.tar smart-city-digital-twin-martinique-simulator
docker save -o snapshots/DATE/openremote-manager.tar openremote/manager

# Sauvegarder les volumes
docker run --rm -v smart-city_simulator_data:/data -v $(pwd)/snapshots/DATE:/backup alpine tar czf /backup/simulator-data.tar.gz -C /data .
```

### Restaurer un snapshot
```bash
# Restaurer une image
docker load -i snapshots/DATE/simulator.tar

# Redémarrer une stack
docker-compose up -d --force-recreate simulator

# Restaurer un volume
docker run --rm -v smart-city_simulator_data:/data -v $(pwd)/snapshots/DATE:/backup alpine tar xzf /backup/simulator-data.tar.gz -C /data
```

### Stables stacks à snapshoter en priorité
1. **smart-city-core** (simulator, telegraf, influxdb)
2. **openremote** (manager, keycloak, artemis, postgres)
3. **mapstore** (proxy, app, postgres)
4. **geoserver** (geoserver, postgis)
5. **mainflux** (ensemble de la stack)
