# drngominhtu/esp32_cam_localweb_v2 architecture

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

- Interactive diagram: https://gitdiagram.com/drngominhtu/esp32_cam_localweb_v2
- Repository: https://github.com/drngominhtu/esp32_cam_localweb_v2

## Overview

The product is ESP32-CAM firmware with a local web interface. Its visible startup workflow initializes the camera, then SD, Wi-Fi, and the server; the main loop handles server clients. The README also promises a browser UI and live video streaming, represented here as product capabilities, but the sampled files do not show their implementation or how the server serves the assets. The handler header only declares functions, so links from server setup to UI and streaming are left unverified.

Main entry points: [`src/main.cpp`](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/src/main.cpp) (Firmware startup), [`include/web_handlers.h`](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/include/web_handlers.h) (Web server), [`data/index.html`](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/data/index.html) (Web interface), [`include/camera_config.h`](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/include/camera_config.h) (Camera setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firmware["Device firmware"]
  node_startup["Firmware startup<br/>[main.cpp]"]
  node_camera["Camera setup<br/>[camera_config.h]"]
  node_sd["SD setup<br/>[web_handlers.h]"]
  node_wifi["Wi-Fi setup<br/>[web_handlers.h]"]
  node_server["Web server<br/>[web_handlers.h]"]
  node_client_loop["Client handling<br/>[main.cpp]"]
end

subgraph group_web["Local web interface"]
  node_web_ui["Web interface<br/>[index.html]"]
  node_styles["Interface styles<br/>[style.css]"]
  node_stream["Live video stream"]
end

node_user(("Local user"))
node_esp32["ESP32-CAM"]

node_esp32 -->|"runs"| node_startup
node_startup -->|"initializes"| node_camera
node_startup -->|"initializes"| node_sd
node_startup -->|"initializes"| node_wifi
node_startup -->|"initializes"| node_server
node_startup -->|"enters loop"| node_client_loop
node_client_loop -->|"handles clients"| node_server
node_user -.->|"uses locally"| node_web_ui
node_web_ui -.->|"styled by"| node_styles
node_server -.->|"serves interface"| node_web_ui
node_server -.->|"provides stream"| node_stream
node_user -.->|"views feed"| node_stream

click node_startup "https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/src/main.cpp"
click node_camera "https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/include/camera_config.h"
click node_sd "https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/include/web_handlers.h"
click node_wifi "https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/include/web_handlers.h"
click node_server "https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/include/web_handlers.h"
click node_client_loop "https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/src/main.cpp"
click node_web_ui "https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/data/index.html"
click node_styles "https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/data/style.css"

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_startup,node_camera,node_sd,node_wifi,node_server,node_client_loop,node_user toneBlue
class node_web_ui,node_styles,node_stream toneAmber
class node_esp32 toneIndigo
```

## Components

### Device firmware

- [Firmware startup](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/src/main.cpp): `src/main.cpp`
- [Camera setup](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/include/camera_config.h): `include/camera_config.h`
- [SD setup](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/include/web_handlers.h): `include/web_handlers.h`
- [Wi-Fi setup](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/include/web_handlers.h): `include/web_handlers.h`
- [Web server](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/include/web_handlers.h): `include/web_handlers.h`
- [Client handling](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/src/main.cpp): `src/main.cpp`

### Local web interface

- [Web interface](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/data/index.html): `data/index.html`
- [Interface styles](https://github.com/drngominhtu/esp32_cam_localweb_v2/blob/main/data/style.css): `data/style.css`
- **Live video stream**

### Other components

- **Local user**
- **ESP32-CAM**

## Connections

- ESP32-CAM → Firmware startup: runs (evidence: `src/main.cpp`)
- Firmware startup → Camera setup: initializes (evidence: `src/main.cpp`)
- Firmware startup → SD setup: initializes (evidence: `src/main.cpp`)
- Firmware startup → Wi-Fi setup: initializes (evidence: `src/main.cpp`)
- Firmware startup → Web server: initializes (evidence: `src/main.cpp`)
- Firmware startup → Client handling: enters loop (evidence: `src/main.cpp`)
- Client handling → Web server: handles clients (evidence: `src/main.cpp`)
- Local user → Web interface: uses locally (evidence: `README.md`)
- Web interface → Interface styles: styled by (evidence: `README.md`)
- Web server → Web interface: serves interface
- Web server → Live video stream: provides stream (evidence: `README.md`)
- Local user → Live video stream: views feed (evidence: `README.md`)
