# spooks4576/ghost_esp architecture

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

- Interactive diagram: https://gitdiagram.com/spooks4576/ghost_esp
- Repository: https://github.com/spooks4576/ghost_esp

## Overview

Ghost ESP is an archived ESP32 firmware project, described only as archived in its README. Its principal startup path initializes serial and Wi-Fi, sets up command handling and persistent settings, starts the access point and storage, then initializes the configured display and RGB effects. The Wi-Fi manager exposes additional network utilities, while display and settings provide device configuration and UI support. Source excerpts are incomplete, so several cross-manager relationships are shown only as unverified; no unsampled implementation details are assumed.

Main entry points: [`main/main.c`](https://github.com/spooks4576/ghost_esp/blob/main/main/main.c) (Firmware startup), [`main/managers/display_manager.c`](https://github.com/spooks4576/ghost_esp/blob/main/main/managers/display_manager.c) (Display manager), [`main/managers/wifi_manager.c`](https://github.com/spooks4576/ghost_esp/blob/main/main/managers/wifi_manager.c) (Wi-Fi tools), [`main/core/serial_manager.c`](https://github.com/spooks4576/ghost_esp/blob/main/main/core/serial_manager.c) (Serial manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and control"]
  node_firmware["Firmware startup<br/>[main.c]"]
  node_serial["Serial manager<br/>[serial_manager.c]"]
  node_commands["Command line<br/>[commandline.c]"]
  node_tasks["Task manager<br/>[system_manager.c]"]
end

subgraph group_network["Network features"]
  node_wifi["Wi-Fi tools<br/>[wifi_manager.c]"]
  node_ap["AP services<br/>[ap_manager.c]"]
  node_mdns["mDNS service<br/>[mdns.c]"]
  node_ble["Bluetooth LE<br/>[ble_manager.c]"]
end

subgraph group_device["Device services"]
  node_settings[("Settings<br/>[settings_manager.c]")]
  node_rgb["RGB effects<br/>[rgb_manager.c]"]
  node_dial["Dial manager<br/>[dial_manager.c]"]
  node_sd["SD storage<br/>[main.c]"]
end

subgraph group_ui["User interface"]
  node_display["Display manager<br/>[display_manager.c]"]
  node_lvgl["LVGL UI engine<br/>[lv_obj.c]"]
  node_screen["Terminal screen<br/>[terminal_screen.h]"]
  node_joystick["Joystick input<br/>[joystick_manager.h]"]
  node_gfx["M5 graphics<br/>[M5GFX.cpp]"]
end

node_operator(("Device operator"))

node_operator -.->|"sends commands"| node_serial
node_firmware -->|"initializes"| node_serial
node_firmware -->|"initializes"| node_wifi
node_firmware -->|"starts commands"| node_commands
node_firmware -->|"loads settings"| node_settings
node_firmware -->|"initializes"| node_ap
node_firmware -->|"initializes"| node_sd
node_firmware -->|"initializes"| node_display
node_firmware -->|"initializes"| node_rgb
node_firmware -.->|"includes optionally"| node_ble
node_serial -.->|"uses task APIs"| node_tasks
node_wifi -.->|"references manager"| node_ap
node_wifi -.->|"references settings"| node_settings
node_wifi -.->|"references effects"| node_rgb
node_display -.->|"uses UI engine"| node_lvgl
node_display -.->|"uses input"| node_joystick
node_screen -.->|"references manager"| node_display
node_screen -.->|"references manager"| node_ap
node_firmware -.->|"may use service"| node_mdns
node_firmware -.->|"may initialize"| node_dial
node_display -.->|"may use graphics"| node_gfx

click node_firmware "https://github.com/spooks4576/ghost_esp/blob/main/main/main.c"
click node_serial "https://github.com/spooks4576/ghost_esp/blob/main/main/core/serial_manager.c"
click node_commands "https://github.com/spooks4576/ghost_esp/blob/main/main/core/commandline.c"
click node_tasks "https://github.com/spooks4576/ghost_esp/blob/main/main/core/system_manager.c"
click node_settings "https://github.com/spooks4576/ghost_esp/blob/main/main/managers/settings_manager.c"
click node_wifi "https://github.com/spooks4576/ghost_esp/blob/main/main/managers/wifi_manager.c"
click node_ap "https://github.com/spooks4576/ghost_esp/blob/main/main/managers/ap_manager.c"
click node_mdns "https://github.com/spooks4576/ghost_esp/blob/main/components/mdns/mdns.c"
click node_ble "https://github.com/spooks4576/ghost_esp/blob/main/main/managers/ble_manager.c"
click node_display "https://github.com/spooks4576/ghost_esp/blob/main/main/managers/display_manager.c"
click node_lvgl "https://github.com/spooks4576/ghost_esp/blob/main/components/lvgl/src/core/lv_obj.c"
click node_screen "https://github.com/spooks4576/ghost_esp/blob/main/include/managers/views/terminal_screen.h"
click node_joystick "https://github.com/spooks4576/ghost_esp/blob/main/include/managers/joystick_manager.h"
click node_gfx "https://github.com/spooks4576/ghost_esp/blob/main/components/M5GFX/src/M5GFX.cpp"
click node_rgb "https://github.com/spooks4576/ghost_esp/blob/main/main/managers/rgb_manager.c"
click node_dial "https://github.com/spooks4576/ghost_esp/blob/main/main/managers/dial_manager.c"
click node_sd "https://github.com/spooks4576/ghost_esp/blob/main/main/main.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_firmware,node_serial,node_commands,node_tasks toneBlue
class node_wifi,node_ap,node_mdns,node_ble toneAmber
class node_settings,node_rgb,node_dial,node_sd toneMint
class node_display,node_lvgl,node_screen,node_joystick,node_gfx toneRose
class node_operator toneIndigo
```

## Components

### Startup and control

- [Firmware startup](https://github.com/spooks4576/ghost_esp/blob/main/main/main.c): `main/main.c`
- [Serial manager](https://github.com/spooks4576/ghost_esp/blob/main/main/core/serial_manager.c): `main/core/serial_manager.c`
- [Command line](https://github.com/spooks4576/ghost_esp/blob/main/main/core/commandline.c): `main/core/commandline.c`
- [Task manager](https://github.com/spooks4576/ghost_esp/blob/main/main/core/system_manager.c): `main/core/system_manager.c`

### Network features

- [Wi-Fi tools](https://github.com/spooks4576/ghost_esp/blob/main/main/managers/wifi_manager.c): `main/managers/wifi_manager.c`
- [AP services](https://github.com/spooks4576/ghost_esp/blob/main/main/managers/ap_manager.c): `main/managers/ap_manager.c`
- [mDNS service](https://github.com/spooks4576/ghost_esp/blob/main/components/mdns/mdns.c): `components/mdns/mdns.c`
- [Bluetooth LE](https://github.com/spooks4576/ghost_esp/blob/main/main/managers/ble_manager.c): `main/managers/ble_manager.c`

### Device services

- [Settings](https://github.com/spooks4576/ghost_esp/blob/main/main/managers/settings_manager.c): `main/managers/settings_manager.c`
- [RGB effects](https://github.com/spooks4576/ghost_esp/blob/main/main/managers/rgb_manager.c): `main/managers/rgb_manager.c`
- [Dial manager](https://github.com/spooks4576/ghost_esp/blob/main/main/managers/dial_manager.c): `main/managers/dial_manager.c`
- [SD storage](https://github.com/spooks4576/ghost_esp/blob/main/main/main.c): `main/main.c`

### User interface

- [Display manager](https://github.com/spooks4576/ghost_esp/blob/main/main/managers/display_manager.c): `main/managers/display_manager.c`
- [LVGL UI engine](https://github.com/spooks4576/ghost_esp/blob/main/components/lvgl/src/core/lv_obj.c): `components/lvgl/src/core/lv_obj.c`
- [Terminal screen](https://github.com/spooks4576/ghost_esp/blob/main/include/managers/views/terminal_screen.h): `include/managers/views/terminal_screen.h`
- [Joystick input](https://github.com/spooks4576/ghost_esp/blob/main/include/managers/joystick_manager.h): `include/managers/joystick_manager.h`
- [M5 graphics](https://github.com/spooks4576/ghost_esp/blob/main/components/M5GFX/src/M5GFX.cpp): `components/M5GFX/src/M5GFX.cpp`

### Other components

- **Device operator**

## Connections

- Device operator → Serial manager: sends commands
- Firmware startup → Serial manager: initializes (evidence: `main/main.c`)
- Firmware startup → Wi-Fi tools: initializes (evidence: `main/main.c`)
- Firmware startup → Command line: starts commands (evidence: `main/main.c`)
- Firmware startup → Settings: loads settings (evidence: `main/main.c`)
- Firmware startup → AP services: initializes (evidence: `main/main.c`)
- Firmware startup → SD storage: initializes (evidence: `main/main.c`)
- Firmware startup → Display manager: initializes (evidence: `main/main.c`)
- Firmware startup → RGB effects: initializes (evidence: `main/main.c`)
- Firmware startup → Bluetooth LE: includes optionally (evidence: `main/main.c`)
- Serial manager → Task manager: uses task APIs
- Wi-Fi tools → AP services: references manager
- Wi-Fi tools → Settings: references settings
- Wi-Fi tools → RGB effects: references effects
- Display manager → LVGL UI engine: uses UI engine
- Display manager → Joystick input: uses input
- Terminal screen → Display manager: references manager
- Terminal screen → AP services: references manager
- Firmware startup → mDNS service: may use service
- Firmware startup → Dial manager: may initialize
- Display manager → M5 graphics: may use graphics
