# alan910102/esp32-door-system architecture

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

- Interactive diagram: https://gitdiagram.com/alan910102/esp32-door-system
- Repository: https://github.com/alan910102/esp32-door-system

## Overview

This is an IoT door-control system: users operate doors through a Node-RED dashboard, MQTT carries commands to ESP32 firmware, and GPIO signals trigger modified remote-control hardware. The documented return path reports device status for monitoring. The repository contains the firmware and exported Node-RED flows; broker, server deployment, and the original door system are described in the README but have no implementation files in the supplied tree. Relationships below follow the README because no source excerpts were provided.

Main entry points: [`nodered-flows/flows.json`](https://github.com/alan910102/esp32-door-system/blob/main/nodered-flows/flows.json) (Web Control), [`esp32-firmware/sketch_aug7a.ino`](https://github.com/alan910102/esp32-door-system/blob/main/esp32-firmware/sketch_aug7a.ino) (Command Handling), [`docs/改裝遙控器實體照`](https://github.com/alan910102/esp32-door-system/tree/main/docs/%E6%94%B9%E8%A3%9D%E9%81%99%E6%8E%A7%E5%99%A8%E5%AF%A6%E9%AB%94%E7%85%A7) (Modified Remote)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_ui["Web Control<br/>[flows.json]"]
  node_status_monitor["Status Monitor<br/>[flows.json]"]
end

subgraph group_messaging["Messaging"]
  node_mqtt_broker["MQTT Broker"]
end

subgraph group_device["Device Control"]
  node_firmware_commands["Command Handling<br/>[sketch_aug7a.ino]"]
  node_firmware_status["Heartbeat &amp; Reconnect<br/>[sketch_aug7a.ino]"]
  node_gpio_control["GPIO Control<br/>[sketch_aug7a.ino]"]
end

subgraph group_hardware["Hardware"]
  node_remote_hardware["Modified Remote"]
  node_door_system["Door System"]
end

node_user(("User"))

node_user -->|"controls"| node_dashboard_ui
node_dashboard_ui -->|"publishes commands"| node_mqtt_broker
node_mqtt_broker -->|"routes commands"| node_firmware_commands
node_firmware_commands -->|"triggers GPIO"| node_gpio_control
node_gpio_control -->|"signals"| node_remote_hardware
node_remote_hardware -->|"controls"| node_door_system
node_firmware_status -->|"publishes status"| node_mqtt_broker
node_mqtt_broker -->|"forwards status"| node_status_monitor

click node_dashboard_ui "https://github.com/alan910102/esp32-door-system/blob/main/nodered-flows/flows.json"
click node_status_monitor "https://github.com/alan910102/esp32-door-system/blob/main/nodered-flows/flows.json"
click node_firmware_commands "https://github.com/alan910102/esp32-door-system/blob/main/esp32-firmware/sketch_aug7a.ino"
click node_firmware_status "https://github.com/alan910102/esp32-door-system/blob/main/esp32-firmware/sketch_aug7a.ino"
click node_gpio_control "https://github.com/alan910102/esp32-door-system/blob/main/esp32-firmware/sketch_aug7a.ino"
click node_remote_hardware "https://github.com/alan910102/esp32-door-system/tree/main/docs/%E6%94%B9%E8%A3%9D%E9%81%99%E6%8E%A7%E5%99%A8%E5%AF%A6%E9%AB%94%E7%85%A7"

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_dashboard_ui,node_status_monitor,node_user toneBlue
class node_mqtt_broker toneAmber
class node_firmware_commands,node_firmware_status,node_gpio_control toneMint
class node_remote_hardware,node_door_system toneRose
```

## Components

### Dashboard

- [Web Control](https://github.com/alan910102/esp32-door-system/blob/main/nodered-flows/flows.json): `nodered-flows/flows.json`
- [Status Monitor](https://github.com/alan910102/esp32-door-system/blob/main/nodered-flows/flows.json): `nodered-flows/flows.json`

### Messaging

- **MQTT Broker**

### Device Control

- [Command Handling](https://github.com/alan910102/esp32-door-system/blob/main/esp32-firmware/sketch_aug7a.ino): `esp32-firmware/sketch_aug7a.ino`
- [Heartbeat & Reconnect](https://github.com/alan910102/esp32-door-system/blob/main/esp32-firmware/sketch_aug7a.ino): `esp32-firmware/sketch_aug7a.ino`
- [GPIO Control](https://github.com/alan910102/esp32-door-system/blob/main/esp32-firmware/sketch_aug7a.ino): `esp32-firmware/sketch_aug7a.ino`

### Hardware

- [Modified Remote](https://github.com/alan910102/esp32-door-system/tree/main/docs/%E6%94%B9%E8%A3%9D%E9%81%99%E6%8E%A7%E5%99%A8%E5%AF%A6%E9%AB%94%E7%85%A7): `docs/改裝遙控器實體照`
- **Door System**

### Other components

- **User**

## Connections

- User → Web Control: controls (evidence: `README.md`)
- Web Control → MQTT Broker: publishes commands (evidence: `README.md`)
- MQTT Broker → Command Handling: routes commands (evidence: `README.md`)
- Command Handling → GPIO Control: triggers GPIO (evidence: `README.md`)
- GPIO Control → Modified Remote: signals (evidence: `README.md`)
- Modified Remote → Door System: controls (evidence: `README.md`)
- Heartbeat & Reconnect → MQTT Broker: publishes status (evidence: `README.md`)
- MQTT Broker → Status Monitor: forwards status (evidence: `README.md`)
