# raymundosoto/sistemas_inteligentes_hogar_inteligente architecture

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

- Interactive diagram: https://gitdiagram.com/raymundosoto/sistemas_inteligentes_hogar_inteligente
- Repository: https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente

## Overview

1. This repository is a small two-part smart-home prototype: a Python web application for the user interface and an ESP32-C3 firmware project for the device side.

2. The top-level `app.py` is the main application entry point on the software side. The presence of `templates/` and `static/` strongly suggests a Flask-style server that renders HTML server-side and serves CSS/assets.

3. `templates/index.html` is the primary UI page. It is the browser-facing control/dashboard layer where the user interacts with the system.

4. `static/style.css` provides the presentation layer for that UI. It is a separate front-end asset, but still delivered by the Python web app rather than a separate front-end build toolchain.

5. `ESP32_C3_app/servidor_esp32_app.ino` is the embedded firmware project for the ESP32-C3. This is the hardware boundary of the system and likely contains the microcontroller logic that handles connectivity and device control.

6. The architecture therefore has two runtime environments:
   - a Python process serving the web UI
   - an ESP32-C3 running Arduino-style firmware on the device
   These are separate deployables with different lifecycles.

7. The expected data flow is user/browser → Python web app → ESP32 device, with the UI acting as the control surface and the ESP32 acting as the actuator/sensor endpoint. Depending on the firmware, the ESP32 may also expose its own HTTP endpoints or receive commands from the server over the network.

8. There is no sign of a database, message broker, or cloud integration in the file tree. That implies a lightweight, direct-interaction architecture rather than a multi-service backend.

9. The `README.md` is minimal, so the repo does not document a larger platform around this code. The architecture is therefore best understood as a local smart-home demo or lab practice project.

10. For an architecture diagram, the key boundaries are:
   - Browser/UI layer
   - Python web server layer
   - Wi-Fi/network boundary
   - ESP32-C3 embedded device layer
   - optional physical home device/sensor/actuator layer behind the ESP32

11. The main technology choices that matter architecturally are Python for the web backend, HTML/CSS for the UI, and Arduino firmware for the ESP32-C3. Those choices imply a simple, device-centric control system rather than a large distributed application.

Main entry points: [`app.py`](https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/app.py) (App server), [`ESP32_C3_app/servidor_esp32_app.ino`](https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/ESP32_C3_app/servidor_esp32_app.ino) (ESP32 firmware), [`templates/index.html`](https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/templates/index.html) (Home page), [`static/style.css`](https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/static/style.css) (Styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser UI"]
  node_browser(("Browser<br/>client"))
  node_index_template["Home page<br/>html template<br/>[index.html]"]
  node_style_css["Styles<br/>css asset<br/>[style.css]"]
end

subgraph group_server["Python App"]
  node_app_py["App server<br/>python web app<br/>[app.py]"]
end

subgraph group_device["ESP32-C3"]
  node_esp32_fw{{"ESP32 firmware<br/>arduino firmware"}}
  node_home_device[("Home device<br/>sensor/actuator")]
end

node_network(("Wi-Fi link<br/>network boundary"))

node_browser -->|"uses"| node_app_py
node_app_py -->|"renders"| node_index_template
node_app_py -->|"serves"| node_style_css
node_app_py -->|"sends commands"| node_network
node_network -->|"reaches"| node_esp32_fw
node_esp32_fw -->|"controls"| node_home_device
node_home_device -->|"feedback"| node_esp32_fw
node_browser -->|"views"| node_index_template

click node_index_template "https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/templates/index.html"
click node_style_css "https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/static/style.css"
click node_app_py "https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/app.py"
click node_esp32_fw "https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/ESP32_C3_app/servidor_esp32_app.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_browser,node_index_template,node_style_css toneBlue
class node_app_py toneAmber
class node_esp32_fw,node_home_device toneMint
class node_network toneNeutral
```

## Components

### Browser UI

User-facing control surface and rendered web assets.

- **Browser**: client · User interacts with the smart-home dashboard here.
- [Home page](https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/templates/index.html): html template · Primary server-rendered control page. · `templates/index.html`
- [Styles](https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/static/style.css): css asset · Presentation rules for the web UI. · `static/style.css`

### Python App

Server-side web application that renders the UI and coordinates device control.

- [App server](https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/app.py): python web app · Main application entry point for the web UI and device coordination. · `app.py`

### ESP32-C3

Embedded firmware boundary and physical device side.

- [ESP32 firmware](https://github.com/raymundosoto/sistemas_inteligentes_hogar_inteligente/blob/main/ESP32_C3_app/servidor_esp32_app.ino): arduino firmware · Embedded ESP32-C3 application that handles device-side behavior. · `ESP32_C3_app/servidor_esp32_app.ino`
- **Home device**: sensor/actuator · Physical smart-home hardware controlled or observed by the ESP32.

### Other components

- **Wi-Fi link**: network boundary · Communication path between the web app and the embedded device.

## Connections

- Browser → App server: uses · The browser opens the web app and sends user actions.
- App server → Home page: renders · The server renders the primary HTML page.
- App server → Styles: serves · The server delivers the stylesheet with the page.
- App server → Wi-Fi link: sends commands · The Python app communicates device commands over the network.
- Wi-Fi link → ESP32 firmware: reaches · Wireless traffic reaches the ESP32-C3 firmware.
- ESP32 firmware → Home device: controls · Firmware drives or reads the attached home hardware.
- Home device → ESP32 firmware: feedback · Sensors or device state flow back to the firmware.
- Browser → Home page: views · The user sees the rendered dashboard page.
