# itsthatmatthew/abckoth architecture

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

- Interactive diagram: https://gitdiagram.com/itsthatmatthew/abckoth
- Repository: https://github.com/itsthatmatthew/abckoth

## Overview

ABcKotH is ESP32 software for an airsoft King-of-the-Hill briefcase. On startup, the firmware creates the game controller and a Wi-Fi access point/web server. Players use physical buttons to change team capture state; elapsed capture time is tracked and shown on the LCD, while LEDs indicate activity. Wi-Fi clients can reach the hosted web content through the server and its DNS service. The sampled source supports these runtime relationships; web assets are listed from the repository tree, but their generated inclusion step is not part of this runtime map.

Main entry points: [`src/briefcase.cpp`](https://github.com/itsthatmatthew/abckoth/blob/main/src/briefcase.cpp) (Capture game), [`src/net/webserver.cpp`](https://github.com/itsthatmatthew/abckoth/blob/main/src/net/webserver.cpp) (Access point server), [`src/utils/hw/button.h`](https://github.com/itsthatmatthew/abckoth/blob/main/src/utils/hw/button.h) (Debounced buttons), [`src/main.cpp`](https://github.com/itsthatmatthew/abckoth/blob/main/src/main.cpp) (Firmware startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game control"]
  node_main["Firmware startup<br/>[main.cpp]"]
  node_briefcase["Capture game<br/>[briefcase.cpp]"]
  node_task["Task runtime<br/>[task.h]"]
end

subgraph group_hardware["Briefcase hardware"]
  node_buttons["Debounced buttons<br/>[button.h]"]
  node_leds["LED controls<br/>[led.h]"]
  node_lcd["LCD display<br/>[briefcase.cpp]"]
  node_physical_inputs(("Physical buttons"))
end

subgraph group_network["Wi-Fi interface"]
  node_webserver["Access point server<br/>[webserver.cpp]"]
  node_dns["DNS service<br/>[webserver.cpp]"]
end

subgraph group_content["Web content"]
  node_web_assets["Web assets"]
  node_notfound["Not-found page<br/>[notfound.html]"]
end

node_players(("Players"))
node_wifi_clients(("Wi-Fi clients"))

node_players -->|"press"| node_physical_inputs
node_physical_inputs -->|"electrical input"| node_buttons
node_main -->|"creates game"| node_briefcase
node_main -->|"creates server"| node_webserver
node_briefcase -->|"starts task"| node_task
node_briefcase -->|"reads inputs"| node_buttons
node_buttons -->|"invokes callbacks"| node_briefcase
node_briefcase -->|"sets indicators"| node_leds
node_briefcase -->|"prints standings"| node_lcd
node_webserver -->|"serves routes"| node_web_assets
node_webserver -->|"serves fallback"| node_notfound
node_webserver -->|"starts DNS"| node_dns
node_wifi_clients -->|"requests pages"| node_webserver
node_wifi_clients -->|"resolves hostname"| node_dns

click node_main "https://github.com/itsthatmatthew/abckoth/blob/main/src/main.cpp"
click node_briefcase "https://github.com/itsthatmatthew/abckoth/blob/main/src/briefcase.cpp"
click node_task "https://github.com/itsthatmatthew/abckoth/blob/main/src/utils/sw/task.h"
click node_buttons "https://github.com/itsthatmatthew/abckoth/blob/main/src/utils/hw/button.h"
click node_leds "https://github.com/itsthatmatthew/abckoth/blob/main/src/utils/hw/led.h"
click node_lcd "https://github.com/itsthatmatthew/abckoth/blob/main/src/briefcase.cpp"
click node_webserver "https://github.com/itsthatmatthew/abckoth/blob/main/src/net/webserver.cpp"
click node_dns "https://github.com/itsthatmatthew/abckoth/blob/main/src/net/webserver.cpp"
click node_web_assets "https://github.com/itsthatmatthew/abckoth/tree/main/src/net/websrc"
click node_notfound "https://github.com/itsthatmatthew/abckoth/blob/main/src/net/websrc/notfound.html"

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_briefcase,node_task,node_wifi_clients toneBlue
class node_buttons,node_leds,node_lcd,node_physical_inputs toneAmber
class node_webserver,node_dns toneMint
class node_web_assets,node_notfound toneRose
class node_players toneIndigo
```

## Components

### Game control

- [Firmware startup](https://github.com/itsthatmatthew/abckoth/blob/main/src/main.cpp): `src/main.cpp`
- [Capture game](https://github.com/itsthatmatthew/abckoth/blob/main/src/briefcase.cpp): `src/briefcase.cpp`
- [Task runtime](https://github.com/itsthatmatthew/abckoth/blob/main/src/utils/sw/task.h): `src/utils/sw/task.h`

### Briefcase hardware

- [Debounced buttons](https://github.com/itsthatmatthew/abckoth/blob/main/src/utils/hw/button.h): `src/utils/hw/button.h`
- [LED controls](https://github.com/itsthatmatthew/abckoth/blob/main/src/utils/hw/led.h): `src/utils/hw/led.h`
- [LCD display](https://github.com/itsthatmatthew/abckoth/blob/main/src/briefcase.cpp): `src/briefcase.cpp`
- **Physical buttons**

### Wi-Fi interface

- [Access point server](https://github.com/itsthatmatthew/abckoth/blob/main/src/net/webserver.cpp): `src/net/webserver.cpp`
- [DNS service](https://github.com/itsthatmatthew/abckoth/blob/main/src/net/webserver.cpp): `src/net/webserver.cpp`

### Web content

- [Web assets](https://github.com/itsthatmatthew/abckoth/tree/main/src/net/websrc): `src/net/websrc`
- [Not-found page](https://github.com/itsthatmatthew/abckoth/blob/main/src/net/websrc/notfound.html): `src/net/websrc/notfound.html`

### Other components

- **Players**
- **Wi-Fi clients**

## Connections

- Players → Physical buttons: press
- Physical buttons → Debounced buttons: electrical input
- Firmware startup → Capture game: creates game
- Firmware startup → Access point server: creates server
- Capture game → Task runtime: starts task
- Capture game → Debounced buttons: reads inputs
- Debounced buttons → Capture game: invokes callbacks
- Capture game → LED controls: sets indicators
- Capture game → LCD display: prints standings
- Access point server → Web assets: serves routes
- Access point server → Not-found page: serves fallback
- Access point server → DNS service: starts DNS
- Wi-Fi clients → Access point server: requests pages
- Wi-Fi clients → DNS service: resolves hostname
