# antonaldo777/gamified architecture

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

- Interactive diagram: https://gitdiagram.com/antonaldo777/gamified
- Repository: https://github.com/antonaldo777/gamified

## Overview

Fieldcraft is a static farm-learning app. Farmers work through four ordered stages: keep field notes and plan visits, explore crop and soil connections, sort and search sample readings, then try a sample water allocation. They confirm tasks themselves and answer quizzes; passing unlocks rewards and later stages. The app saves notes, visits, progress, points, and badges in the current browser. The excerpts show the app entry point, rendering, lesson data, algorithms, and storage; some feature wiring is supported by the source index rather than full excerpts.

Main entry points: [`src/app/render.js`](https://github.com/antonaldo777/gamified/blob/main/src/app/render.js) (App interface), [`src/app/main.js`](https://github.com/antonaldo777/gamified/blob/main/src/app/main.js) (App entry), [`src/shared/progress.js`](https://github.com/antonaldo777/gamified/blob/main/src/shared/progress.js) (Progress storage), [`src/features/lessons.js`](https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js) (Stage content)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_entry["App entry<br/>[main.js]"]
  node_interface["App interface<br/>[render.js]"]
end

subgraph group_learning["Farm learning stages"]
  node_lessons["Stage content<br/>[lessons.js]"]
  node_notes["Field notes<br/>[lessons.js]"]
  node_connections["Crop connections<br/>[lessons.js]"]
  node_readings["Reading patterns<br/>[lessons.js]"]
  node_water["Water planning<br/>[lessons.js]"]
end

subgraph group_algorithms["Learning algorithms"]
  node_linear["Note structures<br/>[algorithms.js]"]
  node_treegraph["Tree and graph tools<br/>[algorithms.js]"]
  node_searchsort["Sort and search<br/>[algorithms.js]"]
  node_greedy["Water allocator<br/>[greedy.js]"]
end

subgraph group_state["Progress and shared UI"]
  node_progress["Progress storage<br/>[progress.js]"]
  node_sharedui["Shared UI helpers<br/>[ui.js]"]
end

node_farmer(("Farmer"))
node_browserstore[("Browser local storage")]

node_farmer -->|"opens app"| node_entry
node_entry -->|"starts"| node_interface
node_interface -->|"renders stages"| node_lessons
node_interface -->|"presents tasks"| node_notes
node_interface -->|"presents activity"| node_connections
node_interface -->|"presents activity"| node_readings
node_interface -.->|"presents activity"| node_water
node_interface -->|"uses structures"| node_linear
node_interface -->|"uses algorithms"| node_treegraph
node_interface -->|"uses algorithms"| node_searchsort
node_interface -->|"uses allocator"| node_greedy
node_interface -->|"loads and saves"| node_progress
node_progress -->|"reads and writes"| node_browserstore
node_interface -->|"uses helpers"| node_sharedui

click node_entry "https://github.com/antonaldo777/gamified/blob/main/src/app/main.js"
click node_interface "https://github.com/antonaldo777/gamified/blob/main/src/app/render.js"
click node_lessons "https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js"
click node_notes "https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js"
click node_connections "https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js"
click node_readings "https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js"
click node_water "https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js"
click node_linear "https://github.com/antonaldo777/gamified/blob/main/src/features/linear/algorithms.js"
click node_treegraph "https://github.com/antonaldo777/gamified/blob/main/src/features/trees-graphs/algorithms.js"
click node_searchsort "https://github.com/antonaldo777/gamified/blob/main/src/features/search-sort/algorithms.js"
click node_greedy "https://github.com/antonaldo777/gamified/blob/main/src/features/algorithm-challenge/greedy.js"
click node_progress "https://github.com/antonaldo777/gamified/blob/main/src/shared/progress.js"
click node_sharedui "https://github.com/antonaldo777/gamified/blob/main/src/shared/ui.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_entry,node_interface toneBlue
class node_lessons,node_notes,node_connections,node_readings,node_water,node_browserstore toneAmber
class node_linear,node_treegraph,node_searchsort,node_greedy toneMint
class node_progress,node_sharedui toneRose
class node_farmer toneIndigo
```

## Components

### App experience

- [App entry](https://github.com/antonaldo777/gamified/blob/main/src/app/main.js): `src/app/main.js`
- [App interface](https://github.com/antonaldo777/gamified/blob/main/src/app/render.js): `src/app/render.js`

### Farm learning stages

- [Stage content](https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js): `src/features/lessons.js`
- [Field notes](https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js): `src/features/lessons.js`
- [Crop connections](https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js): `src/features/lessons.js`
- [Reading patterns](https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js): `src/features/lessons.js`
- [Water planning](https://github.com/antonaldo777/gamified/blob/main/src/features/lessons.js): `src/features/lessons.js`

### Learning algorithms

- [Note structures](https://github.com/antonaldo777/gamified/blob/main/src/features/linear/algorithms.js): `src/features/linear/algorithms.js`
- [Tree and graph tools](https://github.com/antonaldo777/gamified/blob/main/src/features/trees-graphs/algorithms.js): `src/features/trees-graphs/algorithms.js`
- [Sort and search](https://github.com/antonaldo777/gamified/blob/main/src/features/search-sort/algorithms.js): `src/features/search-sort/algorithms.js`
- [Water allocator](https://github.com/antonaldo777/gamified/blob/main/src/features/algorithm-challenge/greedy.js): `src/features/algorithm-challenge/greedy.js`

### Progress and shared UI

- [Progress storage](https://github.com/antonaldo777/gamified/blob/main/src/shared/progress.js): `src/shared/progress.js`
- [Shared UI helpers](https://github.com/antonaldo777/gamified/blob/main/src/shared/ui.js): `src/shared/ui.js`

### Other components

- **Farmer**
- **Browser local storage**

## Connections

- Farmer → App entry: opens app (evidence: `README.md`)
- App entry → App interface: starts (evidence: `src/app/main.js`)
- App interface → Stage content: renders stages (evidence: `src/app/render.js`)
- App interface → Field notes: presents tasks (evidence: `src/app/render.js`)
- App interface → Crop connections: presents activity (evidence: `src/app/render.js`)
- App interface → Reading patterns: presents activity (evidence: `src/app/render.js`)
- App interface → Water planning: presents activity (evidence: `src/app/render.js`)
- App interface → Note structures: uses structures (evidence: `src/app/render.js`)
- App interface → Tree and graph tools: uses algorithms (evidence: `src/app/render.js`)
- App interface → Sort and search: uses algorithms (evidence: `src/app/render.js`)
- App interface → Water allocator: uses allocator (evidence: `src/app/render.js`)
- App interface → Progress storage: loads and saves (evidence: `src/app/render.js`)
- Progress storage → Browser local storage: reads and writes (evidence: `src/shared/progress.js`)
- App interface → Shared UI helpers: uses helpers (evidence: `src/app/render.js`)
