# grandkahuna43325/comp-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/grandkahuna43325/comp-tracker
- Repository: https://github.com/grandkahuna43325/comp-tracker

## Overview

Comp tracker is a browser-based ice-swimming competition tracker, with a hand-written C backend. The main workflow loads competition data, lets users search and select competitions, and displays details for viewing or editing. Users can also enter competition details and save them. Keyboard navigation, contextual help, and notifications support these flows. The excerpts show frontend calls and HTTP endpoints; backend implementation details and the persistence wiring are not shown, so those relationships are left unverified.

Main entry points: [`frontend/index.js`](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/index.js) (App bootstrap), [`frontend/script/keys.js`](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/keys.js) (Keyboard controls), [`frontend/script/backend.js`](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/backend.js) (Data client), [`frontend/script/list.js`](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/list.js) (Competition list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser application"]
  node_app["App bootstrap<br/>[index.js]"]
  node_keys["Keyboard controls<br/>[keys.js]"]
  node_list["Competition list<br/>[list.js]"]
  node_fuzzy["Fuzzy matching<br/>[js-fuzzyMatch.js]"]
  node_overlay["Details and editing<br/>[overlay.js]"]
  node_add["Competition entry<br/>[add_event.js]"]
  node_navigation["Panel navigation<br/>[nav.js]"]
  node_help["Keyboard help<br/>[help.js]"]
  node_notifications["Notifications<br/>[notification.js]"]
  node_backend_client["Data client<br/>[backend.js]"]
end

subgraph group_backend["C backend"]
  node_server["C server<br/>[server.c]"]
  node_entry["Server entry<br/>[main.c]"]
end

subgraph group_internals["Backend internals"]
  node_file["File handling<br/>[file.c]"]
  node_vector["Character vector<br/>[vector.c]"]
end

node_user(("User"))
node_http["HTTP API"]

node_user -->|"uses"| node_app
node_app -->|"loads data"| node_backend_client
node_app -->|"sets up"| node_keys
node_app -->|"sets up"| node_list
node_app -->|"sets up"| node_add
node_app -->|"sets up"| node_help
node_app -->|"sets up"| node_notifications
node_keys -->|"controls"| node_list
node_keys -->|"controls"| node_overlay
node_keys -->|"controls"| node_add
node_keys -->|"changes panels"| node_navigation
node_keys -->|"shows"| node_help
node_list -->|"matches entries"| node_fuzzy
node_list -->|"reads competitions"| node_backend_client
node_add -->|"submits competition"| node_backend_client
node_overlay -->|"saves edits"| node_backend_client
node_backend_client -->|"fetches data"| node_http
node_http -.->|"routes requests"| node_server
node_server -.->|"uses file storage"| node_file
node_server -.->|"uses buffer"| node_vector
node_entry -.->|"starts server"| node_server

click node_app "https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/index.js"
click node_keys "https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/keys.js"
click node_list "https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/list.js"
click node_fuzzy "https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/lib/FuzzyMatch/js-fuzzyMatch.js"
click node_overlay "https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/overlay.js"
click node_add "https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/add_event.js"
click node_navigation "https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/nav.js"
click node_help "https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/help.js"
click node_notifications "https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/notification.js"
click node_backend_client "https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/backend.js"
click node_server "https://github.com/grandkahuna43325/comp-tracker/blob/main/src/server.c"
click node_entry "https://github.com/grandkahuna43325/comp-tracker/blob/main/src/main.c"
click node_file "https://github.com/grandkahuna43325/comp-tracker/blob/main/src/file.c"
click node_vector "https://github.com/grandkahuna43325/comp-tracker/blob/main/src/vector.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_app,node_keys,node_list,node_fuzzy,node_overlay,node_add,node_navigation,node_help,node_notifications,node_backend_client,node_user toneBlue
class node_server,node_entry toneAmber
class node_file,node_vector,node_http toneMint
```

## Components

### Browser application

- [App bootstrap](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/index.js): `frontend/index.js`
- [Keyboard controls](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/keys.js): `frontend/script/keys.js`
- [Competition list](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/list.js): `frontend/script/list.js`
- [Fuzzy matching](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/lib/FuzzyMatch/js-fuzzyMatch.js): `frontend/lib/FuzzyMatch/js-fuzzyMatch.js`
- [Details and editing](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/overlay.js): `frontend/script/overlay.js`
- [Competition entry](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/add_event.js): `frontend/script/add_event.js`
- [Panel navigation](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/nav.js): `frontend/script/nav.js`
- [Keyboard help](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/help.js): `frontend/script/help.js`
- [Notifications](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/notification.js): `frontend/script/notification.js`
- [Data client](https://github.com/grandkahuna43325/comp-tracker/blob/main/frontend/script/backend.js): `frontend/script/backend.js`

### C backend

- [C server](https://github.com/grandkahuna43325/comp-tracker/blob/main/src/server.c): `src/server.c`
- [Server entry](https://github.com/grandkahuna43325/comp-tracker/blob/main/src/main.c): `src/main.c`

### Backend internals

- [File handling](https://github.com/grandkahuna43325/comp-tracker/blob/main/src/file.c): `src/file.c`
- [Character vector](https://github.com/grandkahuna43325/comp-tracker/blob/main/src/vector.c): `src/vector.c`

### Other components

- **User**
- **HTTP API**

## Connections

- User → App bootstrap: uses (evidence: `Readme.md`)
- App bootstrap → Data client: loads data (evidence: `frontend/index.js`)
- App bootstrap → Keyboard controls: sets up (evidence: `frontend/index.js`)
- App bootstrap → Competition list: sets up (evidence: `frontend/index.js`)
- App bootstrap → Competition entry: sets up (evidence: `frontend/index.js`)
- App bootstrap → Keyboard help: sets up (evidence: `frontend/index.js`)
- App bootstrap → Notifications: sets up (evidence: `frontend/index.js`)
- Keyboard controls → Competition list: controls (evidence: `frontend/script/keys.js`)
- Keyboard controls → Details and editing: controls (evidence: `frontend/script/keys.js`)
- Keyboard controls → Competition entry: controls (evidence: `frontend/script/keys.js`)
- Keyboard controls → Panel navigation: changes panels (evidence: `frontend/script/keys.js`)
- Keyboard controls → Keyboard help: shows (evidence: `frontend/script/keys.js`)
- Competition list → Fuzzy matching: matches entries (evidence: `frontend/script/list.js`)
- Competition list → Data client: reads competitions (evidence: `frontend/script/list.js`)
- Competition entry → Data client: submits competition (evidence: `frontend/script/add_event.js`)
- Details and editing → Data client: saves edits (evidence: `frontend/script/overlay.js`)
- Data client → HTTP API: fetches data (evidence: `frontend/script/backend.js`)
- HTTP API → C server: routes requests
- C server → File handling: uses file storage
- C server → Character vector: uses buffer
- Server entry → C server: starts server
