# theapogeus/flipclock architecture

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

- Interactive diagram: https://gitdiagram.com/theapogeus/flipclock
- Repository: https://github.com/theapogeus/flipclock

## Overview

FlipClock is an M5Stack clock sketch that presents time in a vintage flip-clock style. The documented setup is to configure Wi-Fi credentials and UTC/daylight offsets, connect to a network, obtain time, and display it. The sampled UI creates hour/minute panels and a blinking separator, with hour and minute labels subscribed to LVGL messages; its custom digit font is defined separately. The sketch’s implementation was not sampled, so its runtime links to networking and timekeeping are shown as unverified rather than asserted.

Main entry points: [`FlipClock.ino`](https://github.com/theapogeus/flipclock/blob/main/FlipClock.ino) (Clock sketch), [`ui_gui.cpp`](https://github.com/theapogeus/flipclock/blob/main/ui_gui.cpp) (Clock UI), [`config.h`](https://github.com/theapogeus/flipclock/blob/main/config.h) (Device configuration), [`ui_gui.h`](https://github.com/theapogeus/flipclock/blob/main/ui_gui.h) (UI messages and colors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and time"]
  node_sketch["Clock sketch<br/>[FlipClock.ino]"]
  node_config["Device configuration<br/>[config.h]"]
  node_wifi{{"Wi-Fi network"}}
  node_ntp{{"NTP time service"}}
end

subgraph group_display["Clock display"]
  node_ui["Clock UI<br/>[ui_gui.cpp]"]
  node_ui_api["UI messages and colors<br/>[ui_gui.h]"]
  node_font["Fliplo digit font<br/>[font_Fliplo.c]"]
  node_lvgl["LVGL runtime"]
end

node_owner(("M5Stack owner"))

node_owner -->|"uploads sketch"| node_sketch
node_config -->|"provides credentials"| node_wifi
node_config -->|"sets time offsets"| node_ntp
node_sketch -.->|"uses settings"| node_config
node_sketch -.->|"connects to"| node_wifi
node_sketch -.->|"gets time"| node_ntp
node_sketch -.->|"starts display"| node_ui
node_ui -->|"uses definitions"| node_ui_api
node_ui -->|"uses font"| node_font
node_ui -->|"creates and updates"| node_lvgl

click node_sketch "https://github.com/theapogeus/flipclock/blob/main/FlipClock.ino"
click node_config "https://github.com/theapogeus/flipclock/blob/main/config.h"
click node_ui "https://github.com/theapogeus/flipclock/blob/main/ui_gui.cpp"
click node_ui_api "https://github.com/theapogeus/flipclock/blob/main/ui_gui.h"
click node_font "https://github.com/theapogeus/flipclock/blob/main/font_Fliplo.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_sketch,node_config,node_wifi,node_ntp toneBlue
class node_ui,node_ui_api,node_font,node_lvgl toneAmber
class node_owner toneIndigo
```

## Components

### Setup and time

- [Clock sketch](https://github.com/theapogeus/flipclock/blob/main/FlipClock.ino): `FlipClock.ino`
- [Device configuration](https://github.com/theapogeus/flipclock/blob/main/config.h): `config.h`
- **Wi-Fi network**
- **NTP time service**

### Clock display

- [Clock UI](https://github.com/theapogeus/flipclock/blob/main/ui_gui.cpp): `ui_gui.cpp`
- [UI messages and colors](https://github.com/theapogeus/flipclock/blob/main/ui_gui.h): `ui_gui.h`
- [Fliplo digit font](https://github.com/theapogeus/flipclock/blob/main/font_Fliplo.c): `font_Fliplo.c`
- **LVGL runtime**

### Other components

- **M5Stack owner**

## Connections

- M5Stack owner → Clock sketch: uploads sketch (evidence: `README.md`)
- Device configuration → Wi-Fi network: provides credentials (evidence: `README.md`)
- Device configuration → NTP time service: sets time offsets (evidence: `README.md`)
- Clock sketch → Device configuration: uses settings
- Clock sketch → Wi-Fi network: connects to
- Clock sketch → NTP time service: gets time
- Clock sketch → Clock UI: starts display
- Clock UI → UI messages and colors: uses definitions (evidence: `ui_gui.cpp`)
- Clock UI → Fliplo digit font: uses font (evidence: `ui_gui.cpp`)
- Clock UI → LVGL runtime: creates and updates (evidence: `ui_gui.cpp`)
