# ngockhanh21/css-forest architecture

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

- Interactive diagram: https://gitdiagram.com/ngockhanh21/css-forest
- Repository: https://github.com/ngockhanh21/css-forest

## Overview

CSS Forest is a browser-based interactive CSS learning platform. Learners choose a lesson from the curriculum, edit HTML/CSS in an isolated preview, submit work for automated checking, and earn progress and plant rewards. The README also describes a selector speedrun, certificate export, sharing, and forest ambience. The graph reflects documented capabilities; unsampled wiring is omitted rather than inferred.

Main entry points: [`js/app.js`](https://github.com/ngockhanh21/css-forest/blob/main/js/app.js) (App controller), [`index.html`](https://github.com/ngockhanh21/css-forest/blob/main/index.html) (App shell), [`js/sandbox.js`](https://github.com/ngockhanh21/css-forest/blob/main/js/sandbox.js) (Live editor preview), [`js/plants.js`](https://github.com/ngockhanh21/css-forest/blob/main/js/plants.js) (Plant illustrations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning path"]
  node_controller["App controller<br/>[app.js]"]
  node_lesson_flow["Lesson navigation<br/>[app.js]"]
  node_progress["Progress tracking<br/>[app.js]"]
  node_sharing["Work sharing<br/>[app.js]"]
end

subgraph group_practice["Practice and feedback"]
  node_editor["Live editor preview<br/>[sandbox.js]"]
  node_grader["Lesson auto-grader<br/>[app.js]"]
  node_code_quality["Code quality meter<br/>[sandbox.js]"]
end

subgraph group_rewards["Rewards and games"]
  node_plant_art["Plant illustrations<br/>[plants.js]"]
  node_certificate["Garden certificate<br/>[app.js]"]
  node_speedrun["Selector speedrun<br/>[speedrun.js]"]
end

subgraph group_experience["Forest experience"]
  node_ambience["Forest audio<br/>[ambience.js]"]
  node_theme_weather["Theme and weather<br/>[style.css]"]
end

subgraph group_content["Application shell and content"]
  node_page["App shell<br/>[index.html]"]
  node_styles["Interface styles<br/>[style.css]"]
  node_curriculum["Lesson curriculum<br/>[curriculum.json]"]
end

node_learner(("Learner"))

node_learner -->|"opens"| node_page
node_page -->|"hosts"| node_controller
node_page -->|"uses styles"| node_styles
node_controller -->|"loads lessons"| node_curriculum
node_controller -->|"renders lessons"| node_lesson_flow
node_controller -->|"restores progress"| node_progress
node_controller -->|"shares work"| node_sharing
node_controller -->|"initializes preview"| node_editor
node_controller -->|"checks lesson"| node_grader
node_controller -->|"analyzes CSS"| node_code_quality
node_controller -->|"uses illustrations"| node_plant_art
node_controller -->|"draws certificate"| node_certificate
node_page -->|"provides game"| node_speedrun
node_controller -->|"creates ambience"| node_ambience
node_learner -->|"changes display"| node_theme_weather

click node_page "https://github.com/ngockhanh21/css-forest/blob/main/index.html"
click node_styles "https://github.com/ngockhanh21/css-forest/blob/main/css/style.css"
click node_curriculum "https://github.com/ngockhanh21/css-forest/blob/main/data/curriculum.json"
click node_controller "https://github.com/ngockhanh21/css-forest/blob/main/js/app.js"
click node_lesson_flow "https://github.com/ngockhanh21/css-forest/blob/main/js/app.js"
click node_progress "https://github.com/ngockhanh21/css-forest/blob/main/js/app.js"
click node_sharing "https://github.com/ngockhanh21/css-forest/blob/main/js/app.js"
click node_editor "https://github.com/ngockhanh21/css-forest/blob/main/js/sandbox.js"
click node_grader "https://github.com/ngockhanh21/css-forest/blob/main/js/app.js"
click node_code_quality "https://github.com/ngockhanh21/css-forest/blob/main/js/sandbox.js"
click node_plant_art "https://github.com/ngockhanh21/css-forest/blob/main/js/plants.js"
click node_certificate "https://github.com/ngockhanh21/css-forest/blob/main/js/app.js"
click node_speedrun "https://github.com/ngockhanh21/css-forest/blob/main/js/speedrun.js"
click node_ambience "https://github.com/ngockhanh21/css-forest/blob/main/js/ambience.js"
click node_theme_weather "https://github.com/ngockhanh21/css-forest/blob/main/css/style.css"

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_controller,node_lesson_flow,node_progress,node_sharing toneBlue
class node_editor,node_grader,node_code_quality toneAmber
class node_plant_art,node_certificate,node_speedrun toneMint
class node_ambience,node_theme_weather toneRose
class node_page,node_styles,node_curriculum,node_learner toneIndigo
```

## Components

### Learning path

- [App controller](https://github.com/ngockhanh21/css-forest/blob/main/js/app.js): `js/app.js`
- [Lesson navigation](https://github.com/ngockhanh21/css-forest/blob/main/js/app.js): `js/app.js`
- [Progress tracking](https://github.com/ngockhanh21/css-forest/blob/main/js/app.js): `js/app.js`
- [Work sharing](https://github.com/ngockhanh21/css-forest/blob/main/js/app.js): `js/app.js`

### Practice and feedback

- [Live editor preview](https://github.com/ngockhanh21/css-forest/blob/main/js/sandbox.js): `js/sandbox.js`
- [Lesson auto-grader](https://github.com/ngockhanh21/css-forest/blob/main/js/app.js): `js/app.js`
- [Code quality meter](https://github.com/ngockhanh21/css-forest/blob/main/js/sandbox.js): `js/sandbox.js`

### Rewards and games

- [Plant illustrations](https://github.com/ngockhanh21/css-forest/blob/main/js/plants.js): `js/plants.js`
- [Garden certificate](https://github.com/ngockhanh21/css-forest/blob/main/js/app.js): `js/app.js`
- [Selector speedrun](https://github.com/ngockhanh21/css-forest/blob/main/js/speedrun.js): `js/speedrun.js`

### Forest experience

- [Forest audio](https://github.com/ngockhanh21/css-forest/blob/main/js/ambience.js): `js/ambience.js`
- [Theme and weather](https://github.com/ngockhanh21/css-forest/blob/main/css/style.css): `css/style.css`

### Application shell and content

- [App shell](https://github.com/ngockhanh21/css-forest/blob/main/index.html): `index.html`
- [Interface styles](https://github.com/ngockhanh21/css-forest/blob/main/css/style.css): `css/style.css`
- [Lesson curriculum](https://github.com/ngockhanh21/css-forest/blob/main/data/curriculum.json): `data/curriculum.json`

### Other components

- **Learner**

## Connections

- Learner → App shell: opens (evidence: `README.md`)
- App shell → App controller: hosts (evidence: `README.md`)
- App shell → Interface styles: uses styles (evidence: `README.md`)
- App controller → Lesson curriculum: loads lessons (evidence: `README.md`)
- App controller → Lesson navigation: renders lessons (evidence: `js/app.js`)
- App controller → Progress tracking: restores progress (evidence: `js/app.js`)
- App controller → Work sharing: shares work (evidence: `js/app.js`)
- App controller → Live editor preview: initializes preview (evidence: `js/app.js`)
- App controller → Lesson auto-grader: checks lesson (evidence: `js/app.js`)
- App controller → Code quality meter: analyzes CSS (evidence: `js/app.js`)
- App controller → Plant illustrations: uses illustrations (evidence: `js/app.js`)
- App controller → Garden certificate: draws certificate (evidence: `js/app.js`)
- App shell → Selector speedrun: provides game (evidence: `README.md`)
- App controller → Forest audio: creates ambience (evidence: `js/app.js`)
- Learner → Theme and weather: changes display (evidence: `README.md`)
