# uecs-star/uardecs_esp32c3 architecture

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

- Interactive diagram: https://gitdiagram.com/uecs-star/uardecs_esp32c3
- Repository: https://github.com/uecs-star/uardecs_esp32c3

## Overview

UARDECS_ESP32C3 is an Arduino library for building UECS-compliant horticulture applications. An application configures CCM providers/receivers and calls the library setup and loop; the runtime handles Wi-Fi, UDP CCM traffic, and its HTTP interface, while maintaining configuration and CCM state. The README documents provider search, safe mode, web configuration, and flash-backed nonvolatile storage. The excerpts show key APIs and parts of UDP, HTTP, and persistence behavior, but not the full runtime wiring, so unsupported connections are omitted.

Main entry points: [`src/Uardecs_esp32c3.cpp`](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp) (UECS runtime), [`src/Uardecs_esp32c3.h`](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.h) (Library API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application integration"]
  node_api["Library API<br/>[Uardecs_esp32c3.h]"]
  node_runtime["UECS runtime"]
end

subgraph group_network["UECS networking"]
  node_wifi["Wi-Fi connectivity"]
  node_ccm_udp["CCM UDP exchange"]
  node_node_scan["Node and CCM search"]
end

subgraph group_web["Web management"]
  node_web_server["HTTP server"]
  node_web_pages["Status and configuration pages"]
end

subgraph group_state["Configuration and state"]
  node_ccm_state[("CCM registry")]
  node_settings[("Device settings")]
  node_flash[("Flash-backed storage")]
end

node_developer(("UECS application"))
node_uecs_nodes(("Other UECS nodes"))
node_browser(("Browser"))

node_developer -->|"configures and calls"| node_api
node_api -->|"exposes runtime APIs"| node_runtime
node_runtime -.->|"starts Wi-Fi"| node_wifi
node_runtime -.->|"services UDP"| node_ccm_udp
node_ccm_udp -.->|"broadcasts and receives"| node_uecs_nodes
node_ccm_udp -.->|"handles search traffic"| node_node_scan
node_runtime -.->|"services HTTP"| node_web_server
node_web_server -.->|"serves pages"| node_browser
node_web_server -.->|"dispatches requests"| node_web_pages
node_web_pages -.->|"reads and edits"| node_ccm_state
node_web_pages -.->|"edits settings"| node_settings
node_runtime -.->|"manages CCMs"| node_ccm_state
node_runtime -.->|"loads settings"| node_settings
node_settings -.->|"reads and writes"| node_flash

click node_api "https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.h"
click node_runtime "https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp"
click node_ccm_state "https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp"
click node_wifi "https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp"
click node_ccm_udp "https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp"
click node_node_scan "https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp"
click node_web_server "https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp"
click node_web_pages "https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp"
click node_settings "https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp"
click node_flash "https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.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_api,node_runtime,node_browser toneBlue
class node_wifi,node_ccm_udp,node_node_scan toneAmber
class node_web_server,node_web_pages toneMint
class node_ccm_state,node_settings,node_flash toneRose
class node_developer,node_uecs_nodes toneIndigo
```

## Components

### Application integration

- [Library API](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.h): `src/Uardecs_esp32c3.h`
- [UECS runtime](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp): `src/Uardecs_esp32c3.cpp`

### UECS networking

- [Wi-Fi connectivity](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp): `src/Uardecs_esp32c3.cpp`
- [CCM UDP exchange](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp): `src/Uardecs_esp32c3.cpp`
- [Node and CCM search](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp): `src/Uardecs_esp32c3.cpp`

### Web management

- [HTTP server](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp): `src/Uardecs_esp32c3.cpp`
- [Status and configuration pages](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp): `src/Uardecs_esp32c3.cpp`

### Configuration and state

- [CCM registry](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp): `src/Uardecs_esp32c3.cpp`
- [Device settings](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp): `src/Uardecs_esp32c3.cpp`
- [Flash-backed storage](https://github.com/uecs-star/uardecs_esp32c3/blob/main/src/Uardecs_esp32c3.cpp): `src/Uardecs_esp32c3.cpp`

### Other components

- **UECS application**
- **Other UECS nodes**
- **Browser**

## Connections

- UECS application → Library API: configures and calls (evidence: `src/Uardecs_esp32c3.h`)
- Library API → UECS runtime: exposes runtime APIs (evidence: `src/Uardecs_esp32c3.h`)
- UECS runtime → Wi-Fi connectivity: starts Wi-Fi (evidence: `src/Uardecs_esp32c3.cpp`)
- UECS runtime → CCM UDP exchange: services UDP (evidence: `src/Uardecs_esp32c3.cpp`)
- CCM UDP exchange → Other UECS nodes: broadcasts and receives
- CCM UDP exchange → Node and CCM search: handles search traffic (evidence: `src/Uardecs_esp32c3.cpp`)
- UECS runtime → HTTP server: services HTTP (evidence: `src/Uardecs_esp32c3.cpp`)
- HTTP server → Browser: serves pages
- HTTP server → Status and configuration pages: dispatches requests (evidence: `src/Uardecs_esp32c3.cpp`)
- Status and configuration pages → CCM registry: reads and edits (evidence: `src/Uardecs_esp32c3.cpp`)
- Status and configuration pages → Device settings: edits settings (evidence: `src/Uardecs_esp32c3.cpp`)
- UECS runtime → CCM registry: manages CCMs (evidence: `src/Uardecs_esp32c3.cpp`)
- UECS runtime → Device settings: loads settings (evidence: `src/Uardecs_esp32c3.cpp`)
- Device settings → Flash-backed storage: reads and writes (evidence: `src/Uardecs_esp32c3.cpp`)
