# realkai42/qwerty-learner architecture

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

- Interactive diagram: https://gitdiagram.com/realkai42/qwerty-learner
- Repository: https://github.com/realkai42/qwerty-learner

## Overview

Qwerty Learner is a word-learning and English typing-practice app: users choose a dictionary and chapter, practice words with pronunciation and dictation support, then review performance and mistakes. The graph follows the documented routes and sampled data access; several page internals were not sampled, so uncertain links to those subsystems are dashed. Dictionary, audio, local persistence, analysis, and error review remain distinct capabilities.

Main entry points: [`src/index.tsx`](https://github.com/realkai42/qwerty-learner/blob/master/src/index.tsx) (Route entry), [`src/pages/Typing/hooks/useWordList.ts`](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Typing/hooks/useWordList.ts) (Chapter words), [`src/store/index.ts`](https://github.com/realkai42/qwerty-learner/blob/master/src/store/index.ts) (User settings), [`src/utils/db/index.ts`](https://github.com/realkai42/qwerty-learner/blob/master/src/utils/db/index.ts) (Local database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_practice["Typing practice"]
  node_typing["Typing session<br/>[index.tsx]"]
  node_wordpanel["Word input<br/>[index.tsx]"]
  node_typingstore["Session state<br/>[index.ts]"]
  node_wordlist["Chapter words<br/>[useWordList.ts]"]
  node_pronunciation["Word pronunciation"]
  node_audio["Sound resources<br/>[soundResource.ts]"]
  node_mobile["Mobile practice<br/>[index.tsx]"]
end

subgraph group_content["Word learning"]
  node_dictionaries["Dictionary catalog<br/>[dictionary.ts]"]
  node_gallery["Dictionary gallery<br/>[index.tsx]"]
end

subgraph group_progress["Progress and review"]
  node_records["Practice records<br/>[record.ts]"]
  node_localdb[("Local database<br/>[index.ts]")]
  node_analysis["Performance analysis<br/>[index.tsx]"]
  node_stats["Practice statistics<br/>[useWordStats.ts]"]
  node_errorbook["Error book<br/>[index.tsx]"]
  node_errorwords["Mistake aggregation<br/>[useErrorWords.ts]"]
  node_reviewrecords["Review records<br/>[review-record.ts]"]
  node_export["Record export<br/>[DropdownExport.tsx]"]
end

subgraph group_app["App and state"]
  node_entry["Route entry<br/>[index.tsx]"]
  node_appstate["User settings<br/>[index.ts]"]
  node_analytics["Usage analytics<br/>[mixpanel.ts]"]
end

node_learner(("Learner"))

node_learner -->|"opens app"| node_entry
node_entry -->|"routes to"| node_typing
node_entry -->|"routes to"| node_gallery
node_entry -->|"routes to"| node_analysis
node_entry -->|"routes to"| node_errorbook
node_entry -->|"routes to"| node_mobile
node_typing -.->|"presents input"| node_wordpanel
node_typing -.->|"loads chapter"| node_wordlist
node_wordlist -->|"uses catalog"| node_dictionaries
node_wordlist -->|"reads settings"| node_appstate
node_wordlist -.->|"provides words"| node_typingstore
node_wordpanel -.->|"plays word audio"| node_pronunciation
node_pronunciation -->|"reads preferences"| node_appstate
node_pronunciation -.->|"requests audio"| node_learner
node_appstate -->|"resolves dictionary"| node_dictionaries
node_appstate -->|"loads sound choices"| node_audio
node_gallery -->|"lists dictionaries"| node_dictionaries
node_analysis -->|"renders statistics"| node_stats
node_stats -->|"queries records"| node_localdb
node_stats -->|"aggregates record fields"| node_records
node_errorbook -->|"reads records"| node_localdb
node_errorbook -->|"offers export"| node_export
node_errorwords -->|"queries mistakes"| node_localdb
node_errorwords -->|"fetches dictionary words"| node_wordlist
node_reviewrecords -->|"stores review sessions"| node_localdb
node_analytics -.->|"tracks usage"| node_learner

click node_entry "https://github.com/realkai42/qwerty-learner/blob/master/src/index.tsx"
click node_typing "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Typing/index.tsx"
click node_wordpanel "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Typing/components/WordPanel/index.tsx"
click node_typingstore "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Typing/store/index.ts"
click node_wordlist "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Typing/hooks/useWordList.ts"
click node_pronunciation "https://github.com/realkai42/qwerty-learner/blob/master/src/hooks/usePronunciation.ts"
click node_audio "https://github.com/realkai42/qwerty-learner/blob/master/src/resources/soundResource.ts"
click node_dictionaries "https://github.com/realkai42/qwerty-learner/blob/master/src/resources/dictionary.ts"
click node_gallery "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Gallery-N/index.tsx"
click node_mobile "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Mobile/index.tsx"
click node_appstate "https://github.com/realkai42/qwerty-learner/blob/master/src/store/index.ts"
click node_records "https://github.com/realkai42/qwerty-learner/blob/master/src/utils/db/record.ts"
click node_localdb "https://github.com/realkai42/qwerty-learner/blob/master/src/utils/db/index.ts"
click node_analysis "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Analysis/index.tsx"
click node_stats "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Analysis/hooks/useWordStats.ts"
click node_errorbook "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/ErrorBook/index.tsx"
click node_errorwords "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Gallery-N/hooks/useErrorWords.ts"
click node_reviewrecords "https://github.com/realkai42/qwerty-learner/blob/master/src/utils/db/review-record.ts"
click node_export "https://github.com/realkai42/qwerty-learner/blob/master/src/pages/ErrorBook/DropdownExport.tsx"
click node_analytics "https://github.com/realkai42/qwerty-learner/blob/master/src/utils/mixpanel.ts"

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_typing,node_wordpanel,node_typingstore,node_wordlist,node_pronunciation,node_audio,node_mobile toneBlue
class node_dictionaries,node_gallery toneAmber
class node_records,node_localdb,node_analysis,node_stats,node_errorbook,node_errorwords,node_reviewrecords,node_export toneMint
class node_entry,node_appstate,node_analytics toneRose
class node_learner toneIndigo
```

## Components

### Typing practice

- [Typing session](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Typing/index.tsx): `src/pages/Typing/index.tsx`
- [Word input](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Typing/components/WordPanel/index.tsx): `src/pages/Typing/components/WordPanel/index.tsx`
- [Session state](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Typing/store/index.ts): `src/pages/Typing/store/index.ts`
- [Chapter words](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Typing/hooks/useWordList.ts): `src/pages/Typing/hooks/useWordList.ts`
- [Word pronunciation](https://github.com/realkai42/qwerty-learner/blob/master/src/hooks/usePronunciation.ts): `src/hooks/usePronunciation.ts`
- [Sound resources](https://github.com/realkai42/qwerty-learner/blob/master/src/resources/soundResource.ts): `src/resources/soundResource.ts`
- [Mobile practice](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Mobile/index.tsx): `src/pages/Mobile/index.tsx`

### Word learning

- [Dictionary catalog](https://github.com/realkai42/qwerty-learner/blob/master/src/resources/dictionary.ts): `src/resources/dictionary.ts`
- [Dictionary gallery](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Gallery-N/index.tsx): `src/pages/Gallery-N/index.tsx`

### Progress and review

- [Practice records](https://github.com/realkai42/qwerty-learner/blob/master/src/utils/db/record.ts): `src/utils/db/record.ts`
- [Local database](https://github.com/realkai42/qwerty-learner/blob/master/src/utils/db/index.ts): `src/utils/db/index.ts`
- [Performance analysis](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Analysis/index.tsx): `src/pages/Analysis/index.tsx`
- [Practice statistics](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Analysis/hooks/useWordStats.ts): `src/pages/Analysis/hooks/useWordStats.ts`
- [Error book](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/ErrorBook/index.tsx): `src/pages/ErrorBook/index.tsx`
- [Mistake aggregation](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/Gallery-N/hooks/useErrorWords.ts): `src/pages/Gallery-N/hooks/useErrorWords.ts`
- [Review records](https://github.com/realkai42/qwerty-learner/blob/master/src/utils/db/review-record.ts): `src/utils/db/review-record.ts`
- [Record export](https://github.com/realkai42/qwerty-learner/blob/master/src/pages/ErrorBook/DropdownExport.tsx): `src/pages/ErrorBook/DropdownExport.tsx`

### App and state

- [Route entry](https://github.com/realkai42/qwerty-learner/blob/master/src/index.tsx): `src/index.tsx`
- [User settings](https://github.com/realkai42/qwerty-learner/blob/master/src/store/index.ts): `src/store/index.ts`
- [Usage analytics](https://github.com/realkai42/qwerty-learner/blob/master/src/utils/mixpanel.ts): `src/utils/mixpanel.ts`

### Other components

- **Learner**

## Connections

- Learner → Route entry: opens app (evidence: `src/index.tsx`)
- Route entry → Typing session: routes to (evidence: `src/index.tsx`)
- Route entry → Dictionary gallery: routes to (evidence: `src/index.tsx`)
- Route entry → Performance analysis: routes to (evidence: `src/index.tsx`)
- Route entry → Error book: routes to (evidence: `src/index.tsx`)
- Route entry → Mobile practice: routes to (evidence: `src/index.tsx`)
- Typing session → Word input: presents input
- Typing session → Chapter words: loads chapter
- Chapter words → Dictionary catalog: uses catalog (evidence: `src/pages/Typing/hooks/useWordList.ts`)
- Chapter words → User settings: reads settings (evidence: `src/pages/Typing/hooks/useWordList.ts`)
- Chapter words → Session state: provides words
- Word input → Word pronunciation: plays word audio
- Word pronunciation → User settings: reads preferences (evidence: `src/hooks/usePronunciation.ts`)
- Word pronunciation → Learner: requests audio
- User settings → Dictionary catalog: resolves dictionary (evidence: `src/store/index.ts`)
- User settings → Sound resources: loads sound choices (evidence: `src/store/index.ts`)
- Dictionary gallery → Dictionary catalog: lists dictionaries (evidence: `src/pages/Gallery-N/index.tsx`)
- Performance analysis → Practice statistics: renders statistics (evidence: `src/pages/Analysis/index.tsx`)
- Practice statistics → Local database: queries records (evidence: `src/pages/Analysis/hooks/useWordStats.ts`)
- Practice statistics → Practice records: aggregates record fields (evidence: `src/pages/Analysis/hooks/useWordStats.ts`)
- Error book → Local database: reads records (evidence: `src/pages/ErrorBook/index.tsx`)
- Error book → Record export: offers export (evidence: `src/pages/ErrorBook/index.tsx`)
- Mistake aggregation → Local database: queries mistakes (evidence: `src/pages/Gallery-N/hooks/useErrorWords.ts`)
- Mistake aggregation → Chapter words: fetches dictionary words (evidence: `src/pages/Gallery-N/hooks/useErrorWords.ts`)
- Review records → Local database: stores review sessions (evidence: `src/utils/db/review-record.ts`)
- Usage analytics → Learner: tracks usage
