# willxxx7/mqtt-iot-demo architecture

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

- Interactive diagram: https://gitdiagram.com/willxxx7/mqtt-iot-demo
- Repository: https://github.com/willxxx7/mqtt-iot-demo

## Overview

This is a classroom teaching application, not a deployed real-time service: a learner chooses a terminal interface, follows lessons on MQTT, SSE and WebSockets, and can launch demonstrations, compare communication models, study security concepts and take a quiz. The main script contains the teaching flow and embedded demonstrations; sensor.py is a separate MQTT publisher. README material also describes a broker/subscriber sensor workflow, but the listed tree contains no monitor or separate demo modules, so those are not represented as repository components. Some lesson details are unsampled; documented capabilities are retained without assuming their internal wiring.

Main entry points: [`real_time_systems_teaching.py`](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py) (Guided lessons), [`sensor.py`](https://github.com/willxxx7/mqtt-iot-demo/blob/main/sensor.py) (Sensor publisher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_teaching["Teaching flow"]
  node_interface["Terminal interface"]
  node_lesson["Guided lessons"]
  node_demo_launcher["Demo launcher"]
end

subgraph group_mqtt["MQTT demonstration"]
  node_mqtt_sim["MQTT simulation"]
  node_sim_broker["In-process broker"]
  node_sensor["Sensor publisher<br/>[sensor.py]"]
  node_mqtt_broker(("MQTT broker"))
end

subgraph group_streaming["Streaming demos"]
  node_sse_demo["SSE dashboard"]
  node_ws_server["WebSocket server"]
  node_ws_client["WebSocket client"]
end

subgraph group_learning["Review and practice"]
  node_comparison["Model comparison"]
  node_security["Security concepts"]
  node_quiz["Practice quiz"]
end

node_learner(("Learner"))
node_browser(("Browser"))

node_learner -->|"chooses interface"| node_interface
node_interface -->|"starts teaching"| node_lesson
node_lesson -->|"offers demos"| node_demo_launcher
node_demo_launcher -->|"launches demo"| node_mqtt_sim
node_mqtt_sim -->|"publishes readings"| node_sim_broker
node_demo_launcher -->|"launches demo"| node_sse_demo
node_sse_demo -->|"streams events"| node_browser
node_demo_launcher -->|"launches demo"| node_ws_server
node_demo_launcher -->|"launches demo"| node_ws_client
node_ws_client -->|"exchanges messages"| node_ws_server
node_lesson -->|"presents models"| node_comparison
node_lesson -->|"teaches security"| node_security
node_lesson -->|"offers quiz"| node_quiz
node_sensor -->|"publishes readings"| node_mqtt_broker

click node_interface "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py"
click node_lesson "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py"
click node_demo_launcher "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py"
click node_mqtt_sim "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py"
click node_sim_broker "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py"
click node_sensor "https://github.com/willxxx7/mqtt-iot-demo/blob/main/sensor.py"
click node_sse_demo "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py"
click node_ws_server "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py"
click node_ws_client "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py"
click node_comparison "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py"
click node_security "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py"
click node_quiz "https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.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_interface,node_lesson,node_demo_launcher,node_browser toneBlue
class node_mqtt_sim,node_sim_broker,node_sensor,node_mqtt_broker toneAmber
class node_sse_demo,node_ws_server,node_ws_client toneMint
class node_comparison,node_security,node_quiz toneRose
class node_learner toneIndigo
```

## Components

### Teaching flow

- [Terminal interface](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`
- [Guided lessons](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`
- [Demo launcher](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`

### MQTT demonstration

- [MQTT simulation](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`
- [In-process broker](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`
- [Sensor publisher](https://github.com/willxxx7/mqtt-iot-demo/blob/main/sensor.py): `sensor.py`
- **MQTT broker**

### Streaming demos

- [SSE dashboard](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`
- [WebSocket server](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`
- [WebSocket client](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`

### Review and practice

- [Model comparison](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`
- [Security concepts](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`
- [Practice quiz](https://github.com/willxxx7/mqtt-iot-demo/blob/main/real_time_systems_teaching.py): `real_time_systems_teaching.py`

### Other components

- **Learner**
- **Browser**

## Connections

- Learner → Terminal interface: chooses interface (evidence: `README.md`)
- Terminal interface → Guided lessons: starts teaching (evidence: `README.md`)
- Guided lessons → Demo launcher: offers demos (evidence: `README.md`)
- Demo launcher → MQTT simulation: launches demo (evidence: `real_time_systems_teaching.py`)
- MQTT simulation → In-process broker: publishes readings (evidence: `real_time_systems_teaching.py`)
- Demo launcher → SSE dashboard: launches demo (evidence: `README.md`)
- SSE dashboard → Browser: streams events (evidence: `real_time_systems_teaching.py`)
- Demo launcher → WebSocket server: launches demo (evidence: `README.md`)
- Demo launcher → WebSocket client: launches demo (evidence: `README.md`)
- WebSocket client → WebSocket server: exchanges messages (evidence: `real_time_systems_teaching.py`)
- Guided lessons → Model comparison: presents models (evidence: `real_time_systems_teaching.py`)
- Guided lessons → Security concepts: teaches security (evidence: `real_time_systems_teaching.py`)
- Guided lessons → Practice quiz: offers quiz (evidence: `real_time_systems_teaching.py`)
- Sensor publisher → MQTT broker: publishes readings (evidence: `sensor.py`)
