# gubernavit/guberlab-sistemadecontrole architecture

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

- Interactive diagram: https://gitdiagram.com/gubernavit/guberlab-sistemadecontrole
- Repository: https://github.com/gubernavit/guberlab-sistemadecontrole

## Overview

GUBER-LAB is a browser dashboard and ESP32 relay controller. Users authenticate, operate and monitor eight relays, while the dashboard also supports access levels, action history, scheduled/event-chain automations, channel naming, and daily email reports. MQTT carries commands and status between dashboard and firmware; the ESP32 also supports physical button control and WiFi setup/recovery. Firebase provides authentication and history storage, and EmailJS sends reports. Relationships shown here are documented in the README; source excerpts were not provided.

Main entry points: [`public/index.html`](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html) (Relay dashboard), [`guberlab_firmware/guberlab_firmware.ino`](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/guberlab_firmware/guberlab_firmware.ino) (ESP32 controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Web dashboard"]
  node_dashboard["Relay dashboard<br/>[index.html]"]
  node_access["Roles and demo<br/>[index.html]"]
  node_relay_ui["Relay controls<br/>[index.html]"]
  node_history["Action history<br/>[index.html]"]
  node_automation["Automations<br/>[index.html]"]
  node_channels["Channel names<br/>[index.html]"]
  node_report["Daily report<br/>[index.html]"]
end

subgraph group_services["Cloud services"]
  node_firebase[("Firebase Auth and DB")]
  node_emailjs["EmailJS"]
  node_broker["HiveMQ broker"]
end

subgraph group_device["ESP32 firmware"]
  node_firmware["ESP32 controller"]
  node_wifi_setup["WiFi and AP setup"]
end

subgraph group_hardware["Relay hardware"]
  node_button(("Physical button"))
  node_relays["Eight relays"]
  node_feedback["LED and buzzer"]
end

node_user(("Dashboard user"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"provides"| node_access
node_dashboard -->|"provides"| node_relay_ui
node_dashboard -->|"records actions"| node_history
node_dashboard -->|"configures"| node_automation
node_dashboard -->|"renames"| node_channels
node_dashboard -->|"schedules"| node_report
node_dashboard -->|"authenticates and stores history"| node_firebase
node_dashboard -->|"publishes commands"| node_broker
node_broker -->|"delivers status"| node_dashboard
node_dashboard -->|"sends report"| node_emailjs
node_firmware -->|"subscribes and publishes"| node_broker
node_button -->|"controls channels"| node_firmware
node_firmware -->|"switches"| node_relays
node_firmware -->|"signals state"| node_feedback
node_firmware -->|"configures connectivity"| node_wifi_setup

click node_dashboard "https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html"
click node_access "https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html"
click node_relay_ui "https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html"
click node_history "https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html"
click node_automation "https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html"
click node_channels "https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html"
click node_report "https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html"
click node_firmware "https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/guberlab_firmware/guberlab_firmware.ino"
click node_wifi_setup "https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/guberlab_firmware/guberlab_firmware.ino"

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,node_access,node_relay_ui,node_history,node_automation,node_channels,node_report,node_user toneBlue
class node_firebase,node_emailjs,node_broker toneAmber
class node_firmware,node_wifi_setup toneMint
class node_button,node_relays,node_feedback toneRose
```

## Components

### Web dashboard

- [Relay dashboard](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html): `public/index.html`
- [Roles and demo](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html): `public/index.html`
- [Relay controls](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html): `public/index.html`
- [Action history](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html): `public/index.html`
- [Automations](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html): `public/index.html`
- [Channel names](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html): `public/index.html`
- [Daily report](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/public/index.html): `public/index.html`

### Cloud services

- **Firebase Auth and DB**
- **EmailJS**
- **HiveMQ broker**

### ESP32 firmware

- [ESP32 controller](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/guberlab_firmware/guberlab_firmware.ino): `guberlab_firmware/guberlab_firmware.ino`
- [WiFi and AP setup](https://github.com/gubernavit/guberlab-sistemadecontrole/blob/main/guberlab_firmware/guberlab_firmware.ino): `guberlab_firmware/guberlab_firmware.ino`

### Relay hardware

- **Physical button**
- **Eight relays**
- **LED and buzzer**

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Relay dashboard: uses (evidence: `README.md`)
- Relay dashboard → Roles and demo: provides (evidence: `README.md`)
- Relay dashboard → Relay controls: provides (evidence: `README.md`)
- Relay dashboard → Action history: records actions (evidence: `README.md`)
- Relay dashboard → Automations: configures (evidence: `README.md`)
- Relay dashboard → Channel names: renames (evidence: `README.md`)
- Relay dashboard → Daily report: schedules (evidence: `README.md`)
- Relay dashboard → Firebase Auth and DB: authenticates and stores history (evidence: `README.md`)
- Relay dashboard → HiveMQ broker: publishes commands (evidence: `README.md`)
- HiveMQ broker → Relay dashboard: delivers status (evidence: `README.md`)
- Relay dashboard → EmailJS: sends report (evidence: `README.md`)
- ESP32 controller → HiveMQ broker: subscribes and publishes (evidence: `README.md`)
- Physical button → ESP32 controller: controls channels (evidence: `README.md`)
- ESP32 controller → Eight relays: switches (evidence: `README.md`)
- ESP32 controller → LED and buzzer: signals state (evidence: `README.md`)
- ESP32 controller → WiFi and AP setup: configures connectivity (evidence: `README.md`)
