# sinator12/css-codequest architecture

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

- Interactive diagram: https://gitdiagram.com/sinator12/css-codequest
- Repository: https://github.com/sinator12/css-codequest

## Overview

CSS CodeQuest is a browser-based CSS learning game. Players enter through the mode hub, choose a story battle, free-form sandbox, or structured lesson, then build CSS skills and track progression. The main internal layer is PlayerProgress, which stores XP, streaks, results, and topic diagnostics in localStorage. The README documents the mode and lesson wiring; sampled game and progress code confirms battle result updates and persistence. HTML page internals were not sampled, so those links rely on README statements. The curriculum builder is a development script, not a runtime product component.

Main entry points: [`index.html`](https://github.com/sinator12/css-codequest/blob/main/index.html) (Mode Hub), [`progress.js`](https://github.com/sinator12/css-codequest/blob/main/progress.js) (Progress System), [`learn.html`](https://github.com/sinator12/css-codequest/blob/main/learn.html) (Lesson Browser), [`auth.js`](https://github.com/sinator12/css-codequest/blob/main/auth.js) (Google Auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and Identity"]
  node_hub["Mode Hub<br/>[index.html]"]
  node_auth["Google Auth<br/>[auth.js]"]
end

subgraph group_adventure["Adventure Mode"]
  node_adventure_map["Adventure Map<br/>[adventure.html]"]
  node_battle["Battle Arena<br/>[game.html]"]
  node_game_logic["Battle Logic<br/>[game.js]"]
end

subgraph group_learning["CSS Learning"]
  node_practice["Practice Sandbox<br/>[practice.html]"]
  node_lessons["Lesson Browser<br/>[learn.html]"]
  node_curriculum["CSS Curriculum<br/>[w3_lessons.js]"]
end

subgraph group_progress["Progression"]
  node_progress_api["Progress System<br/>[progress.js]"]
  node_local_storage[("Browser Storage")]
end

node_player(("Player"))
node_firebase["Firebase Auth"]

node_player -->|"opens"| node_hub
node_hub -->|"selects mode"| node_adventure_map
node_adventure_map -->|"opens stage"| node_battle
node_battle -->|"runs"| node_game_logic
node_game_logic -->|"records results"| node_progress_api
node_hub -->|"shows stats"| node_progress_api
node_progress_api -->|"reads and writes"| node_local_storage
node_hub -->|"selects mode"| node_practice
node_practice -->|"previews CSS"| node_player
node_hub -->|"selects mode"| node_lessons
node_lessons -->|"uses lessons"| node_curriculum
node_lessons -.->|"tracks completion"| node_progress_api
node_player -->|"signs in"| node_auth
node_auth -->|"authenticates with"| node_firebase

click node_hub "https://github.com/sinator12/css-codequest/blob/main/index.html"
click node_auth "https://github.com/sinator12/css-codequest/blob/main/auth.js"
click node_adventure_map "https://github.com/sinator12/css-codequest/blob/main/adventure.html"
click node_battle "https://github.com/sinator12/css-codequest/blob/main/game.html"
click node_game_logic "https://github.com/sinator12/css-codequest/blob/main/game.js"
click node_practice "https://github.com/sinator12/css-codequest/blob/main/practice.html"
click node_lessons "https://github.com/sinator12/css-codequest/blob/main/learn.html"
click node_curriculum "https://github.com/sinator12/css-codequest/blob/main/w3_lessons.js"
click node_progress_api "https://github.com/sinator12/css-codequest/blob/main/progress.js"

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_hub,node_auth toneBlue
class node_adventure_map,node_battle,node_game_logic toneAmber
class node_practice,node_lessons,node_curriculum toneMint
class node_progress_api,node_local_storage toneRose
class node_player,node_firebase toneIndigo
```

## Components

### Entry and Identity

- [Mode Hub](https://github.com/sinator12/css-codequest/blob/main/index.html): `index.html`
- [Google Auth](https://github.com/sinator12/css-codequest/blob/main/auth.js): `auth.js`

### Adventure Mode

- [Adventure Map](https://github.com/sinator12/css-codequest/blob/main/adventure.html): `adventure.html`
- [Battle Arena](https://github.com/sinator12/css-codequest/blob/main/game.html): `game.html`
- [Battle Logic](https://github.com/sinator12/css-codequest/blob/main/game.js): `game.js`

### CSS Learning

- [Practice Sandbox](https://github.com/sinator12/css-codequest/blob/main/practice.html): `practice.html`
- [Lesson Browser](https://github.com/sinator12/css-codequest/blob/main/learn.html): `learn.html`
- [CSS Curriculum](https://github.com/sinator12/css-codequest/blob/main/w3_lessons.js): `w3_lessons.js`

### Progression

- [Progress System](https://github.com/sinator12/css-codequest/blob/main/progress.js): `progress.js`
- **Browser Storage**

### Other components

- **Player**
- **Firebase Auth**

## Connections

- Player → Mode Hub: opens (evidence: `README.md`)
- Mode Hub → Adventure Map: selects mode (evidence: `README.md`)
- Adventure Map → Battle Arena: opens stage (evidence: `README.md`)
- Battle Arena → Battle Logic: runs (evidence: `README.md`)
- Battle Logic → Progress System: records results (evidence: `game.js`)
- Mode Hub → Progress System: shows stats (evidence: `README.md`)
- Progress System → Browser Storage: reads and writes (evidence: `progress.js`)
- Mode Hub → Practice Sandbox: selects mode (evidence: `README.md`)
- Practice Sandbox → Player: previews CSS (evidence: `README.md`)
- Mode Hub → Lesson Browser: selects mode (evidence: `README.md`)
- Lesson Browser → CSS Curriculum: uses lessons (evidence: `README.md`)
- Lesson Browser → Progress System: tracks completion
- Player → Google Auth: signs in (evidence: `README.md`)
- Google Auth → Firebase Auth: authenticates with (evidence: `auth.js`)
