# fabiocabrini/fiware architecture

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

- Interactive diagram: https://gitdiagram.com/fabiocabrini/fiware
- Repository: https://github.com/fabiocabrini/fiware

## Overview

FIWARE Descomplicado packages a Docker-based FIWARE IoT stack, with a Smart Lamp example and historical-data viewers. The principal workflow is device telemetry and commands through MQTT/IoT integration into context and historical services, followed by dashboard retrieval and display. The README excerpt documents the principal FIWARE enablers, but the deployment files and firmware were not sampled; their detailed wiring is therefore not asserted. Dashed links mark that unverified integration.

Main entry points: [`docker-compose.yml`](https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml) (Docker stack), [`mosquitto/mosquitto.conf`](https://github.com/fabiocabrini/fiware/blob/main/mosquitto/mosquitto.conf) (Mosquitto broker), [`api-sth.py`](https://github.com/fabiocabrini/fiware/blob/main/api-sth.py) (STH data fetch), [`matplotlib_dashboard.py`](https://github.com/fabiocabrini/fiware/blob/main/matplotlib_dashboard.py) (Plot dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_stack["FIWARE stack"]
  node_deployment["Docker stack<br/>[docker-compose.yml]"]
  node_draco["Draco stack"]
  node_orion["Orion broker<br/>[docker-compose.yml]"]
  node_iotagent["MQTT IoT Agent<br/>[docker-compose.yml]"]
  node_mosquitto["Mosquitto broker<br/>[mosquitto.conf]"]
  node_mongodb[("MongoDB<br/>[docker-compose.yml]")]
end

subgraph group_device["Lamp devices"]
  node_lamp["ESP32 lamp"]
  node_mocklamp["Lamp simulator"]
end

subgraph group_history["History and dashboards"]
  node_sth["STH-Comet<br/>[docker-compose.yml]"]
  node_sthapi["STH data fetch<br/>[api-sth.py]"]
  node_dash["Live dashboard<br/>[api-sth.py]"]
  node_matdash["Plot dashboard"]
end

node_operator(("Operator"))
node_user(("Dashboard user"))

node_operator -.->|"starts stack"| node_deployment
node_deployment -.->|"configures"| node_orion
node_deployment -.->|"configures"| node_iotagent
node_deployment -.->|"configures"| node_mosquitto
node_deployment -.->|"configures"| node_mongodb
node_deployment -.->|"configures"| node_sth
node_draco -.->|"extends"| node_deployment
node_lamp -.->|"publishes telemetry"| node_mosquitto
node_mocklamp -.->|"publishes telemetry"| node_mosquitto
node_mosquitto -.->|"routes MQTT"| node_iotagent
node_iotagent -.->|"updates context"| node_orion
node_orion -.->|"stores history"| node_sth
node_sthapi -->|"fetches history"| node_sth
node_dash -->|"requests data"| node_sthapi
node_matdash -->|"fetches history"| node_sth
node_user -.->|"views data"| node_dash
node_user -.->|"views plot"| node_matdash

click node_deployment "https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml"
click node_draco "https://github.com/fabiocabrini/fiware/blob/main/docker-compose-draco.yaml"
click node_orion "https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml"
click node_iotagent "https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml"
click node_mosquitto "https://github.com/fabiocabrini/fiware/blob/main/mosquitto/mosquitto.conf"
click node_mongodb "https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml"
click node_sth "https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml"
click node_lamp "https://github.com/fabiocabrini/fiware/blob/main/fiware_ngsi_mqtt_esp32.ino"
click node_mocklamp "https://github.com/fabiocabrini/fiware/blob/main/esp32_mockup_SmartLamp.py"
click node_sthapi "https://github.com/fabiocabrini/fiware/blob/main/api-sth.py"
click node_dash "https://github.com/fabiocabrini/fiware/blob/main/api-sth.py"
click node_matdash "https://github.com/fabiocabrini/fiware/blob/main/matplotlib_dashboard.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_deployment,node_draco,node_orion,node_iotagent,node_mosquitto,node_mongodb,node_user toneBlue
class node_lamp,node_mocklamp toneAmber
class node_sth,node_sthapi,node_dash,node_matdash toneMint
class node_operator toneIndigo
```

## Components

### FIWARE stack

- [Docker stack](https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml): `docker-compose.yml`
- [Draco stack](https://github.com/fabiocabrini/fiware/blob/main/docker-compose-draco.yaml): `docker-compose-draco.yaml`
- [Orion broker](https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml): `docker-compose.yml`
- [MQTT IoT Agent](https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml): `docker-compose.yml`
- [Mosquitto broker](https://github.com/fabiocabrini/fiware/blob/main/mosquitto/mosquitto.conf): `mosquitto/mosquitto.conf`
- [MongoDB](https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml): `docker-compose.yml`

### Lamp devices

- [ESP32 lamp](https://github.com/fabiocabrini/fiware/blob/main/fiware_ngsi_mqtt_esp32.ino): `fiware_ngsi_mqtt_esp32.ino`
- [Lamp simulator](https://github.com/fabiocabrini/fiware/blob/main/esp32_mockup_SmartLamp.py): `esp32_mockup_SmartLamp.py`

### History and dashboards

- [STH-Comet](https://github.com/fabiocabrini/fiware/blob/main/docker-compose.yml): `docker-compose.yml`
- [STH data fetch](https://github.com/fabiocabrini/fiware/blob/main/api-sth.py): `api-sth.py`
- [Live dashboard](https://github.com/fabiocabrini/fiware/blob/main/api-sth.py): `api-sth.py`
- [Plot dashboard](https://github.com/fabiocabrini/fiware/blob/main/matplotlib_dashboard.py): `matplotlib_dashboard.py`

### Other components

- **Operator**
- **Dashboard user**

## Connections

- Operator → Docker stack: starts stack
- Docker stack → Orion broker: configures
- Docker stack → MQTT IoT Agent: configures
- Docker stack → Mosquitto broker: configures
- Docker stack → MongoDB: configures
- Docker stack → STH-Comet: configures
- Draco stack → Docker stack: extends
- ESP32 lamp → Mosquitto broker: publishes telemetry
- Lamp simulator → Mosquitto broker: publishes telemetry
- Mosquitto broker → MQTT IoT Agent: routes MQTT
- MQTT IoT Agent → Orion broker: updates context
- Orion broker → STH-Comet: stores history
- STH data fetch → STH-Comet: fetches history (evidence: `api-sth.py`)
- Live dashboard → STH data fetch: requests data (evidence: `api-sth.py`)
- Plot dashboard → STH-Comet: fetches history (evidence: `matplotlib_dashboard.py`)
- Dashboard user → Live dashboard: views data
- Dashboard user → Plot dashboard: views plot
