# yashu123403/iot-telemetry-embedded-linux-gateway architecture

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

- Interactive diagram: https://gitdiagram.com/yashu123403/iot-telemetry-embedded-linux-gateway
- Repository: https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway

## Overview

This is a laptop-runnable IoT telemetry and embedded-gateway simulation. Configured sensor nodes generate synthetic scalar or GPS readings, publish telemetry and heartbeats over MQTT, and receive remote commands. Gateway ingestion validates messages and buffers them; gateway processing aggregates readings, evaluates rules, tracks device heartbeats, and persists telemetry and alerts. Operators monitor status through terminal or web dashboards. The README documents these capabilities; source excerpts do not show every internal call, so unsampled relationships are omitted.

Main entry points: [`src/gateway/gateway_app.py`](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/gateway_app.py) (Gateway process), [`dashboard/rest_api.py`](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/dashboard/rest_api.py) (Web dashboard API), [`src/gateway/ingestion.py`](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/ingestion.py) (Ingestion service), [`src/main.py`](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/main.py) (Runtime entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensors["Simulated devices"]
  node_fleet["Fleet factory<br/>[fleet_factory.py]"]
  node_sensor["Scalar sensors<br/>[scalar_sensors.py]"]
  node_gps["GPS sensor<br/>[gps_sensor.py]"]
  node_faults["Fault injection<br/>[fault_injector.py]"]
  node_node["Sensor node<br/>[sensor_node.py]"]
end

subgraph group_transport["MQTT transport"]
  node_schemas["Wire schemas<br/>[schemas.py]"]
  node_topics["MQTT topics<br/>[topics.py]"]
  node_mqtt["MQTT client"]
  node_broker["Embedded broker<br/>[embedded_broker.py]"]
end

subgraph group_gateway["Gateway processing"]
  node_ingestion["Ingestion service<br/>[ingestion.py]"]
  node_buffer["Bounded buffers<br/>[buffer.py]"]
  node_app["Gateway process<br/>[gateway_app.py]"]
  node_rules["Rule engine<br/>[rule_engine.py]"]
  node_aggregator["Window aggregation<br/>[aggregator.py]"]
  node_registry["Device registry<br/>[device_registry.py]"]
  node_storage[("SQLite storage<br/>[storage.py]")]
  node_monitor["System monitor<br/>[system_monitor.py]"]
end

subgraph group_interfaces["Monitoring interfaces"]
  node_main["Runtime entry<br/>[main.py]"]
  node_web["Web dashboard API<br/>[rest_api.py]"]
  node_cli["Terminal dashboard<br/>[cli_dashboard.py]"]
end

node_operator(("Operator"))
node_mqtt_service(("MQTT broker"))

node_main -->|"starts"| node_broker
node_main -->|"starts"| node_app
node_main -->|"builds fleet"| node_fleet
node_main -->|"starts"| node_web
node_main -->|"selects"| node_cli
node_fleet -->|"constructs"| node_sensor
node_fleet -->|"constructs"| node_gps
node_fleet -->|"configures"| node_faults
node_fleet -->|"constructs"| node_node
node_sensor -->|"uses"| node_faults
node_gps -->|"uses"| node_faults
node_node -->|"creates messages"| node_schemas
node_node -->|"publishes on"| node_topics
node_node -->|"publishes through"| node_mqtt
node_mqtt -->|"connects"| node_mqtt_service
node_broker -->|"hosts"| node_mqtt_service
node_ingestion -->|"subscribes through"| node_mqtt
node_ingestion -->|"validates"| node_schemas
node_ingestion -->|"subscribes to"| node_topics
node_ingestion -->|"pushes messages"| node_buffer
node_app -->|"starts"| node_ingestion
node_app -->|"drains"| node_buffer
node_app -->|"evaluates readings"| node_rules
node_app -->|"adds samples"| node_aggregator
node_app -->|"records heartbeats"| node_registry
node_app -->|"persists results"| node_storage
node_app -->|"reports resources"| node_monitor
node_web -->|"reads status"| node_app
node_web -->|"reads devices"| node_registry
node_web -->|"reads recent data"| node_storage
node_web -->|"reads aggregates"| node_aggregator
node_web -->|"sends commands"| node_ingestion
node_cli -->|"displays status"| node_app
node_operator -->|"monitors"| node_web
node_operator -->|"monitors"| node_cli

click node_main "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/main.py"
click node_fleet "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/sensors/fleet_factory.py"
click node_sensor "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/sensors/scalar_sensors.py"
click node_gps "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/sensors/gps_sensor.py"
click node_faults "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/sensors/fault_injector.py"
click node_node "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/sensors/sensor_node.py"
click node_schemas "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/protocols/schemas.py"
click node_topics "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/protocols/topics.py"
click node_mqtt "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/protocols/mqtt_client_wrapper.py"
click node_broker "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/embedded_broker.py"
click node_ingestion "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/ingestion.py"
click node_buffer "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/buffer.py"
click node_app "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/gateway_app.py"
click node_rules "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/rule_engine.py"
click node_aggregator "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/aggregator.py"
click node_registry "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/device_registry.py"
click node_storage "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/storage.py"
click node_monitor "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/system_monitor.py"
click node_web "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/dashboard/rest_api.py"
click node_cli "https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/dashboard/cli_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_fleet,node_sensor,node_gps,node_faults,node_node toneBlue
class node_schemas,node_topics,node_mqtt,node_broker toneAmber
class node_ingestion,node_buffer,node_app,node_rules,node_aggregator,node_registry,node_storage,node_monitor toneMint
class node_main,node_web,node_cli toneRose
class node_operator,node_mqtt_service toneIndigo
```

## Components

### Simulated devices

- [Fleet factory](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/sensors/fleet_factory.py): `src/sensors/fleet_factory.py`
- [Scalar sensors](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/sensors/scalar_sensors.py): `src/sensors/scalar_sensors.py`
- [GPS sensor](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/sensors/gps_sensor.py): `src/sensors/gps_sensor.py`
- [Fault injection](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/sensors/fault_injector.py): `src/sensors/fault_injector.py`
- [Sensor node](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/sensors/sensor_node.py): `src/sensors/sensor_node.py`

### MQTT transport

- [Wire schemas](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/protocols/schemas.py): `src/protocols/schemas.py`
- [MQTT topics](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/protocols/topics.py): `src/protocols/topics.py`
- [MQTT client](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/protocols/mqtt_client_wrapper.py): `src/protocols/mqtt_client_wrapper.py`
- [Embedded broker](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/embedded_broker.py): `src/gateway/embedded_broker.py`

### Gateway processing

- [Ingestion service](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/ingestion.py): `src/gateway/ingestion.py`
- [Bounded buffers](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/buffer.py): `src/gateway/buffer.py`
- [Gateway process](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/gateway_app.py): `src/gateway/gateway_app.py`
- [Rule engine](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/rule_engine.py): `src/gateway/rule_engine.py`
- [Window aggregation](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/aggregator.py): `src/gateway/aggregator.py`
- [Device registry](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/device_registry.py): `src/gateway/device_registry.py`
- [SQLite storage](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/storage.py): `src/gateway/storage.py`
- [System monitor](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/gateway/system_monitor.py): `src/gateway/system_monitor.py`

### Monitoring interfaces

- [Runtime entry](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/src/main.py): `src/main.py`
- [Web dashboard API](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/dashboard/rest_api.py): `dashboard/rest_api.py`
- [Terminal dashboard](https://github.com/yashu123403/iot-telemetry-embedded-linux-gateway/blob/main/dashboard/cli_dashboard.py): `dashboard/cli_dashboard.py`

### Other components

- **Operator**
- **MQTT broker**

## Connections

- Runtime entry → Embedded broker: starts (evidence: `src/main.py`)
- Runtime entry → Gateway process: starts (evidence: `src/main.py`)
- Runtime entry → Fleet factory: builds fleet (evidence: `src/main.py`)
- Runtime entry → Web dashboard API: starts (evidence: `src/main.py`)
- Runtime entry → Terminal dashboard: selects (evidence: `README.md`)
- Fleet factory → Scalar sensors: constructs (evidence: `src/sensors/fleet_factory.py`)
- Fleet factory → GPS sensor: constructs (evidence: `src/sensors/fleet_factory.py`)
- Fleet factory → Fault injection: configures (evidence: `src/sensors/fleet_factory.py`)
- Fleet factory → Sensor node: constructs (evidence: `src/sensors/fleet_factory.py`)
- Scalar sensors → Fault injection: uses
- GPS sensor → Fault injection: uses (evidence: `src/sensors/gps_sensor.py`)
- Sensor node → Wire schemas: creates messages (evidence: `src/sensors/sensor_node.py`)
- Sensor node → MQTT topics: publishes on (evidence: `src/sensors/sensor_node.py`)
- Sensor node → MQTT client: publishes through (evidence: `src/sensors/sensor_node.py`)
- MQTT client → MQTT broker: connects (evidence: `README.md`)
- Embedded broker → MQTT broker: hosts (evidence: `README.md`)
- Ingestion service → MQTT client: subscribes through (evidence: `src/gateway/ingestion.py`)
- Ingestion service → Wire schemas: validates (evidence: `src/gateway/ingestion.py`)
- Ingestion service → MQTT topics: subscribes to (evidence: `src/gateway/ingestion.py`)
- Ingestion service → Bounded buffers: pushes messages (evidence: `src/gateway/ingestion.py`)
- Gateway process → Ingestion service: starts (evidence: `src/gateway/gateway_app.py`)
- Gateway process → Bounded buffers: drains (evidence: `src/gateway/gateway_app.py`)
- Gateway process → Rule engine: evaluates readings (evidence: `src/gateway/gateway_app.py`)
- Gateway process → Window aggregation: adds samples (evidence: `src/gateway/gateway_app.py`)
- Gateway process → Device registry: records heartbeats (evidence: `src/gateway/gateway_app.py`)
- Gateway process → SQLite storage: persists results (evidence: `src/gateway/gateway_app.py`)
- Gateway process → System monitor: reports resources (evidence: `src/gateway/gateway_app.py`)
- Web dashboard API → Gateway process: reads status (evidence: `dashboard/rest_api.py`)
- Web dashboard API → Device registry: reads devices (evidence: `dashboard/rest_api.py`)
- Web dashboard API → SQLite storage: reads recent data (evidence: `dashboard/rest_api.py`)
- Web dashboard API → Window aggregation: reads aggregates (evidence: `dashboard/rest_api.py`)
- Web dashboard API → Ingestion service: sends commands (evidence: `dashboard/rest_api.py`)
- Terminal dashboard → Gateway process: displays status (evidence: `dashboard/cli_dashboard.py`)
- Operator → Web dashboard API: monitors (evidence: `README.md`)
- Operator → Terminal dashboard: monitors (evidence: `README.md`)
