# perfluorohexyloctane/excellence architecture

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

- Interactive diagram: https://gitdiagram.com/perfluorohexyloctane/excellence
- Repository: https://github.com/perfluorohexyloctane/excellence

## Overview

Excellence is a browser-based treasure-hunt game. Players browse available hunts, choose one, create or resume a session, answer or skip questions, and view the leaderboard. The sampled controllers show hunt-list retrieval and rendering, game-session/API handling, and cookie-backed session state; the service worker caches app files for offline use. Other page names indicate additional screens, but their behavior is not established by the excerpts, so their connections are left out.

Main entry points: [`js/list.js`](https://github.com/perfluorohexyloctane/excellence/blob/main/js/list.js) (Hunt list), [`js/apiFetcher.js`](https://github.com/perfluorohexyloctane/excellence/blob/main/js/apiFetcher.js) (Session and questions), [`js/cookies.js`](https://github.com/perfluorohexyloctane/excellence/blob/main/js/cookies.js) (Session cookies), [`js/serviceWorker.js`](https://github.com/perfluorohexyloctane/excellence/blob/main/js/serviceWorker.js) (Offline cache handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hunt_discovery["Hunt discovery"]
  node_hunt_list["Hunt list<br/>[list.js]"]
  node_hunt_page["Hunt selection screen<br/>[list.html]"]
  node_app_page["App screen<br/>[app.html]"]
  node_challenges_page["Challenges screen<br/>[challenges.html]"]
end

subgraph group_gameplay["Gameplay"]
  node_game_session["Session and questions<br/>[apiFetcher.js]"]
  node_session_cookies["Session cookies<br/>[cookies.js]"]
  node_start_page["Game screen<br/>[start.html]"]
  node_leaderboard_page["Leaderboard screen<br/>[leaderboard.html]"]
  node_notes_page["Notes screen<br/>[notes.html]"]
end

subgraph group_offline["Offline support"]
  node_service_worker["Offline cache handler<br/>[serviceWorker.js]"]
  node_browser_cache[("Browser cache")]
end

node_player(("Player"))
node_hunt_api{{"CodeCyprus API"}}

node_player -->|"browses hunts"| node_hunt_list
node_hunt_list -->|"fetches hunts"| node_hunt_api
node_hunt_list -->|"links to game"| node_start_page
node_player -->|"plays hunt"| node_game_session
node_game_session -->|"starts and plays"| node_hunt_api
node_game_session -->|"uses session state"| node_session_cookies
node_hunt_list -->|"checks saved session"| node_session_cookies
node_game_session -->|"redirects on completion"| node_leaderboard_page
node_service_worker -->|"stores and serves files"| node_browser_cache

click node_hunt_list "https://github.com/perfluorohexyloctane/excellence/blob/main/js/list.js"
click node_game_session "https://github.com/perfluorohexyloctane/excellence/blob/main/js/apiFetcher.js"
click node_session_cookies "https://github.com/perfluorohexyloctane/excellence/blob/main/js/cookies.js"
click node_start_page "https://github.com/perfluorohexyloctane/excellence/blob/main/start.html"
click node_leaderboard_page "https://github.com/perfluorohexyloctane/excellence/blob/main/leaderboard.html"
click node_service_worker "https://github.com/perfluorohexyloctane/excellence/blob/main/js/serviceWorker.js"
click node_hunt_page "https://github.com/perfluorohexyloctane/excellence/blob/main/list.html"
click node_app_page "https://github.com/perfluorohexyloctane/excellence/blob/main/app.html"
click node_challenges_page "https://github.com/perfluorohexyloctane/excellence/blob/main/challenges.html"
click node_notes_page "https://github.com/perfluorohexyloctane/excellence/blob/main/notes.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_hunt_list,node_hunt_page,node_app_page,node_challenges_page toneBlue
class node_game_session,node_session_cookies,node_start_page,node_leaderboard_page,node_notes_page toneAmber
class node_service_worker,node_browser_cache,node_hunt_api toneMint
class node_player toneIndigo
```

## Components

### Hunt discovery

- [Hunt list](https://github.com/perfluorohexyloctane/excellence/blob/main/js/list.js): `js/list.js`
- [Hunt selection screen](https://github.com/perfluorohexyloctane/excellence/blob/main/list.html): `list.html`
- [App screen](https://github.com/perfluorohexyloctane/excellence/blob/main/app.html): `app.html`
- [Challenges screen](https://github.com/perfluorohexyloctane/excellence/blob/main/challenges.html): `challenges.html`

### Gameplay

- [Session and questions](https://github.com/perfluorohexyloctane/excellence/blob/main/js/apiFetcher.js): `js/apiFetcher.js`
- [Session cookies](https://github.com/perfluorohexyloctane/excellence/blob/main/js/cookies.js): `js/cookies.js`
- [Game screen](https://github.com/perfluorohexyloctane/excellence/blob/main/start.html): `start.html`
- [Leaderboard screen](https://github.com/perfluorohexyloctane/excellence/blob/main/leaderboard.html): `leaderboard.html`
- [Notes screen](https://github.com/perfluorohexyloctane/excellence/blob/main/notes.html): `notes.html`

### Offline support

- [Offline cache handler](https://github.com/perfluorohexyloctane/excellence/blob/main/js/serviceWorker.js): `js/serviceWorker.js`
- **Browser cache**

### Other components

- **Player**
- **CodeCyprus API**

## Connections

- Player → Hunt list: browses hunts (evidence: `js/list.js`)
- Hunt list → CodeCyprus API: fetches hunts (evidence: `js/list.js`)
- Hunt list → Game screen: links to game (evidence: `js/list.js`)
- Player → Session and questions: plays hunt (evidence: `js/apiFetcher.js`)
- Session and questions → CodeCyprus API: starts and plays (evidence: `js/apiFetcher.js`)
- Session and questions → Session cookies: uses session state (evidence: `js/apiFetcher.js`)
- Hunt list → Session cookies: checks saved session (evidence: `js/list.js`)
- Session and questions → Leaderboard screen: redirects on completion (evidence: `js/apiFetcher.js`)
- Offline cache handler → Browser cache: stores and serves files (evidence: `js/serviceWorker.js`)
