# steve102420/kertilampa_gyozoeke_esp32c3mini architecture

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

- Interactive diagram: https://gitdiagram.com/steve102420/kertilampa_gyozoeke_esp32c3mini
- Repository: https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini

## Overview

This repository contains firmware for a Wi-Fi-connected, scheduleable garden light. A user accesses its embedded web interface to configure networking, lighting, brightness, and time settings; the device persists settings, drives the light, and synchronizes time for scheduling. The same firmware also checks GitHub for OTA updates. The runtime is concentrated in src/main.cpp; the excerpts show these capabilities but omit much of the route registration and loop wiring, so uncertain runtime links are left out.

Main entry points: [`src/main.cpp`](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web control"]
  node_webui["Embedded web UI<br/>[main.cpp]"]
  node_http["HTTP API<br/>[main.cpp]"]
  node_settings[("Saved settings<br/>[main.cpp]")]
end

subgraph group_light["Lighting"]
  node_scheduler["Light scheduler<br/>[main.cpp]"]
  node_light_control["Light control<br/>[main.cpp]"]
  node_pwm["PWM output<br/>[main.cpp]"]
end

subgraph group_connectivity["Connectivity and time"]
  node_wifi_setup["Wi-Fi setup<br/>[main.cpp]"]
  node_clock["Time sync<br/>[main.cpp]"]
end

subgraph group_updates["Firmware updates"]
  node_ota_check["OTA checker<br/>[main.cpp]"]
  node_ota_install["Firmware installer<br/>[main.cpp]"]
end

node_user(("User"))
node_wifi_network(("Wi-Fi network"))
node_ntp(("NTP service"))
node_lamp(("Garden light"))
node_github(("GitHub releases"))

node_user -->|"uses"| node_webui
node_webui -->|"sends requests"| node_http
node_http -->|"saves settings"| node_settings
node_http -->|"scans networks"| node_wifi_setup
node_wifi_setup -.->|"connects to"| node_wifi_network
node_http -->|"sets light"| node_light_control
node_light_control -->|"drives output"| node_pwm
node_pwm -->|"controls"| node_lamp
node_clock -.->|"synchronizes"| node_ntp
node_http -->|"sets timezone"| node_clock
node_scheduler -.->|"sets scheduled state"| node_light_control
node_ota_check -->|"checks releases"| node_github
node_ota_check -.->|"starts update"| node_ota_install

click node_webui "https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp"
click node_http "https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp"
click node_settings "https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp"
click node_wifi_setup "https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp"
click node_clock "https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp"
click node_scheduler "https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp"
click node_light_control "https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp"
click node_pwm "https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp"
click node_ota_check "https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp"
click node_ota_install "https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp"

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_webui,node_http,node_settings,node_user toneBlue
class node_scheduler,node_light_control,node_pwm toneAmber
class node_wifi_setup,node_clock toneMint
class node_ota_check,node_ota_install toneRose
class node_wifi_network,node_ntp,node_lamp,node_github toneIndigo
```

## Components

### Web control

- [Embedded web UI](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp): `src/main.cpp`
- [HTTP API](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp): `src/main.cpp`
- [Saved settings](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp): `src/main.cpp`

### Lighting

- [Light scheduler](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp): `src/main.cpp`
- [Light control](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp): `src/main.cpp`
- [PWM output](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp): `src/main.cpp`

### Connectivity and time

- [Wi-Fi setup](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp): `src/main.cpp`
- [Time sync](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp): `src/main.cpp`

### Firmware updates

- [OTA checker](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp): `src/main.cpp`
- [Firmware installer](https://github.com/steve102420/kertilampa_gyozoeke_esp32c3mini/blob/main/src/main.cpp): `src/main.cpp`

### Other components

- **User**
- **Wi-Fi network**
- **NTP service**
- **Garden light**
- **GitHub releases**

## Connections

- User → Embedded web UI: uses (evidence: `src/main.cpp`)
- Embedded web UI → HTTP API: sends requests (evidence: `src/main.cpp`)
- HTTP API → Saved settings: saves settings (evidence: `src/main.cpp`)
- HTTP API → Wi-Fi setup: scans networks (evidence: `src/main.cpp`)
- Wi-Fi setup → Wi-Fi network: connects to
- HTTP API → Light control: sets light (evidence: `src/main.cpp`)
- Light control → PWM output: drives output (evidence: `src/main.cpp`)
- PWM output → Garden light: controls (evidence: `src/main.cpp`)
- Time sync → NTP service: synchronizes
- HTTP API → Time sync: sets timezone (evidence: `src/main.cpp`)
- Light scheduler → Light control: sets scheduled state (evidence: `src/main.cpp`)
- OTA checker → GitHub releases: checks releases (evidence: `src/main.cpp`)
- OTA checker → Firmware installer: starts update (evidence: `src/main.cpp`)
