# sanool/esp-labs architecture

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

- Interactive diagram: https://gitdiagram.com/sanool/esp-labs
- Repository: https://github.com/sanool/esp-labs

## Overview

esp-labs is a hands-on ESP32-S3 learning course: learners progress through standalone hardware labs, reuse shared firmware kits, and use companion apps for selected exercises. The graph groups labs by subject and highlights the reusable BLE, sound, and Wi-Fi runtime layers alongside the documented dashboard, card-management, friends, and BLE app capabilities. Relationships come from the README and shown source references; unsampled application internals and unshown runtime links are not inferred.

Main entry points: [`labs/wifi-lab-w2/src/main.cpp`](https://github.com/sanool/esp-labs/blob/main/labs/wifi-lab-w2/src/main.cpp) (Wi-Fi labs), [`labs/ble-lab-b7/src/main.cpp`](https://github.com/sanool/esp-labs/blob/main/labs/ble-lab-b7/src/main.cpp) (Bluetooth LE labs), [`labs/rfid-lab-r7/src/main.cpp`](https://github.com/sanool/esp-labs/blob/main/labs/rfid-lab-r7/src/main.cpp) (RFID and NFC), [`labs/sound-lab-s6/src/main.cpp`](https://github.com/sanool/esp-labs/blob/main/labs/sound-lab-s6/src/main.cpp) (Sound labs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_course["Learning labs"]
  node_intro["Intro and display<br/>[main.cpp]"]
  node_wifi_labs["Wi-Fi labs<br/>[main.cpp]"]
  node_internet_lab["Internet and AI<br/>[main.cpp]"]
  node_rfid_labs["RFID and NFC<br/>[main.cpp]"]
  node_friends_lab["Card friends lab<br/>[main.cpp]"]
  node_ble_labs["Bluetooth LE labs<br/>[main.cpp]"]
  node_ble_host["BLE host lab<br/>[central.h]"]
  node_sound_labs["Sound labs<br/>[main.cpp]"]
  node_voice_fx["Voice effects lab<br/>[main.cpp]"]
end

subgraph group_kits["Shared firmware kits"]
  node_ble_shell["BLE lab shell<br/>[ble_lab.h]"]
  node_ble_link["BLE peripheral link<br/>[server_link.h]"]
  node_ble_views["BLE bench views<br/>[bench_views.h]"]
  node_sound_shell["Sound lab shell<br/>[sound_lab.h]"]
  node_sound_analysis["Sound analysis<br/>[onsets.h]"]
  node_wifi_connection["Wi-Fi connection<br/>[connection.h]"]
  node_wifi_scan["Wi-Fi scanning<br/>[scanner.h]"]
end

subgraph group_companions["Companion apps"]
  node_door_app["Door card manager<br/>[App.tsx]"]
  node_friends_app["Friends stage app<br/>[App.tsx]"]
  node_ble_app["BLE phone app<br/>[App.tsx]"]
  node_dashboard["Bench dashboard<br/>[app.ts]"]
  node_ai_gateway["AI gateway<br/>[pyproject.toml]"]
end

subgraph group_actors["People and devices"]
  node_learner(("Learner"))
  node_bleard{{"ESP32-S3 board"}}
end

node_learner -->|"learns with"| node_intro
node_learner -->|"learns with"| node_wifi_labs
node_learner -->|"learns with"| node_rfid_labs
node_learner -->|"learns with"| node_ble_labs
node_learner -->|"learns with"| node_sound_labs
node_bleard -.->|"runs firmware"| node_wifi_labs
node_bleard -.->|"runs firmware"| node_rfid_labs
node_bleard -.->|"runs firmware"| node_ble_labs
node_bleard -.->|"runs firmware"| node_sound_labs
node_bleard -.->|"runs firmware"| node_intro
node_wifi_labs -->|"uses"| node_wifi_connection
node_wifi_labs -->|"uses"| node_wifi_scan
node_internet_lab -->|"checks connection"| node_wifi_connection
node_internet_lab -->|"asks AI through"| node_ai_gateway
node_wifi_labs -->|"companion app"| node_dashboard
node_rfid_labs -->|"companion app"| node_door_app
node_friends_lab -->|"companion app"| node_friends_app
node_ble_labs -->|"companion app"| node_ble_app
node_ble_host -->|"uses shell"| node_ble_shell
node_ble_labs -->|"uses shell"| node_ble_shell
node_ble_shell -->|"renders views"| node_ble_views
node_ble_labs -->|"uses link"| node_ble_link
node_sound_labs -->|"uses shell"| node_sound_shell
node_voice_fx -->|"uses shell"| node_sound_shell
node_sound_shell -->|"provides sound tools"| node_sound_analysis
node_rfid_labs -->|"builds on"| node_friends_lab

click node_intro "https://github.com/sanool/esp-labs/blob/main/labs/03b-showcase/src/main.cpp"
click node_wifi_labs "https://github.com/sanool/esp-labs/blob/main/labs/wifi-lab-w2/src/main.cpp"
click node_internet_lab "https://github.com/sanool/esp-labs/blob/main/labs/wifi-lab-w3/src/main.cpp"
click node_rfid_labs "https://github.com/sanool/esp-labs/blob/main/labs/rfid-lab-r7/src/main.cpp"
click node_friends_lab "https://github.com/sanool/esp-labs/blob/main/labs/rfid-lab-r8/src/main.cpp"
click node_ble_labs "https://github.com/sanool/esp-labs/blob/main/labs/ble-lab-b7/src/main.cpp"
click node_ble_host "https://github.com/sanool/esp-labs/blob/main/labs/ble-lab-b8/src/central.h"
click node_sound_labs "https://github.com/sanool/esp-labs/blob/main/labs/sound-lab-s6/src/main.cpp"
click node_voice_fx "https://github.com/sanool/esp-labs/blob/main/labs/sound-lab-s8/src/main.cpp"
click node_ble_shell "https://github.com/sanool/esp-labs/blob/main/kit/lib/ble-kit/src/ble_lab.h"
click node_ble_link "https://github.com/sanool/esp-labs/blob/main/kit/lib/ble-kit/src/server_link.h"
click node_ble_views "https://github.com/sanool/esp-labs/blob/main/kit/lib/ble-kit/src/bench_views.h"
click node_sound_shell "https://github.com/sanool/esp-labs/blob/main/kit/lib/sound-kit/src/sound_lab.h"
click node_sound_analysis "https://github.com/sanool/esp-labs/blob/main/kit/lib/sound-kit/src/onsets.h"
click node_wifi_connection "https://github.com/sanool/esp-labs/blob/main/kit/lib/wifi-kit/src/connection.h"
click node_wifi_scan "https://github.com/sanool/esp-labs/blob/main/kit/lib/wifi-kit/src/scanner.h"
click node_door_app "https://github.com/sanool/esp-labs/blob/main/apps/door-app/src/App.tsx"
click node_friends_app "https://github.com/sanool/esp-labs/blob/main/apps/friends-app/src/App.tsx"
click node_ble_app "https://github.com/sanool/esp-labs/blob/main/apps/ble-app/src/App.tsx"
click node_dashboard "https://github.com/sanool/esp-labs/blob/main/apps/dashboard/server/src/app.ts"
click node_ai_gateway "https://github.com/sanool/esp-labs/blob/main/apps/ai-gateway/pyproject.toml"

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_intro,node_wifi_labs,node_internet_lab,node_rfid_labs,node_friends_lab,node_ble_labs,node_ble_host,node_sound_labs,node_voice_fx toneBlue
class node_ble_shell,node_ble_link,node_ble_views,node_sound_shell,node_sound_analysis,node_wifi_connection,node_wifi_scan toneAmber
class node_door_app,node_friends_app,node_ble_app,node_dashboard,node_ai_gateway toneMint
class node_learner,node_bleard toneRose
```

## Components

### Learning labs

- [Intro and display](https://github.com/sanool/esp-labs/blob/main/labs/03b-showcase/src/main.cpp): `labs/03b-showcase/src/main.cpp`
- [Wi-Fi labs](https://github.com/sanool/esp-labs/blob/main/labs/wifi-lab-w2/src/main.cpp): `labs/wifi-lab-w2/src/main.cpp`
- [Internet and AI](https://github.com/sanool/esp-labs/blob/main/labs/wifi-lab-w3/src/main.cpp): `labs/wifi-lab-w3/src/main.cpp`
- [RFID and NFC](https://github.com/sanool/esp-labs/blob/main/labs/rfid-lab-r7/src/main.cpp): `labs/rfid-lab-r7/src/main.cpp`
- [Card friends lab](https://github.com/sanool/esp-labs/blob/main/labs/rfid-lab-r8/src/main.cpp): `labs/rfid-lab-r8/src/main.cpp`
- [Bluetooth LE labs](https://github.com/sanool/esp-labs/blob/main/labs/ble-lab-b7/src/main.cpp): `labs/ble-lab-b7/src/main.cpp`
- [BLE host lab](https://github.com/sanool/esp-labs/blob/main/labs/ble-lab-b8/src/central.h): `labs/ble-lab-b8/src/central.h`
- [Sound labs](https://github.com/sanool/esp-labs/blob/main/labs/sound-lab-s6/src/main.cpp): `labs/sound-lab-s6/src/main.cpp`
- [Voice effects lab](https://github.com/sanool/esp-labs/blob/main/labs/sound-lab-s8/src/main.cpp): `labs/sound-lab-s8/src/main.cpp`

### Shared firmware kits

- [BLE lab shell](https://github.com/sanool/esp-labs/blob/main/kit/lib/ble-kit/src/ble_lab.h): `kit/lib/ble-kit/src/ble_lab.h`
- [BLE peripheral link](https://github.com/sanool/esp-labs/blob/main/kit/lib/ble-kit/src/server_link.h): `kit/lib/ble-kit/src/server_link.h`
- [BLE bench views](https://github.com/sanool/esp-labs/blob/main/kit/lib/ble-kit/src/bench_views.h): `kit/lib/ble-kit/src/bench_views.h`
- [Sound lab shell](https://github.com/sanool/esp-labs/blob/main/kit/lib/sound-kit/src/sound_lab.h): `kit/lib/sound-kit/src/sound_lab.h`
- [Sound analysis](https://github.com/sanool/esp-labs/blob/main/kit/lib/sound-kit/src/onsets.h): `kit/lib/sound-kit/src/onsets.h`
- [Wi-Fi connection](https://github.com/sanool/esp-labs/blob/main/kit/lib/wifi-kit/src/connection.h): `kit/lib/wifi-kit/src/connection.h`
- [Wi-Fi scanning](https://github.com/sanool/esp-labs/blob/main/kit/lib/wifi-kit/src/scanner.h): `kit/lib/wifi-kit/src/scanner.h`

### Companion apps

- [Door card manager](https://github.com/sanool/esp-labs/blob/main/apps/door-app/src/App.tsx): `apps/door-app/src/App.tsx`
- [Friends stage app](https://github.com/sanool/esp-labs/blob/main/apps/friends-app/src/App.tsx): `apps/friends-app/src/App.tsx`
- [BLE phone app](https://github.com/sanool/esp-labs/blob/main/apps/ble-app/src/App.tsx): `apps/ble-app/src/App.tsx`
- [Bench dashboard](https://github.com/sanool/esp-labs/blob/main/apps/dashboard/server/src/app.ts): `apps/dashboard/server/src/app.ts`
- [AI gateway](https://github.com/sanool/esp-labs/blob/main/apps/ai-gateway/pyproject.toml): `apps/ai-gateway/pyproject.toml`

### People and devices

- **Learner**
- **ESP32-S3 board**

## Connections

- Learner → Intro and display: learns with (evidence: `README.md`)
- Learner → Wi-Fi labs: learns with (evidence: `README.md`)
- Learner → RFID and NFC: learns with (evidence: `README.md`)
- Learner → Bluetooth LE labs: learns with (evidence: `README.md`)
- Learner → Sound labs: learns with (evidence: `README.md`)
- ESP32-S3 board → Wi-Fi labs: runs firmware
- ESP32-S3 board → RFID and NFC: runs firmware
- ESP32-S3 board → Bluetooth LE labs: runs firmware
- ESP32-S3 board → Sound labs: runs firmware
- ESP32-S3 board → Intro and display: runs firmware
- Wi-Fi labs → Wi-Fi connection: uses (evidence: `labs/wifi-lab-w2/src/main.cpp`)
- Wi-Fi labs → Wi-Fi scanning: uses (evidence: `labs/wifi-lab-w2/src/main.cpp`)
- Internet and AI → Wi-Fi connection: checks connection (evidence: `labs/wifi-lab-w3/src/main.cpp`)
- Internet and AI → AI gateway: asks AI through (evidence: `README.md`)
- Wi-Fi labs → Bench dashboard: companion app (evidence: `README.md`)
- RFID and NFC → Door card manager: companion app (evidence: `README.md`)
- Card friends lab → Friends stage app: companion app (evidence: `README.md`)
- Bluetooth LE labs → BLE phone app: companion app (evidence: `README.md`)
- BLE host lab → BLE lab shell: uses shell (evidence: `labs/ble-lab-b8/src/main.cpp`)
- Bluetooth LE labs → BLE lab shell: uses shell (evidence: `labs/ble-lab-b7/src/main.cpp`)
- BLE lab shell → BLE bench views: renders views (evidence: `kit/lib/ble-kit/src/ble_lab.h`)
- Bluetooth LE labs → BLE peripheral link: uses link (evidence: `labs/ble-lab-b7/src/main.cpp`)
- Sound labs → Sound lab shell: uses shell (evidence: `labs/sound-lab-s6/src/main.cpp`)
- Voice effects lab → Sound lab shell: uses shell (evidence: `labs/sound-lab-s8/src/main.cpp`)
- Sound lab shell → Sound analysis: provides sound tools (evidence: `kit/lib/sound-kit/src/sound_lab.h`)
- RFID and NFC → Card friends lab: builds on (evidence: `README.md`)
