# mrcyme/uhi-fiware-poc architecture

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

- Interactive diagram: https://gitdiagram.com/mrcyme/uhi-fiware-poc
- Repository: https://github.com/mrcyme/uhi-fiware-poc

## Overview

This is a FIWARE-based Brussels Urban Heat Island monitoring platform. Its main workflow downloads RGB/NIR orthophotos, builds optimized rasters and NDVI/NDWI indices, registers layers in Orion-LD, then uses Orion-triggered services to generate a heat-risk map and publish layers to GeoServer for the Cesium viewer. The graph also shows the frontend’s layer controls and core raster-processing helpers. Service-to-service event flows and several unsampled services are based on the README; source excerpts confirm ingestion calls and frontend composition, but do not expose prediction or sync internals.

Main entry points: [`services/ingestion/main.py`](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/main.py) (Ingestion API), [`services/prediction/main.py`](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/prediction/main.py) (Heat Prediction), [`services/frontend/src/components/CesiumViewer.vue`](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/frontend/src/components/CesiumViewer.vue) (Cesium Globe), [`services/ingestion/processors/cog.py`](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/processors/cog.py) (COG Utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Raster Ingestion"]
  node_ingest_api["Ingestion API<br/>[main.py]"]
  node_index_calc["Index Calculators<br/>[ndvi.py]"]
  node_cog["COG Utilities<br/>[cog.py]"]
  node_ndwi["NDWI Calculator<br/>[ndwi.py]"]
end

subgraph group_broker["Context Backbone"]
  node_orion_client["Orion Client<br/>[client.py]"]
  node_orion["Orion-LD Broker"]
  node_mongo[("MongoDB")]
end

subgraph group_publish["Prediction &amp; Publishing"]
  node_prediction["Heat Prediction<br/>[main.py]"]
  node_sync["GeoServer Sync<br/>[main.py]"]
  node_geoserver["GeoServer WMS"]
end

subgraph group_viewer["Web Viewer"]
  node_app["Viewer App<br/>[App.vue]"]
  node_controls["Layer Controls<br/>[LayerControls.vue]"]
  node_cesium["Cesium Globe<br/>[CesiumViewer.vue]"]
end

node_imagery["RGB/NIR Imagery"]
node_user(("Viewer User"))
node_osm["OpenStreetMap"]

node_imagery -->|"provides imagery"| node_ingest_api
node_ingest_api -->|"calls NDVI"| node_index_calc
node_ingest_api -->|"calls NDWI"| node_ndwi
node_ingest_api -->|"builds overviews"| node_cog
node_index_calc -->|"uses COG helpers"| node_cog
node_ndwi -->|"uses COG helpers"| node_cog
node_ingest_api -->|"registers layers"| node_orion_client
node_orion_client -->|"creates entities"| node_orion
node_mongo -->|"stores broker data"| node_orion
node_orion -->|"notifies changes"| node_prediction
node_prediction -->|"queries inputs"| node_orion
node_prediction -->|"registers heat map"| node_orion
node_orion -->|"notifies publish"| node_sync
node_sync -->|"publishes layers"| node_geoserver
node_user -->|"selects layers"| node_controls
node_controls -->|"emits layer changes"| node_app
node_app -->|"passes layer state"| node_cesium
node_cesium -->|"requests WMS maps"| node_geoserver
node_cesium -->|"loads basemap tiles"| node_osm

click node_ingest_api "https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/main.py"
click node_index_calc "https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/processors/ndvi.py"
click node_cog "https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/processors/cog.py"
click node_ndwi "https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/processors/ndwi.py"
click node_orion_client "https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/fiware/client.py"
click node_prediction "https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/prediction/main.py"
click node_sync "https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/geoserver-sync/main.py"
click node_app "https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/frontend/src/App.vue"
click node_controls "https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/frontend/src/components/LayerControls.vue"
click node_cesium "https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/frontend/src/components/CesiumViewer.vue"

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_ingest_api,node_index_calc,node_cog,node_ndwi,node_user toneBlue
class node_orion_client,node_orion,node_mongo toneAmber
class node_prediction,node_sync,node_geoserver toneMint
class node_app,node_controls,node_cesium toneRose
class node_imagery,node_osm toneIndigo
```

## Components

### Raster Ingestion

- [Ingestion API](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/main.py): `services/ingestion/main.py`
- [Index Calculators](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/processors/ndvi.py): `services/ingestion/processors/ndvi.py`
- [COG Utilities](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/processors/cog.py): `services/ingestion/processors/cog.py`
- [NDWI Calculator](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/processors/ndwi.py): `services/ingestion/processors/ndwi.py`

### Context Backbone

- [Orion Client](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/ingestion/fiware/client.py): `services/ingestion/fiware/client.py`
- **Orion-LD Broker**
- **MongoDB**

### Prediction & Publishing

- [Heat Prediction](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/prediction/main.py): `services/prediction/main.py`
- [GeoServer Sync](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/geoserver-sync/main.py): `services/geoserver-sync/main.py`
- **GeoServer WMS**

### Web Viewer

- [Viewer App](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/frontend/src/App.vue): `services/frontend/src/App.vue`
- [Layer Controls](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/frontend/src/components/LayerControls.vue): `services/frontend/src/components/LayerControls.vue`
- [Cesium Globe](https://github.com/mrcyme/uhi-fiware-poc/blob/main/services/frontend/src/components/CesiumViewer.vue): `services/frontend/src/components/CesiumViewer.vue`

### Other components

- **RGB/NIR Imagery**
- **Viewer User**
- **OpenStreetMap**

## Connections

- RGB/NIR Imagery → Ingestion API: provides imagery (evidence: `README.md`)
- Ingestion API → Index Calculators: calls NDVI (evidence: `services/ingestion/main.py`)
- Ingestion API → NDWI Calculator: calls NDWI (evidence: `services/ingestion/main.py`)
- Ingestion API → COG Utilities: builds overviews (evidence: `services/ingestion/main.py`)
- Index Calculators → COG Utilities: uses COG helpers (evidence: `services/ingestion/processors/ndvi.py`)
- NDWI Calculator → COG Utilities: uses COG helpers (evidence: `services/ingestion/processors/ndwi.py`)
- Ingestion API → Orion Client: registers layers (evidence: `services/ingestion/main.py`)
- Orion Client → Orion-LD Broker: creates entities (evidence: `services/ingestion/fiware/client.py`)
- MongoDB → Orion-LD Broker: stores broker data (evidence: `README.md`)
- Orion-LD Broker → Heat Prediction: notifies changes (evidence: `README.md`)
- Heat Prediction → Orion-LD Broker: queries inputs (evidence: `README.md`)
- Heat Prediction → Orion-LD Broker: registers heat map (evidence: `README.md`)
- Orion-LD Broker → GeoServer Sync: notifies publish (evidence: `README.md`)
- GeoServer Sync → GeoServer WMS: publishes layers (evidence: `README.md`)
- Viewer User → Layer Controls: selects layers (evidence: `README.md`)
- Layer Controls → Viewer App: emits layer changes (evidence: `services/frontend/src/App.vue`)
- Viewer App → Cesium Globe: passes layer state (evidence: `services/frontend/src/App.vue`)
- Cesium Globe → GeoServer WMS: requests WMS maps (evidence: `services/frontend/src/components/CesiumViewer.vue`)
- Cesium Globe → OpenStreetMap: loads basemap tiles (evidence: `services/frontend/src/components/CesiumViewer.vue`)
