# fonzacity/taller-iot architecture

> Architecture diagram of the GitHub repository fonzacity/taller-iot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fonzacity/taller-iot
- Repository: https://github.com/fonzacity/taller-iot

## Overview

##### Project Type and Purpose
- This is an educational IoT project (“Taller IoT con ESP8266”) consisting of two embedded‐device demos:
a. DHT sensor (temperature & humidity) with Wi-Fi–based monitoring
b. Remote lamp control over Wi-Fi
- Each demo is implemented as a set of Arduino (.ino) sketches running on an ESP8266 (NodeMCU) board.

##### File Structure Analysis
- Top-level:
- docs/manual.md – user/developer manual
- esp8266/ – root for all microcontroller code
- Under esp8266/: two demo folders (“dht” and “lampara”), each containing:
- wifi.ino – Wi-Fi connection setup
- servidor.ino – HTTP server logic
- dht.ino or lampara.ino – main application logic (sensor reading or lamp toggling)

##### README Insights
- Describes features (remote light control, temp/humidity monitoring)
- Lists tech stack: ESP8266 (NodeMCU), Arduino IDE, Wi-Fi connectivity

##### Capturing Essential Details
- Don’t omit the three sketch modules in each demo—visually group them under “Firmware”
- That the ESP8266 acts both as sensor gateway and actuator controller

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Hardware
    DHTSensor["DHT Sensor (DHT11/22)"]:::hardware
    LampNode["Lamp/Relay"]:::hardware

    %% Network
    Router["Wi-Fi Network"]:::network

    %% Client
    Client["Web Browser/Mobile App"]:::client

    %% Documentation
    README["Project Overview\n(README)"]:::documentation
    Manual["User/Developer Manual\n(docs/manual.md)"]:::documentation

    %% Embedded Device Firmware
    subgraph "ESP8266 (NodeMCU)" 
        direction TB
        FirmwareRoot["Firmware Root\n(esp8266/)"]:::documentation

        subgraph "DHT Demo Firmware"
            direction TB
            WiFi_dht["wifi.ino"]:::firmware
            Server_dht["servidor.ino"]:::firmware
            Logic_dht["dht.ino"]:::firmware
        end

        subgraph "Lampara Demo Firmware"
            direction TB
            WiFi_lamp["wifi.ino"]:::firmware
            Server_lamp["servidor.ino"]:::firmware
            Logic_lamp["lampara.ino"]:::firmware
        end
    end

    %% Data Flows
    DHTSensor -->|reads data| Logic_dht
    Logic_dht -->|formats JSON| Server_dht
    Server_dht -->|serves API| WiFi_dht
    WiFi_dht -->|sends over Wi-Fi| Router

    Client -->|GET /toggle| WiFi_lamp
    WiFi_lamp -->|receives request| Server_lamp
    Server_lamp -->|calls| Logic_lamp
    Logic_lamp -->|toggles| LampNode
    Server_lamp -->|response| WiFi_lamp
    WiFi_lamp -->|sends over Wi-Fi| Router

    Router -->|HTTP traffic| Client

    %% Documentation Links
    README
    Manual

    %% Click Events
    click FirmwareRoot "https://github.com/fonzacity/taller-iot/tree/main/esp8266/"
    click WiFi_dht "https://github.com/fonzacity/taller-iot/blob/main/esp8266/dht/wifi.ino"
    click Server_dht "https://github.com/fonzacity/taller-iot/blob/main/esp8266/dht/servidor.ino"
    click Logic_dht "https://github.com/fonzacity/taller-iot/blob/main/esp8266/dht/dht.ino"
    click WiFi_lamp "https://github.com/fonzacity/taller-iot/blob/main/esp8266/lampara/wifi.ino"
    click Server_lamp "https://github.com/fonzacity/taller-iot/blob/main/esp8266/lampara/servidor.ino"
    click Logic_lamp "https://github.com/fonzacity/taller-iot/blob/main/esp8266/lampara/lampara.ino"
    click Manual "https://github.com/fonzacity/taller-iot/blob/main/docs/manual.md"
    click README "https://github.com/fonzacity/taller-iot/blob/main/README.md"

    %% Styles
    classDef hardware fill:#b2f2bb,stroke:#2f6627,color:#000;
    classDef network fill:#a5d8ff,stroke:#1c7ed6,color:#000;
    classDef client fill:#ffd8a8,stroke:#d9480f,color:#000;
    classDef firmware fill:#eebefa,stroke:#9c36b5,color:#000;
    classDef documentation fill:#fff3bf,stroke:#b59f3b,color:#000;
```
