# zhangchen091488-collab/ggcamp architecture

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

- Interactive diagram: https://gitdiagram.com/zhangchen091488-collab/ggcamp
- Repository: https://github.com/zhangchen091488-collab/ggcamp

## Overview

瓜瓜训练营 is a local-first learning app for math practice, English spelling, and game-like progress. Learners choose a subject and practice scope, complete problems, and see results; practice records feed skill growth, quests, trophies, and collectible rewards. The README also describes calendar check-ins, appearance and audio settings, and resuming unfinished sessions. The graph focuses on runtime behavior; some relationships are supported by the SOURCE INDEX or README rather than sampled implementation, so unsampled details are not expanded.

Main entry points: [`pages/home/home.js`](https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/home/home.js) (Home and routing), [`lib/english-practice.js`](https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/english-practice.js) (English practice engine), [`lib/practice.js`](https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/practice.js) (Math practice engine), [`pages/play/play.js`](https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/play/play.js) (Math practice UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and pages"]
  node_app["App setup<br/>[app.js]"]
  node_home["Home and routing<br/>[home.js]"]
  node_math_play["Math practice UI<br/>[play.js]"]
  node_math_result["Math results<br/>[result.js]"]
  node_english_play["English practice UI<br/>[english-play.js]"]
  node_english_result["English results<br/>[english-result.js]"]
  node_settings["Settings<br/>[settings.js]"]
end

subgraph group_practice["Learning workflows"]
  node_math_engine["Math practice engine<br/>[practice.js]"]
  node_english_engine["English practice engine"]
  node_problem_bank["Math problems<br/>[problems.js]"]
  node_skill_tree["Skills and planning<br/>[skills.js]"]
  node_english_plan["English planning and answers<br/>[english-answer.js]"]
  node_english_catalog["English content catalog<br/>[catalog.js]"]
end

subgraph group_progress["Progress and rewards"]
  node_local_store[("Local persistence<br/>[storage.js]")]
  node_shared_store["State store<br/>[store.js]"]
  node_scoring["Scoring<br/>[scoring.js]"]
  node_growth["Growth records<br/>[growth.js]"]
  node_features["Quests and rewards<br/>[features.js]"]
  node_trophies["Trophies<br/>[trophies.js]"]
  node_unlocks["Collectible unlocks<br/>[unlocks.js]"]
  node_calendar["Practice calendar<br/>[calendar-model.js]"]
end

subgraph group_presentation["Presentation and content"]
  node_audio["Audio<br/>[audio.js]"]
  node_visual["Visual appearance<br/>[visual.js]"]
  node_celebration["Celebration effects<br/>[celebration.js]"]
end

node_learner(("Learner"))

node_learner -->|"opens app"| node_home
node_app -->|"creates store"| node_local_store
node_local_store -->|"uses backend"| node_shared_store
node_home -->|"starts or resumes"| node_math_play
node_home -->|"starts or resumes"| node_english_play
node_home -->|"starts English"| node_english_engine
node_math_play -->|"runs practice"| node_math_engine
node_math_engine -->|"generates problems"| node_problem_bank
node_math_engine -->|"plans skills"| node_skill_tree
node_math_play -.->|"shows completion"| node_math_result
node_math_result -->|"reads session"| node_math_engine
node_english_play -->|"runs practice"| node_english_engine
node_english_engine -->|"checks answers"| node_english_plan
node_english_engine -->|"loads content"| node_english_catalog
node_english_play -.->|"shows completion"| node_english_result
node_english_result -->|"reads session"| node_english_engine
node_math_engine -->|"calculates score"| node_scoring
node_english_engine -->|"calculates score"| node_scoring
node_math_engine -->|"records events"| node_features
node_english_engine -->|"records progress"| node_growth
node_features -->|"evaluates awards"| node_trophies
node_features -->|"grants rewards"| node_unlocks
node_home -->|"loads home rewards"| node_features
node_home -->|"loads calendar"| node_calendar
node_calendar -->|"reads records"| node_shared_store
node_settings -->|"saves settings"| node_local_store
node_math_play -->|"plays audio"| node_audio
node_english_play -->|"plays audio"| node_audio
node_math_play -->|"renders appearance"| node_visual
node_english_play -->|"renders appearance"| node_visual
node_trophies -->|"defines rewards"| node_unlocks
node_learner -->|"adjusts preferences"| node_settings
node_learner -.->|"views collection"| node_home
node_math_result -.->|"triggers celebration"| node_celebration

click node_app "https://github.com/zhangchen091488-collab/ggcamp/blob/main/app.js"
click node_home "https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/home/home.js"
click node_math_play "https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/play/play.js"
click node_math_result "https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/result/result.js"
click node_english_play "https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/english-play/english-play.js"
click node_english_result "https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/english-result/english-result.js"
click node_settings "https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/settings/settings.js"
click node_math_engine "https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/practice.js"
click node_english_engine "https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/english-practice.js"
click node_problem_bank "https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/problems.js"
click node_skill_tree "https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/skills.js"
click node_english_plan "https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/english-answer.js"
click node_english_catalog "https://github.com/zhangchen091488-collab/ggcamp/blob/main/content/catalog.js"
click node_local_store "https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/storage.js"
click node_shared_store "https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/store.js"
click node_scoring "https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/scoring.js"
click node_growth "https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/growth.js"
click node_features "https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/features.js"
click node_trophies "https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/trophies.js"
click node_unlocks "https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/unlocks.js"
click node_calendar "https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/calendar-model.js"
click node_audio "https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/audio.js"
click node_visual "https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/visual.js"
click node_celebration "https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/celebration.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_app,node_home,node_math_play,node_math_result,node_english_play,node_english_result,node_settings toneBlue
class node_math_engine,node_english_engine,node_problem_bank,node_skill_tree,node_english_plan,node_english_catalog toneAmber
class node_local_store,node_shared_store,node_scoring,node_growth,node_features,node_trophies,node_unlocks,node_calendar toneMint
class node_audio,node_visual,node_celebration toneRose
class node_learner toneIndigo
```

## Components

### App and pages

- [App setup](https://github.com/zhangchen091488-collab/ggcamp/blob/main/app.js): `app.js`
- [Home and routing](https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/home/home.js): `pages/home/home.js`
- [Math practice UI](https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/play/play.js): `pages/play/play.js`
- [Math results](https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/result/result.js): `pages/result/result.js`
- [English practice UI](https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/english-play/english-play.js): `pages/english-play/english-play.js`
- [English results](https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/english-result/english-result.js): `pages/english-result/english-result.js`
- [Settings](https://github.com/zhangchen091488-collab/ggcamp/blob/main/pages/settings/settings.js): `pages/settings/settings.js`

### Learning workflows

- [Math practice engine](https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/practice.js): `lib/practice.js`
- [English practice engine](https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/english-practice.js): `lib/english-practice.js`
- [Math problems](https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/problems.js): `shared/problems.js`
- [Skills and planning](https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/skills.js): `shared/skills.js`
- [English planning and answers](https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/english-answer.js): `shared/english-answer.js`
- [English content catalog](https://github.com/zhangchen091488-collab/ggcamp/blob/main/content/catalog.js): `content/catalog.js`

### Progress and rewards

- [Local persistence](https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/storage.js): `lib/storage.js`
- [State store](https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/store.js): `shared/store.js`
- [Scoring](https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/scoring.js): `shared/scoring.js`
- [Growth records](https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/growth.js): `shared/growth.js`
- [Quests and rewards](https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/features.js): `lib/features.js`
- [Trophies](https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/trophies.js): `shared/trophies.js`
- [Collectible unlocks](https://github.com/zhangchen091488-collab/ggcamp/blob/main/shared/unlocks.js): `shared/unlocks.js`
- [Practice calendar](https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/calendar-model.js): `lib/calendar-model.js`

### Presentation and content

- [Audio](https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/audio.js): `lib/audio.js`
- [Visual appearance](https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/visual.js): `lib/visual.js`
- [Celebration effects](https://github.com/zhangchen091488-collab/ggcamp/blob/main/lib/celebration.js): `lib/celebration.js`

### Other components

- **Learner**

## Connections

- Learner → Home and routing: opens app
- App setup → Local persistence: creates store (evidence: `app.js`)
- Local persistence → State store: uses backend (evidence: `lib/storage.js`)
- Home and routing → Math practice UI: starts or resumes (evidence: `pages/home/home.js`)
- Home and routing → English practice UI: starts or resumes (evidence: `pages/home/home.js`)
- Home and routing → English practice engine: starts English (evidence: `pages/home/home.js`)
- Math practice UI → Math practice engine: runs practice (evidence: `pages/play/play.js`)
- Math practice engine → Math problems: generates problems (evidence: `lib/practice.js`)
- Math practice engine → Skills and planning: plans skills (evidence: `lib/practice.js`)
- Math practice UI → Math results: shows completion
- Math results → Math practice engine: reads session (evidence: `pages/result/result.js`)
- English practice UI → English practice engine: runs practice (evidence: `pages/english-play/english-play.js`)
- English practice engine → English planning and answers: checks answers (evidence: `lib/english-practice.js`)
- English practice engine → English content catalog: loads content (evidence: `lib/english-practice.js`)
- English practice UI → English results: shows completion
- English results → English practice engine: reads session (evidence: `pages/english-result/english-result.js`)
- Math practice engine → Scoring: calculates score (evidence: `lib/practice.js`)
- English practice engine → Scoring: calculates score (evidence: `lib/english-practice.js`)
- Math practice engine → Quests and rewards: records events (evidence: `lib/practice.js`)
- English practice engine → Growth records: records progress (evidence: `lib/english-practice.js`)
- Quests and rewards → Trophies: evaluates awards (evidence: `lib/features.js`)
- Quests and rewards → Collectible unlocks: grants rewards (evidence: `lib/features.js`)
- Home and routing → Quests and rewards: loads home rewards (evidence: `pages/home/home.js`)
- Home and routing → Practice calendar: loads calendar (evidence: `pages/home/home.js`)
- Practice calendar → State store: reads records (evidence: `lib/calendar-model.js`)
- Settings → Local persistence: saves settings (evidence: `pages/settings/settings.js`)
- Math practice UI → Audio: plays audio (evidence: `pages/play/play.js`)
- English practice UI → Audio: plays audio (evidence: `pages/english-play/english-play.js`)
- Math practice UI → Visual appearance: renders appearance (evidence: `pages/play/play.js`)
- English practice UI → Visual appearance: renders appearance (evidence: `pages/english-play/english-play.js`)
- Trophies → Collectible unlocks: defines rewards (evidence: `shared/unlocks.js`)
- Learner → Settings: adjusts preferences
- Learner → Home and routing: views collection
- Math results → Celebration effects: triggers celebration
