# alphazcc/mini-project architecture

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

- Interactive diagram: https://gitdiagram.com/alphazcc/mini-project
- Repository: https://github.com/alphazcc/mini-project

## Overview

This repository is the IMX6U-side Linux smart-home control panel. Its primary workflow initializes the LVGL display, accepts the ELF 1 device over TCP, decodes sensor frames for on-screen updates, and sends device-control commands in response to button interaction. A separate weather workflow requests Seniverse data, parses its JSON, and updates the UI. The graph preserves the documented UI assets and protocol stages; internal UI wiring beyond the sampled excerpts is left unasserted. (The ELF 1 firmware is not included.)

Main entry points: [`lvgl_demo/app/application.c`](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/application.c) (Application coordinator), [`lvgl_demo/ui/ui.c`](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/ui/ui.c) (LVGL UI), [`lvgl_demo/app/weather.c`](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/weather.c) (Weather workflow), [`lvgl_demo/ui/screens/ui_ScreenMain.c`](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/ui/screens/ui_ScreenMain.c) (Main screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_main["Linux LVGL entry<br/>[main.c]"]
  node_app["Application coordinator<br/>[application.c]"]
  node_clock["Clock display<br/>[application.c]"]
  node_controls["Device controls<br/>[button.c]"]
end

subgraph group_device["Device communication"]
  node_server["TCP server<br/>[tcp_server.c]"]
  node_protocol["Frame protocol<br/>[protocol.c]"]
end

subgraph group_weather["Weather service"]
  node_weather["Weather workflow<br/>[weather.c]"]
  node_weather_client["Weather TCP client<br/>[tcp_client.c]"]
  node_json["cJSON parser<br/>[cJSON.c]"]
end

subgraph group_presentation["Panel presentation"]
  node_ui["LVGL UI<br/>[ui.c]"]
  node_screen["Main screen<br/>[ui_ScreenMain.c]"]
  node_helpers["UI helpers<br/>[ui_helpers.c]"]
  node_assets["Image assets"]
  node_font["Panel font<br/>[ui_font_Font1.c]"]
end

node_operator(("Panel operator"))
node_elf(("ELF 1 device"))
node_seniverse["Seniverse API"]

node_operator -->|"uses panel"| node_main
node_main -->|"initializes"| node_ui
node_main -->|"starts"| node_app
node_app -->|"accepts connection"| node_server
node_elf -->|"sends frames"| node_server
node_app -->|"decodes frames"| node_protocol
node_app -->|"updates sensors"| node_ui
node_app -->|"runs clock display"| node_clock
node_clock -->|"updates time"| node_ui
node_operator -->|"presses controls"| node_controls
node_controls -->|"packages commands"| node_protocol
node_controls -->|"sends commands"| node_server
node_app -->|"starts weather"| node_weather
node_weather -->|"requests data"| node_weather_client
node_weather_client -->|"fetches forecast"| node_seniverse
node_weather -->|"parses response"| node_json
node_weather -->|"updates forecast"| node_ui
node_ui -.->|"loads screen"| node_screen
node_screen -.->|"uses images"| node_assets
node_screen -.->|"uses font"| node_font
node_screen -.->|"uses helpers"| node_helpers

click node_main "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/main.c"
click node_app "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/application.c"
click node_clock "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/application.c"
click node_controls "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/button.c"
click node_server "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/socket/tcp_server.c"
click node_protocol "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/protocol/protocol.c"
click node_weather "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/weather.c"
click node_weather_client "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/socket/tcp_client.c"
click node_json "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/cJSON/cJSON.c"
click node_ui "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/ui/ui.c"
click node_screen "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/ui/screens/ui_ScreenMain.c"
click node_helpers "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/ui/ui_helpers.c"
click node_assets "https://github.com/alphazcc/mini-project/tree/main/lvgl_demo/ui/images"
click node_font "https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/ui/fonts/ui_font_Font1.c"

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_main,node_app,node_clock,node_controls toneBlue
class node_server,node_protocol toneAmber
class node_weather,node_weather_client,node_json,node_seniverse toneMint
class node_ui,node_screen,node_helpers,node_assets,node_font toneRose
class node_operator,node_elf toneIndigo
```

## Components

### Application runtime

- [Linux LVGL entry](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/main.c): `lvgl_demo/main.c`
- [Application coordinator](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/application.c): `lvgl_demo/app/application.c`
- [Clock display](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/application.c): `lvgl_demo/app/application.c`
- [Device controls](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/button.c): `lvgl_demo/app/button.c`

### Device communication

- [TCP server](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/socket/tcp_server.c): `lvgl_demo/app/socket/tcp_server.c`
- [Frame protocol](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/protocol/protocol.c): `lvgl_demo/app/protocol/protocol.c`

### Weather service

- [Weather workflow](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/weather.c): `lvgl_demo/app/weather.c`
- [Weather TCP client](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/socket/tcp_client.c): `lvgl_demo/app/socket/tcp_client.c`
- [cJSON parser](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/app/cJSON/cJSON.c): `lvgl_demo/app/cJSON/cJSON.c`

### Panel presentation

- [LVGL UI](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/ui/ui.c): `lvgl_demo/ui/ui.c`
- [Main screen](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/ui/screens/ui_ScreenMain.c): `lvgl_demo/ui/screens/ui_ScreenMain.c`
- [UI helpers](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/ui/ui_helpers.c): `lvgl_demo/ui/ui_helpers.c`
- [Image assets](https://github.com/alphazcc/mini-project/tree/main/lvgl_demo/ui/images): `lvgl_demo/ui/images`
- [Panel font](https://github.com/alphazcc/mini-project/blob/main/lvgl_demo/ui/fonts/ui_font_Font1.c): `lvgl_demo/ui/fonts/ui_font_Font1.c`

### Other components

- **Panel operator**
- **ELF 1 device**
- **Seniverse API**

## Connections

- Panel operator → Linux LVGL entry: uses panel (evidence: `README.md`)
- Linux LVGL entry → LVGL UI: initializes (evidence: `lvgl_demo/main.c`)
- Linux LVGL entry → Application coordinator: starts (evidence: `lvgl_demo/main.c`)
- Application coordinator → TCP server: accepts connection (evidence: `README.md`)
- ELF 1 device → TCP server: sends frames (evidence: `README.md`)
- Application coordinator → Frame protocol: decodes frames (evidence: `lvgl_demo/app/application.c`)
- Application coordinator → LVGL UI: updates sensors (evidence: `lvgl_demo/app/application.c`)
- Application coordinator → Clock display: runs clock display (evidence: `lvgl_demo/app/application.c`)
- Clock display → LVGL UI: updates time (evidence: `lvgl_demo/app/application.c`)
- Panel operator → Device controls: presses controls (evidence: `README.md`)
- Device controls → Frame protocol: packages commands (evidence: `README.md`)
- Device controls → TCP server: sends commands (evidence: `README.md`)
- Application coordinator → Weather workflow: starts weather (evidence: `lvgl_demo/app/application.c`)
- Weather workflow → Weather TCP client: requests data (evidence: `README.md`)
- Weather TCP client → Seniverse API: fetches forecast (evidence: `README.md`)
- Weather workflow → cJSON parser: parses response (evidence: `README.md`)
- Weather workflow → LVGL UI: updates forecast (evidence: `README.md`)
- LVGL UI → Main screen: loads screen
- Main screen → Image assets: uses images
- Main screen → Panel font: uses font
- Main screen → UI helpers: uses helpers
