# hassaanas/tod architecture

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

- Interactive diagram: https://gitdiagram.com/hassaanas/tod
- Repository: https://github.com/hassaanas/tod

## Overview

This repository implements a Kubernetes-deployed tele-operated-driving testbed: control and telemetry messages use MQTT topics, with the edge broker acting as the hub for OBU and RDS. The principal documented path is a command routed through brokers to the site microservices, with responses/telemetry returning through MQTT; the README does not specify which service handles each topic, so those links are left unverified. Direction, cruise, speed, cloud deployment, and Prometheus are represented. Service nodes stand for deployments repeated across the four clusters; only the edge-to-remote bridge relationship is explicitly documented.

Main entry points: [`edge-node/broker`](https://github.com/hassaanas/tod/tree/main/edge-node/broker) (Edge MQTT hub), [`edge-node/ms-direction`](https://github.com/hassaanas/tod/tree/main/edge-node/ms-direction) (Direction service), [`edge-node/ms-cruise`](https://github.com/hassaanas/tod/tree/main/edge-node/ms-cruise) (Cruise service), [`edge-node/ms-speed`](https://github.com/hassaanas/tod/tree/main/edge-node/ms-speed) (Speed service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sites["Site Brokers"]
  node_edge_broker["Edge MQTT hub"]
  node_obu_broker["OBU broker"]
  node_rds_broker["RDS broker"]
  node_cloud_broker["Cloud broker"]
end

subgraph group_services["Driving Services"]
  node_direction["Direction service"]
  node_cruise["Cruise service"]
  node_speed["Speed service"]
end

subgraph group_monitoring["Monitoring"]
  node_prometheus["Prometheus"]
end

subgraph group_experiments["MQTT Experiments"]
  node_timestamp_pub["Timestamp publisher<br/>[pub-timestamp.py]"]
  node_timestamp_sub["Timestamp subscriber<br/>[sub-timestamp.py]"]
  node_direction_logger["Direction logger"]
  node_speed_logger["Speed logger<br/>[amf-sub-speed-2.py]"]
  node_mqtt_logger["MQTT logger<br/>[amf-sub.py]"]
  node_stress_tool["Pod stress tool<br/>[mem-cpu-stress.py]"]
end

node_operator(("Control client"))

node_operator -.->|"publishes commands"| node_edge_broker
node_edge_broker -->|"bridges set/get topics"| node_obu_broker
node_edge_broker -->|"bridges get/set topics"| node_rds_broker
node_direction -.->|"uses MQTT"| node_edge_broker
node_cruise -.->|"uses MQTT"| node_edge_broker
node_speed -.->|"uses MQTT"| node_edge_broker
node_timestamp_pub -.->|"publishes timestamps"| node_edge_broker
node_timestamp_sub -.->|"subscribes to topic"| node_edge_broker
node_direction_logger -.->|"subscribes to topic"| node_edge_broker
node_speed_logger -.->|"subscribes to topic"| node_edge_broker
node_mqtt_logger -.->|"subscribes to topic"| node_edge_broker

click node_edge_broker "https://github.com/hassaanas/tod/tree/main/edge-node/broker"
click node_obu_broker "https://github.com/hassaanas/tod/tree/main/obu-node/broker"
click node_rds_broker "https://github.com/hassaanas/tod/tree/main/rds-node/broker"
click node_cloud_broker "https://github.com/hassaanas/tod/tree/main/cloud-node/broker"
click node_direction "https://github.com/hassaanas/tod/tree/main/edge-node/ms-direction"
click node_cruise "https://github.com/hassaanas/tod/tree/main/edge-node/ms-cruise"
click node_speed "https://github.com/hassaanas/tod/tree/main/edge-node/ms-speed"
click node_prometheus "https://github.com/hassaanas/tod/blob/main/prometheus/deployment-prometheus-v2.yaml"
click node_timestamp_pub "https://github.com/hassaanas/tod/blob/main/tod-code/experiments/pub-timestamp.py"
click node_timestamp_sub "https://github.com/hassaanas/tod/blob/main/tod-code/experiments/sub-timestamp.py"
click node_direction_logger "https://github.com/hassaanas/tod/blob/main/tod-code/experiments/amf-sub-direction.py"
click node_speed_logger "https://github.com/hassaanas/tod/blob/main/tod-code/experiments/amf-sub-speed-2.py"
click node_mqtt_logger "https://github.com/hassaanas/tod/blob/main/tod-code/experiments/amf-sub.py"
click node_stress_tool "https://github.com/hassaanas/tod/blob/main/tod-code/experiments/mem-cpu-stress.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_edge_broker,node_obu_broker,node_rds_broker,node_cloud_broker,node_operator toneBlue
class node_direction,node_cruise,node_speed toneAmber
class node_prometheus toneMint
class node_timestamp_pub,node_timestamp_sub,node_direction_logger,node_speed_logger,node_mqtt_logger,node_stress_tool toneRose
```

## Components

### Site Brokers

- [Edge MQTT hub](https://github.com/hassaanas/tod/tree/main/edge-node/broker): `edge-node/broker`
- [OBU broker](https://github.com/hassaanas/tod/tree/main/obu-node/broker): `obu-node/broker`
- [RDS broker](https://github.com/hassaanas/tod/tree/main/rds-node/broker): `rds-node/broker`
- [Cloud broker](https://github.com/hassaanas/tod/tree/main/cloud-node/broker): `cloud-node/broker`

### Driving Services

- [Direction service](https://github.com/hassaanas/tod/tree/main/edge-node/ms-direction): `edge-node/ms-direction`
- [Cruise service](https://github.com/hassaanas/tod/tree/main/edge-node/ms-cruise): `edge-node/ms-cruise`
- [Speed service](https://github.com/hassaanas/tod/tree/main/edge-node/ms-speed): `edge-node/ms-speed`

### Monitoring

- [Prometheus](https://github.com/hassaanas/tod/blob/main/prometheus/deployment-prometheus-v2.yaml): `prometheus/deployment-prometheus-v2.yaml`

### MQTT Experiments

- [Timestamp publisher](https://github.com/hassaanas/tod/blob/main/tod-code/experiments/pub-timestamp.py): `tod-code/experiments/pub-timestamp.py`
- [Timestamp subscriber](https://github.com/hassaanas/tod/blob/main/tod-code/experiments/sub-timestamp.py): `tod-code/experiments/sub-timestamp.py`
- [Direction logger](https://github.com/hassaanas/tod/blob/main/tod-code/experiments/amf-sub-direction.py): `tod-code/experiments/amf-sub-direction.py`
- [Speed logger](https://github.com/hassaanas/tod/blob/main/tod-code/experiments/amf-sub-speed-2.py): `tod-code/experiments/amf-sub-speed-2.py`
- [MQTT logger](https://github.com/hassaanas/tod/blob/main/tod-code/experiments/amf-sub.py): `tod-code/experiments/amf-sub.py`
- [Pod stress tool](https://github.com/hassaanas/tod/blob/main/tod-code/experiments/mem-cpu-stress.py): `tod-code/experiments/mem-cpu-stress.py`

### Other components

- **Control client**

## Connections

- Control client → Edge MQTT hub: publishes commands (evidence: `README.md`)
- Edge MQTT hub → OBU broker: bridges set/get topics (evidence: `README.md`)
- Edge MQTT hub → RDS broker: bridges get/set topics (evidence: `README.md`)
- Direction service → Edge MQTT hub: uses MQTT (evidence: `README.md`)
- Cruise service → Edge MQTT hub: uses MQTT (evidence: `README.md`)
- Speed service → Edge MQTT hub: uses MQTT (evidence: `README.md`)
- Timestamp publisher → Edge MQTT hub: publishes timestamps
- Timestamp subscriber → Edge MQTT hub: subscribes to topic
- Direction logger → Edge MQTT hub: subscribes to topic
- Speed logger → Edge MQTT hub: subscribes to topic
- MQTT logger → Edge MQTT hub: subscribes to topic
