# kapilan99/smart-door-lock architecture

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

- Interactive diagram: https://gitdiagram.com/kapilan99/smart-door-lock
- Repository: https://github.com/kapilan99/smart-door-lock

## Overview

##### Project type and purpose
- This is an embedded IoT system (“Smart-door-lock”) combining microcontroller firmware and cloud integration.
- It uses an ESP32-CAM for image capture and network connectivity, an Arduino Uno for lock actuation, and a separate Arduino-based battery‐indicator.
- The system notifies the user and accepts commands via the Telegram Bot API.

##### File structure
- Top‐level files:
- ArduinoUno.ino – firmware to drive the door‐lock actuator
- batterey_indicator.ino – firmware to measure and report battery status
- esp32.ino – firmware for the ESP32‐CAM, handling camera, Wi-Fi, and Telegram communication
- No subdirectories: each .ino is a self-contained module
- No build scripts beyond the Arduino IDE project files

##### README for additional insights
- Purpose: “smart door locking system by notify the user using esp32 cam and telegram api”
- No further architecture details, but we infer modules from sketch names

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Power Source
    Battery["Battery\n(power)"]:::power

    subgraph "Edge Device"
        BI["Battery Indicator Arduino"]:::sensing
        ESP["ESP32-CAM"]:::network
        UNO["Arduino Uno\nLock Controller"]:::actuator
        Act["Door Lock Actuator"]:::actuator
    end

    %% Cloud and User
    Cloud["Telegram Bot API"]:::cloud
    User["User's Telegram Client"]:::network

    %% Documentation
    Doc["Project Documentation\n(README.md)"]:::documentation

    %% Connections
    Battery -->|powers| BI
    Battery -->|powers| ESP
    Battery -->|powers| UNO
    Battery -->|powers| Act

    BI -->|"UART/I2C"| ESP
    ESP -->|"HTTPS (Wi-Fi)"| Cloud
    Cloud -->|"deliver messages"| User
    User -->|"commands"| Cloud
    Cloud -->|"Telegram API"| ESP

    ESP -->|"UART/Digital I/O"| UNO
    UNO -->|"control signal"| Act

    %% Click Events
    click ESP "https://github.com/kapilan99/smart-door-lock/blob/main/esp32.ino"
    click UNO "https://github.com/kapilan99/smart-door-lock/blob/main/ArduinoUno.ino"
    click BI "https://github.com/kapilan99/smart-door-lock/blob/main/batterey_indicator.ino"
    click Doc "https://github.com/kapilan99/smart-door-lock/blob/main/README.md"

    %% Styles
    classDef sensing fill:#9f6,stroke:#393,stroke-width:1px
    classDef network fill:#6cf,stroke:#039,stroke-width:1px
    classDef actuator fill:#f96,stroke:#d43,stroke-width:1px
    classDef power fill:#ccc,stroke:#888,stroke-width:1px
    classDef cloud fill:#6cf,stroke:#039,stroke-width:2px,stroke-dasharray: 5 5
    classDef documentation fill:#eef,stroke:#99c,stroke-width:1px,stroke-dasharray: 2 2
```
