# alhmli70/typomaster architecture

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

- Interactive diagram: https://gitdiagram.com/alhmli70/typomaster
- Repository: https://github.com/alhmli70/typomaster

## Overview

TypoMaster is a bilingual typing-training desktop app with lessons, customizable exercises, typing games, analytics, achievements, and local persistence. Users enter through the React app, choose a lesson or exercise (or a game), practice, and see progress reflected in dashboards and profiles; settings and sound are shared app services. The README documents a Tauri/Rust-to-SQLite persistence path and browser dual-mode support. Some feature links rely on README or SOURCE INDEX references because their implementations were not sampled; those limits are reflected in the graph.

Main entry points: [`src/App.tsx`](https://github.com/alhmli70/typomaster/blob/main/src/App.tsx) (App navigation), [`src/components/ExerciseSelection.tsx`](https://github.com/alhmli70/typomaster/blob/main/src/components/ExerciseSelection.tsx) (Exercise selection), [`src/contexts/SessionContext.tsx`](https://github.com/alhmli70/typomaster/blob/main/src/contexts/SessionContext.tsx) (Session state), [`src/components/Lessons.tsx`](https://github.com/alhmli70/typomaster/blob/main/src/components/Lessons.tsx) (Lessons)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_practice["Training and practice"]
  node_lessons["Lessons<br/>[Lessons.tsx]"]
  node_lessondata["Lesson content<br/>[lessonsData.tsx]"]
  node_offline["Offline tips<br/>[offlineTips.ts]"]
  node_exercisechoice["Exercise selection"]
  node_typing["Typing practice"]
  node_keyboard["Virtual keyboard"]
  node_exerciseadmin["Exercise manager"]
  node_exercisecontext["Exercise state"]
  node_gamesmenu["Games menu<br/>[GamesMenu.tsx]"]
  node_games["Typing games"]
end

subgraph group_progress["Progress and persistence"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_profile["Profile and achievements<br/>[Profile.tsx]"]
  node_sessioncontext["Session state<br/>[SessionContext.tsx]"]
  node_sessionrepo["Session repository"]
  node_exercise_repo["Exercise repository"]
end

subgraph group_personal["Settings and media"]
  node_settings["Settings screen<br/>[Settings.tsx]"]
  node_settingscontext["Settings state"]
  node_settingsrepo["Settings repository"]
  node_soundcontext["Sound state<br/>[SoundContext.tsx]"]
  node_music["Music engine<br/>[musicEngine.ts]"]
  node_sound["Sound effects<br/>[soundEngine.ts]"]
end

subgraph group_runtime["App runtime"]
  node_app["App navigation<br/>[App.tsx]"]
  node_tauri["Tauri commands<br/>[lib.rs]"]
  node_sqlite[("Local SQLite<br/>[lib.rs]")]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_app
node_app -->|"shows"| node_dashboard
node_app -->|"opens"| node_lessons
node_app -->|"opens"| node_exercisechoice
node_app -->|"opens"| node_gamesmenu
node_app -->|"opens"| node_exerciseadmin
node_app -->|"opens"| node_settings
node_app -->|"opens"| node_profile
node_lessons -->|"renders"| node_lessondata
node_lessons -->|"uses tips"| node_offline
node_lessons -->|"navigates to"| node_exercisechoice
node_exercisechoice -->|"renders"| node_typing
node_exercisechoice -->|"reads"| node_exercisecontext
node_exercisechoice -->|"reads"| node_sessioncontext
node_typing -.->|"uses"| node_keyboard
node_exerciseadmin -->|"manages"| node_exercisecontext
node_exercisecontext -->|"loads and saves"| node_exercise_repo
node_gamesmenu -->|"dispatches"| node_games
node_gamesmenu -->|"records scores"| node_sessioncontext
node_profile -->|"reads progress"| node_sessioncontext
node_dashboard -->|"reads analytics"| node_sessioncontext
node_sessioncontext -->|"loads and records"| node_sessionrepo
node_settings -->|"updates"| node_settingscontext
node_settingscontext -->|"loads and saves"| node_settingsrepo
node_soundcontext -->|"controls"| node_music
node_soundcontext -->|"calls effects"| node_sound
node_exercise_repo -->|"invokes commands"| node_tauri
node_sessionrepo -->|"invokes commands"| node_tauri
node_settingsrepo -.->|"uses local persistence"| node_tauri
node_tauri -->|"persists data"| node_sqlite

click node_app "https://github.com/alhmli70/typomaster/blob/main/src/App.tsx"
click node_dashboard "https://github.com/alhmli70/typomaster/blob/main/src/components/Dashboard.tsx"
click node_lessons "https://github.com/alhmli70/typomaster/blob/main/src/components/Lessons.tsx"
click node_lessondata "https://github.com/alhmli70/typomaster/blob/main/src/data/lessonsData.tsx"
click node_offline "https://github.com/alhmli70/typomaster/blob/main/src/lib/offlineTips.ts"
click node_exercisechoice "https://github.com/alhmli70/typomaster/blob/main/src/components/ExerciseSelection.tsx"
click node_typing "https://github.com/alhmli70/typomaster/blob/main/src/components/TypingInterface.tsx"
click node_keyboard "https://github.com/alhmli70/typomaster/blob/main/src/components/VirtualKeyboard.tsx"
click node_exerciseadmin "https://github.com/alhmli70/typomaster/blob/main/src/components/ExerciseManager.tsx"
click node_exercisecontext "https://github.com/alhmli70/typomaster/blob/main/src/contexts/ExerciseContext.tsx"
click node_gamesmenu "https://github.com/alhmli70/typomaster/blob/main/src/components/GamesMenu.tsx"
click node_games "https://github.com/alhmli70/typomaster/tree/main/src/components/Games"
click node_profile "https://github.com/alhmli70/typomaster/blob/main/src/components/Profile.tsx"
click node_sessioncontext "https://github.com/alhmli70/typomaster/blob/main/src/contexts/SessionContext.tsx"
click node_sessionrepo "https://github.com/alhmli70/typomaster/blob/main/src/database/repositories/sessionRepository.ts"
click node_exercise_repo "https://github.com/alhmli70/typomaster/blob/main/src/database/repositories/exerciseRepository.ts"
click node_settings "https://github.com/alhmli70/typomaster/blob/main/src/components/Settings.tsx"
click node_settingscontext "https://github.com/alhmli70/typomaster/blob/main/src/contexts/SettingsContext.tsx"
click node_settingsrepo "https://github.com/alhmli70/typomaster/blob/main/src/database/repositories/settingsRepository.ts"
click node_soundcontext "https://github.com/alhmli70/typomaster/blob/main/src/contexts/SoundContext.tsx"
click node_music "https://github.com/alhmli70/typomaster/blob/main/src/lib/musicEngine.ts"
click node_sound "https://github.com/alhmli70/typomaster/blob/main/src/lib/soundEngine.ts"
click node_tauri "https://github.com/alhmli70/typomaster/blob/main/src-tauri/src/lib.rs"
click node_sqlite "https://github.com/alhmli70/typomaster/blob/main/src-tauri/src/lib.rs"

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_lessons,node_lessondata,node_offline,node_exercisechoice,node_typing,node_keyboard,node_exerciseadmin,node_exercisecontext,node_gamesmenu,node_games toneBlue
class node_dashboard,node_profile,node_sessioncontext,node_sessionrepo,node_exercise_repo toneAmber
class node_settings,node_settingscontext,node_settingsrepo,node_soundcontext,node_music,node_sound toneMint
class node_app,node_tauri,node_sqlite toneRose
class node_learner toneIndigo
```

## Components

### Training and practice

- [Lessons](https://github.com/alhmli70/typomaster/blob/main/src/components/Lessons.tsx): `src/components/Lessons.tsx`
- [Lesson content](https://github.com/alhmli70/typomaster/blob/main/src/data/lessonsData.tsx): `src/data/lessonsData.tsx`
- [Offline tips](https://github.com/alhmli70/typomaster/blob/main/src/lib/offlineTips.ts): `src/lib/offlineTips.ts`
- [Exercise selection](https://github.com/alhmli70/typomaster/blob/main/src/components/ExerciseSelection.tsx): `src/components/ExerciseSelection.tsx`
- [Typing practice](https://github.com/alhmli70/typomaster/blob/main/src/components/TypingInterface.tsx): `src/components/TypingInterface.tsx`
- [Virtual keyboard](https://github.com/alhmli70/typomaster/blob/main/src/components/VirtualKeyboard.tsx): `src/components/VirtualKeyboard.tsx`
- [Exercise manager](https://github.com/alhmli70/typomaster/blob/main/src/components/ExerciseManager.tsx): `src/components/ExerciseManager.tsx`
- [Exercise state](https://github.com/alhmli70/typomaster/blob/main/src/contexts/ExerciseContext.tsx): `src/contexts/ExerciseContext.tsx`
- [Games menu](https://github.com/alhmli70/typomaster/blob/main/src/components/GamesMenu.tsx): `src/components/GamesMenu.tsx`
- [Typing games](https://github.com/alhmli70/typomaster/tree/main/src/components/Games): `src/components/Games`

### Progress and persistence

- [Dashboard](https://github.com/alhmli70/typomaster/blob/main/src/components/Dashboard.tsx): `src/components/Dashboard.tsx`
- [Profile and achievements](https://github.com/alhmli70/typomaster/blob/main/src/components/Profile.tsx): `src/components/Profile.tsx`
- [Session state](https://github.com/alhmli70/typomaster/blob/main/src/contexts/SessionContext.tsx): `src/contexts/SessionContext.tsx`
- [Session repository](https://github.com/alhmli70/typomaster/blob/main/src/database/repositories/sessionRepository.ts): `src/database/repositories/sessionRepository.ts`
- [Exercise repository](https://github.com/alhmli70/typomaster/blob/main/src/database/repositories/exerciseRepository.ts): `src/database/repositories/exerciseRepository.ts`

### Settings and media

- [Settings screen](https://github.com/alhmli70/typomaster/blob/main/src/components/Settings.tsx): `src/components/Settings.tsx`
- [Settings state](https://github.com/alhmli70/typomaster/blob/main/src/contexts/SettingsContext.tsx): `src/contexts/SettingsContext.tsx`
- [Settings repository](https://github.com/alhmli70/typomaster/blob/main/src/database/repositories/settingsRepository.ts): `src/database/repositories/settingsRepository.ts`
- [Sound state](https://github.com/alhmli70/typomaster/blob/main/src/contexts/SoundContext.tsx): `src/contexts/SoundContext.tsx`
- [Music engine](https://github.com/alhmli70/typomaster/blob/main/src/lib/musicEngine.ts): `src/lib/musicEngine.ts`
- [Sound effects](https://github.com/alhmli70/typomaster/blob/main/src/lib/soundEngine.ts): `src/lib/soundEngine.ts`

### App runtime

- [App navigation](https://github.com/alhmli70/typomaster/blob/main/src/App.tsx): `src/App.tsx`
- [Tauri commands](https://github.com/alhmli70/typomaster/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Local SQLite](https://github.com/alhmli70/typomaster/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Other components

- **Learner**

## Connections

- Learner → App navigation: uses
- App navigation → Dashboard: shows (evidence: `src/App.tsx`)
- App navigation → Lessons: opens (evidence: `src/App.tsx`)
- App navigation → Exercise selection: opens (evidence: `src/App.tsx`)
- App navigation → Games menu: opens (evidence: `src/App.tsx`)
- App navigation → Exercise manager: opens (evidence: `src/App.tsx`)
- App navigation → Settings screen: opens (evidence: `src/App.tsx`)
- App navigation → Profile and achievements: opens (evidence: `src/App.tsx`)
- Lessons → Lesson content: renders (evidence: `src/components/Lessons.tsx`)
- Lessons → Offline tips: uses tips (evidence: `src/components/Lessons.tsx`)
- Lessons → Exercise selection: navigates to (evidence: `src/components/Lessons.tsx`)
- Exercise selection → Typing practice: renders (evidence: `src/components/ExerciseSelection.tsx`)
- Exercise selection → Exercise state: reads (evidence: `src/components/ExerciseSelection.tsx`)
- Exercise selection → Session state: reads (evidence: `src/components/ExerciseSelection.tsx`)
- Typing practice → Virtual keyboard: uses
- Exercise manager → Exercise state: manages (evidence: `src/components/ExerciseManager.tsx`)
- Exercise state → Exercise repository: loads and saves (evidence: `src/contexts/ExerciseContext.tsx`)
- Games menu → Typing games: dispatches (evidence: `src/components/GamesMenu.tsx`)
- Games menu → Session state: records scores (evidence: `src/components/GamesMenu.tsx`)
- Profile and achievements → Session state: reads progress (evidence: `src/components/Profile.tsx`)
- Dashboard → Session state: reads analytics (evidence: `src/components/Dashboard.tsx`)
- Session state → Session repository: loads and records (evidence: `src/contexts/SessionContext.tsx`)
- Settings screen → Settings state: updates (evidence: `src/components/Settings.tsx`)
- Settings state → Settings repository: loads and saves (evidence: `src/contexts/SettingsContext.tsx`)
- Sound state → Music engine: controls (evidence: `src/contexts/SoundContext.tsx`)
- Sound state → Sound effects: calls effects (evidence: `src/contexts/SoundContext.tsx`)
- Exercise repository → Tauri commands: invokes commands (evidence: `src/database/repositories/exerciseRepository.ts`)
- Session repository → Tauri commands: invokes commands (evidence: `src/database/repositories/sessionRepository.ts`)
- Settings repository → Tauri commands: uses local persistence
- Tauri commands → Local SQLite: persists data (evidence: `README.md`)
