# fedossayenko/crossing-ten architecture

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

- Interactive diagram: https://gitdiagram.com/fedossayenko/crossing-ten
- Repository: https://github.com/fedossayenko/crossing-ten

## Overview

Crossing Ten is a browser-based arithmetic practice app for a young pupil, with worksheet-style question generators based on Bulgarian maths competitions. The main flow is choosing a level or competition paper, generating and presenting questions, recording answers, and saving a practice round for progress and review. The app also supports multiple player profiles, badges, language selection, and optional family sync between devices. The graph uses the excerpts, SOURCE INDEX references, and README; unsampled implementation details are represented only where documented.

Main entry points: [`js/app.js`](https://github.com/fedossayenko/crossing-ten/blob/main/js/app.js) (App controller), [`js/sync.js`](https://github.com/fedossayenko/crossing-ten/blob/main/js/sync.js) (Family sync), [`js/questions.js`](https://github.com/fedossayenko/crossing-ten/blob/main/js/questions.js) (Question engine), [`js/compete.js`](https://github.com/fedossayenko/crossing-ten/blob/main/js/compete.js) (Competition papers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_practice["Practice flow"]
  node_app["App controller<br/>[app.js]"]
  node_catalog["Level catalog<br/>[levels.js]"]
  node_question_engine["Question engine<br/>[questions.js]"]
  node_competition["Competition papers<br/>[compete.js]"]
end

subgraph group_question["Question content"]
  node_question_kinds["Worksheet generators"]
  node_shared_helpers["Question helpers<br/>[core.js]"]
end

subgraph group_progress["Progress and accounts"]
  node_players["Player profiles<br/>[players.js]"]
  node_archive["Round archive<br/>[archive.js]"]
  node_local_storage[("Browser storage")]
  node_sync["Family sync<br/>[sync.js]"]
end

subgraph group_interface["Interface"]
  node_today["Today screen<br/>[today.js]"]
  node_badges["Badges screen<br/>[badges.js]"]
  node_translations["Translations<br/>[i18n.js]"]
end

node_pupil(("Pupil"))
node_sync_service["Sync service"]

node_pupil -->|"uses"| node_app
node_app -->|"selects levels"| node_catalog
node_app -->|"starts practice"| node_question_engine
node_question_engine -->|"reads levels"| node_catalog
node_catalog -->|"uses generators"| node_question_kinds
node_question_engine -->|"uses helpers"| node_shared_helpers
node_question_kinds -->|"uses helpers"| node_shared_helpers
node_app -->|"starts papers"| node_competition
node_competition -->|"draws questions"| node_question_engine
node_competition -->|"controls round"| node_app
node_app -->|"loads profiles"| node_players
node_app -->|"loads rounds"| node_archive
node_app -->|"reads and writes"| node_local_storage
node_players -->|"saves profiles"| node_local_storage
node_app -->|"requests sync"| node_sync
node_sync -->|"merges rounds"| node_archive
node_sync -->|"updates profiles"| node_players
node_sync -->|"saves merged data"| node_local_storage
node_sync -.->|"syncs remotely"| node_sync_service
node_pupil -->|"views today"| node_today
node_today -->|"requests practice"| node_app
node_today -->|"starts paper"| node_competition
node_pupil -->|"views badges"| node_badges
node_badges -->|"reads statistics"| node_app
node_app -->|"uses text"| node_translations
node_question_kinds -->|"selects language"| node_translations

click node_app "https://github.com/fedossayenko/crossing-ten/blob/main/js/app.js"
click node_catalog "https://github.com/fedossayenko/crossing-ten/blob/main/js/levels.js"
click node_question_engine "https://github.com/fedossayenko/crossing-ten/blob/main/js/questions.js"
click node_competition "https://github.com/fedossayenko/crossing-ten/blob/main/js/compete.js"
click node_question_kinds "https://github.com/fedossayenko/crossing-ten/tree/main/kinds"
click node_shared_helpers "https://github.com/fedossayenko/crossing-ten/blob/main/js/core.js"
click node_players "https://github.com/fedossayenko/crossing-ten/blob/main/js/players.js"
click node_archive "https://github.com/fedossayenko/crossing-ten/blob/main/js/archive.js"
click node_sync "https://github.com/fedossayenko/crossing-ten/blob/main/js/sync.js"
click node_today "https://github.com/fedossayenko/crossing-ten/blob/main/js/ui/today.js"
click node_badges "https://github.com/fedossayenko/crossing-ten/blob/main/js/ui/badges.js"
click node_translations "https://github.com/fedossayenko/crossing-ten/blob/main/js/i18n.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_catalog,node_question_engine,node_competition toneBlue
class node_question_kinds,node_shared_helpers toneAmber
class node_players,node_archive,node_local_storage,node_sync toneMint
class node_today,node_badges,node_translations toneRose
class node_pupil,node_sync_service toneIndigo
```

## Components

### Practice flow

- [App controller](https://github.com/fedossayenko/crossing-ten/blob/main/js/app.js): `js/app.js`
- [Level catalog](https://github.com/fedossayenko/crossing-ten/blob/main/js/levels.js): `js/levels.js`
- [Question engine](https://github.com/fedossayenko/crossing-ten/blob/main/js/questions.js): `js/questions.js`
- [Competition papers](https://github.com/fedossayenko/crossing-ten/blob/main/js/compete.js): `js/compete.js`

### Question content

- [Worksheet generators](https://github.com/fedossayenko/crossing-ten/tree/main/kinds): `kinds`
- [Question helpers](https://github.com/fedossayenko/crossing-ten/blob/main/js/core.js): `js/core.js`

### Progress and accounts

- [Player profiles](https://github.com/fedossayenko/crossing-ten/blob/main/js/players.js): `js/players.js`
- [Round archive](https://github.com/fedossayenko/crossing-ten/blob/main/js/archive.js): `js/archive.js`
- **Browser storage**
- [Family sync](https://github.com/fedossayenko/crossing-ten/blob/main/js/sync.js): `js/sync.js`

### Interface

- [Today screen](https://github.com/fedossayenko/crossing-ten/blob/main/js/ui/today.js): `js/ui/today.js`
- [Badges screen](https://github.com/fedossayenko/crossing-ten/blob/main/js/ui/badges.js): `js/ui/badges.js`
- [Translations](https://github.com/fedossayenko/crossing-ten/blob/main/js/i18n.js): `js/i18n.js`

### Other components

- **Pupil**
- **Sync service**

## Connections

- Pupil → App controller: uses
- App controller → Level catalog: selects levels (evidence: `js/app.js`)
- App controller → Question engine: starts practice (evidence: `js/app.js`)
- Question engine → Level catalog: reads levels (evidence: `js/questions.js`)
- Level catalog → Worksheet generators: uses generators (evidence: `js/levels.js`)
- Question engine → Question helpers: uses helpers (evidence: `js/questions.js`)
- Worksheet generators → Question helpers: uses helpers (evidence: `kinds/sqcut.js`)
- App controller → Competition papers: starts papers (evidence: `js/app.js`)
- Competition papers → Question engine: draws questions (evidence: `js/compete.js`)
- Competition papers → App controller: controls round (evidence: `js/compete.js`)
- App controller → Player profiles: loads profiles (evidence: `js/app.js`)
- App controller → Round archive: loads rounds (evidence: `js/app.js`)
- App controller → Browser storage: reads and writes (evidence: `js/app.js`)
- Player profiles → Browser storage: saves profiles (evidence: `js/players.js`)
- App controller → Family sync: requests sync (evidence: `js/app.js`)
- Family sync → Round archive: merges rounds (evidence: `js/sync.js`)
- Family sync → Player profiles: updates profiles (evidence: `js/sync.js`)
- Family sync → Browser storage: saves merged data (evidence: `js/sync.js`)
- Family sync → Sync service: syncs remotely
- Pupil → Today screen: views today (evidence: `js/ui/today.js`)
- Today screen → App controller: requests practice (evidence: `js/ui/today.js`)
- Today screen → Competition papers: starts paper (evidence: `js/ui/today.js`)
- Pupil → Badges screen: views badges (evidence: `js/ui/badges.js`)
- Badges screen → App controller: reads statistics (evidence: `js/ui/badges.js`)
- App controller → Translations: uses text (evidence: `js/app.js`)
- Worksheet generators → Translations: selects language (evidence: `kinds/weekday.js`)
