# luisfelipe18/wireless-doorbell architecture

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

- Interactive diagram: https://gitdiagram.com/luisfelipe18/wireless-doorbell
- Repository: https://github.com/luisfelipe18/wireless-doorbell

## Overview

- Transmitter Device (Doorbell ESP-01S): Represented as a microcontroller that connects a push button to trigger the doorbell. It is configured to send a “ring” message via MQTT.
- Receiver Devices (Multiple ESP-01S units): These are connected to buzzers for sound alerts and provide a local web interface for log monitoring and status display.
- WiFi Router: This acts as the network medium interconnecting the doorbell, receivers, and the MQTT broker.
- MQTT Broker (e.g., Mosquitto): This server component handles the message distribution between the transmitter and the various receivers.

##### Relationships and Data Flow
- WiFi Router as an intermediary between the ESP8266 devices and the MQTT Broker. Illustrate how the devices connect wirelessly.

##### Architectural Patterns & Key Concepts
- Distributed IoT Architecture: Emphasize that the architecture consists of multiple, geographically separated IoT devices that communicate through a centralized messaging broker.
- Real-Time Communication: Represent the MQTT messaging flow and web interface refresh as key real-time elements.
- Reliability Features: Note aspects like automatic reconnection (for both WiFi and MQTT) and health monitoring as indicated in the README.
- Modular Device Roles: Clearly distinguish the doorbell (transmitter) from the receivers, which include additional functionality for monitoring.

##### Relevant Technologies & Components
- ESP8266 microcontrollers (ESP-01S)
- MQTT protocol (via the PubSubClient library within the Arduino sketch)
- WiFi connectivity (managed by ESP8266WiFi library)
- Web server functionality (through ESP8266WebServer)
- mDNS for local hostname resolution
- Mosquitto MQTT Broker on the server or Raspberry Pi
- CircularBuffer for logging in resources

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Doorbell Transmitter (ESP8266)"]:::hardware
    B["WiFi Router"]:::network
    C["MQTT Broker (Mosquitto)"]:::network
    D["Receiver Devices (ESP8266)"]:::hardware
    E["Web Interface (HTTP)"]:::web
    U["User/Monitor"]:::user
    G["Project Documentation"]:::doc

    A -->|"WiFi"| B
    B -->|"MQTT"| C
    C -->|"ring"| D
    D -->|"HTTP"| E
    E -->|"View"| U

    click A "https://github.com/luisfelipe18/wireless-doorbell/blob/main/wireless-doorbell.ino"
    click D "https://github.com/luisfelipe18/wireless-doorbell/blob/main/wireless-doorbell.ino"
    click G "https://github.com/luisfelipe18/wireless-doorbell/blob/main/README.md"

    classDef hardware fill:#FAD7A0,stroke:#D35400,stroke-width:2px
    classDef network fill:#AED6F1,stroke:#2471A3,stroke-width:2px
    classDef web fill:#A9DFBF,stroke:#196F3D,stroke-width:2px
    classDef user fill:#F9E79F,stroke:#B7950B,stroke-width:2px
    classDef doc fill:#F5CBA7,stroke:#A04000,stroke-width:2px
```
