# hruler19/lingo-reflex architecture

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

- Interactive diagram: https://gitdiagram.com/hruler19/lingo-reflex
- Repository: https://github.com/hruler19/lingo-reflex

## Overview

LexiPulse is a local-first vocabulary and phrase trainer. The main user journey is to choose a language pair, add or manage entries, configure timed typed-recall practice, and review results and learning trends. Settings provide pair management and JSON/CSV portability; IndexedDB is the app’s persistent domain store. The graph reflects sampled code and README capabilities; several page implementations and analytics modules are represented from the source index or README, so their internal details are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/hruler19/lingo-reflex/blob/main/src/App.tsx) (App routing), [`src/pages/PracticeArena.tsx`](https://github.com/hruler19/lingo-reflex/blob/main/src/pages/PracticeArena.tsx) (Practice arena), [`src/db/schema.ts`](https://github.com/hruler19/lingo-reflex/blob/main/src/db/schema.ts) (IndexedDB domain store), [`src/pages/Library.tsx`](https://github.com/hruler19/lingo-reflex/blob/main/src/pages/Library.tsx) (Search and edit library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App routing<br/>[App.tsx]"]
  node_layout["App layout<br/>[AppLayout.tsx]"]
end

subgraph group_learning["Vocabulary and practice"]
  node_addword["Add words<br/>[AddWord.tsx]"]
  node_addphrase["Add phrases<br/>[AddPhrase.tsx]"]
  node_library["Search and edit library<br/>[Library.tsx]"]
  node_editdialog["Entry editor<br/>[EditItemDialog.tsx]"]
  node_arena["Practice arena<br/>[PracticeArena.tsx]"]
  node_sessionhook["Session timing and scoring"]
  node_practiceconfig["Practice configuration<br/>[PreGameConfig.tsx]"]
  node_gamescreen["Timed answer screen<br/>[GameScreen.tsx]"]
  node_results["Session results<br/>[ResultView.tsx]"]
  node_practice["Practice rules<br/>[practice.ts]"]
end

subgraph group_insights["Progress insights"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_analytics["Analytics calculations<br/>[analytics.ts]"]
  node_charts["Dashboard charts"]
end

subgraph group_persistence["Local data and settings"]
  node_settings["Settings and pairs<br/>[Settings.tsx]"]
  node_backup["JSON and CSV portability<br/>[backup.ts]"]
  node_database[("IndexedDB domain store<br/>[schema.ts]")]
end

subgraph group_shared["Shared UI and state"]
  node_pairstore["Selected language pair"]
  node_persist["Store persistence fallback<br/>[persist-storage.ts]"]
  node_sharedui["Shared UI components"]
  node_appchrome["Headers and mascot<br/>[PageHeader.tsx]"]
  node_errorboundary["Error boundary<br/>[ErrorBoundary.tsx]"]
  node_toast["Toast state and errors<br/>[toast-store.ts]"]
  node_toaster["Toast display<br/>[Toaster.tsx]"]
end

node_learner(("Learner"))

node_learner -->|"opens"| node_app
node_app -->|"wraps routes"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_addword
node_app -->|"routes to"| node_addphrase
node_app -->|"routes to"| node_library
node_app -->|"routes to"| node_arena
node_app -->|"routes to"| node_settings
node_dashboard -->|"reads progress"| node_database
node_dashboard -->|"uses metrics"| node_analytics
node_dashboard -->|"renders"| node_charts
node_addword -.->|"saves entries"| node_database
node_addphrase -.->|"saves entries"| node_database
node_library -->|"reads and mutates"| node_database
node_library -->|"uses selection"| node_pairstore
node_library -->|"opens editor"| node_editdialog
node_arena -.->|"loads and saves sessions"| node_database
node_arena -->|"uses selection"| node_pairstore
node_arena -->|"renders"| node_practiceconfig
node_arena -->|"starts session"| node_sessionhook
node_sessionhook -->|"checks answers"| node_practice
node_arena -->|"renders"| node_gamescreen
node_arena -->|"renders"| node_results
node_settings -->|"manages pairs and data"| node_database
node_settings -->|"imports and exports"| node_backup
node_settings -->|"uses pair state"| node_pairstore
node_pairstore -->|"persists through"| node_persist
node_app -->|"renders within"| node_errorboundary
node_app -->|"renders alongside"| node_toaster
node_toaster -->|"reads notifications"| node_toast
node_layout -->|"uses controls"| node_sharedui
node_layout -->|"uses boundary"| node_errorboundary
node_dashboard -->|"uses header"| node_appchrome
node_library -->|"reports mutation errors"| node_toast
node_settings -->|"reports database errors"| node_toast

click node_app "https://github.com/hruler19/lingo-reflex/blob/main/src/App.tsx"
click node_layout "https://github.com/hruler19/lingo-reflex/blob/main/src/components/layout/AppLayout.tsx"
click node_dashboard "https://github.com/hruler19/lingo-reflex/blob/main/src/pages/Dashboard.tsx"
click node_analytics "https://github.com/hruler19/lingo-reflex/blob/main/src/lib/analytics.ts"
click node_charts "https://github.com/hruler19/lingo-reflex/tree/main/src/components/dashboard"
click node_addword "https://github.com/hruler19/lingo-reflex/blob/main/src/pages/AddWord.tsx"
click node_addphrase "https://github.com/hruler19/lingo-reflex/blob/main/src/pages/AddPhrase.tsx"
click node_library "https://github.com/hruler19/lingo-reflex/blob/main/src/pages/Library.tsx"
click node_editdialog "https://github.com/hruler19/lingo-reflex/blob/main/src/components/library/EditItemDialog.tsx"
click node_arena "https://github.com/hruler19/lingo-reflex/blob/main/src/pages/PracticeArena.tsx"
click node_sessionhook "https://github.com/hruler19/lingo-reflex/blob/main/src/hooks/use-practice-session.ts"
click node_practiceconfig "https://github.com/hruler19/lingo-reflex/blob/main/src/components/practice/PreGameConfig.tsx"
click node_gamescreen "https://github.com/hruler19/lingo-reflex/blob/main/src/components/practice/GameScreen.tsx"
click node_results "https://github.com/hruler19/lingo-reflex/blob/main/src/components/practice/ResultView.tsx"
click node_practice "https://github.com/hruler19/lingo-reflex/blob/main/src/lib/practice.ts"
click node_settings "https://github.com/hruler19/lingo-reflex/blob/main/src/pages/Settings.tsx"
click node_backup "https://github.com/hruler19/lingo-reflex/blob/main/src/lib/backup.ts"
click node_database "https://github.com/hruler19/lingo-reflex/blob/main/src/db/schema.ts"
click node_pairstore "https://github.com/hruler19/lingo-reflex/blob/main/src/store/language-pair-store.ts"
click node_persist "https://github.com/hruler19/lingo-reflex/blob/main/src/store/persist-storage.ts"
click node_sharedui "https://github.com/hruler19/lingo-reflex/tree/main/src/components/ui"
click node_appchrome "https://github.com/hruler19/lingo-reflex/blob/main/src/components/PageHeader.tsx"
click node_errorboundary "https://github.com/hruler19/lingo-reflex/blob/main/src/components/ErrorBoundary.tsx"
click node_toast "https://github.com/hruler19/lingo-reflex/blob/main/src/store/toast-store.ts"
click node_toaster "https://github.com/hruler19/lingo-reflex/blob/main/src/components/Toaster.tsx"

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_layout toneBlue
class node_addword,node_addphrase,node_library,node_editdialog,node_arena,node_sessionhook,node_practiceconfig,node_gamescreen,node_results,node_practice toneAmber
class node_dashboard,node_analytics,node_charts toneMint
class node_settings,node_backup,node_database toneRose
class node_pairstore,node_persist,node_sharedui,node_appchrome,node_errorboundary,node_toast,node_toaster,node_learner toneIndigo
```

## Components

### App experience

- [App routing](https://github.com/hruler19/lingo-reflex/blob/main/src/App.tsx): `src/App.tsx`
- [App layout](https://github.com/hruler19/lingo-reflex/blob/main/src/components/layout/AppLayout.tsx): `src/components/layout/AppLayout.tsx`

### Vocabulary and practice

- [Add words](https://github.com/hruler19/lingo-reflex/blob/main/src/pages/AddWord.tsx): `src/pages/AddWord.tsx`
- [Add phrases](https://github.com/hruler19/lingo-reflex/blob/main/src/pages/AddPhrase.tsx): `src/pages/AddPhrase.tsx`
- [Search and edit library](https://github.com/hruler19/lingo-reflex/blob/main/src/pages/Library.tsx): `src/pages/Library.tsx`
- [Entry editor](https://github.com/hruler19/lingo-reflex/blob/main/src/components/library/EditItemDialog.tsx): `src/components/library/EditItemDialog.tsx`
- [Practice arena](https://github.com/hruler19/lingo-reflex/blob/main/src/pages/PracticeArena.tsx): `src/pages/PracticeArena.tsx`
- [Session timing and scoring](https://github.com/hruler19/lingo-reflex/blob/main/src/hooks/use-practice-session.ts): `src/hooks/use-practice-session.ts`
- [Practice configuration](https://github.com/hruler19/lingo-reflex/blob/main/src/components/practice/PreGameConfig.tsx): `src/components/practice/PreGameConfig.tsx`
- [Timed answer screen](https://github.com/hruler19/lingo-reflex/blob/main/src/components/practice/GameScreen.tsx): `src/components/practice/GameScreen.tsx`
- [Session results](https://github.com/hruler19/lingo-reflex/blob/main/src/components/practice/ResultView.tsx): `src/components/practice/ResultView.tsx`
- [Practice rules](https://github.com/hruler19/lingo-reflex/blob/main/src/lib/practice.ts): `src/lib/practice.ts`

### Progress insights

- [Dashboard](https://github.com/hruler19/lingo-reflex/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Analytics calculations](https://github.com/hruler19/lingo-reflex/blob/main/src/lib/analytics.ts): `src/lib/analytics.ts`
- [Dashboard charts](https://github.com/hruler19/lingo-reflex/tree/main/src/components/dashboard): `src/components/dashboard`

### Local data and settings

- [Settings and pairs](https://github.com/hruler19/lingo-reflex/blob/main/src/pages/Settings.tsx): `src/pages/Settings.tsx`
- [JSON and CSV portability](https://github.com/hruler19/lingo-reflex/blob/main/src/lib/backup.ts): `src/lib/backup.ts`
- [IndexedDB domain store](https://github.com/hruler19/lingo-reflex/blob/main/src/db/schema.ts): `src/db/schema.ts`

### Shared UI and state

- [Selected language pair](https://github.com/hruler19/lingo-reflex/blob/main/src/store/language-pair-store.ts): `src/store/language-pair-store.ts`
- [Store persistence fallback](https://github.com/hruler19/lingo-reflex/blob/main/src/store/persist-storage.ts): `src/store/persist-storage.ts`
- [Shared UI components](https://github.com/hruler19/lingo-reflex/tree/main/src/components/ui): `src/components/ui`
- [Headers and mascot](https://github.com/hruler19/lingo-reflex/blob/main/src/components/PageHeader.tsx): `src/components/PageHeader.tsx`
- [Error boundary](https://github.com/hruler19/lingo-reflex/blob/main/src/components/ErrorBoundary.tsx): `src/components/ErrorBoundary.tsx`
- [Toast state and errors](https://github.com/hruler19/lingo-reflex/blob/main/src/store/toast-store.ts): `src/store/toast-store.ts`
- [Toast display](https://github.com/hruler19/lingo-reflex/blob/main/src/components/Toaster.tsx): `src/components/Toaster.tsx`

### Other components

- **Learner**

## Connections

- Learner → App routing: opens (evidence: `README.md`)
- App routing → App layout: wraps routes (evidence: `src/App.tsx`)
- App routing → Dashboard: routes to (evidence: `src/App.tsx`)
- App routing → Add words: routes to (evidence: `src/App.tsx`)
- App routing → Add phrases: routes to (evidence: `src/App.tsx`)
- App routing → Search and edit library: routes to (evidence: `src/App.tsx`)
- App routing → Practice arena: routes to (evidence: `src/App.tsx`)
- App routing → Settings and pairs: routes to (evidence: `src/App.tsx`)
- Dashboard → IndexedDB domain store: reads progress (evidence: `src/pages/Dashboard.tsx`)
- Dashboard → Analytics calculations: uses metrics (evidence: `src/pages/Dashboard.tsx`)
- Dashboard → Dashboard charts: renders (evidence: `src/pages/Dashboard.tsx`)
- Add words → IndexedDB domain store: saves entries
- Add phrases → IndexedDB domain store: saves entries
- Search and edit library → IndexedDB domain store: reads and mutates (evidence: `src/pages/Library.tsx`)
- Search and edit library → Selected language pair: uses selection (evidence: `src/pages/Library.tsx`)
- Search and edit library → Entry editor: opens editor (evidence: `src/pages/Library.tsx`)
- Practice arena → IndexedDB domain store: loads and saves sessions (evidence: `src/pages/PracticeArena.tsx`)
- Practice arena → Selected language pair: uses selection (evidence: `src/pages/PracticeArena.tsx`)
- Practice arena → Practice configuration: renders (evidence: `src/pages/PracticeArena.tsx`)
- Practice arena → Session timing and scoring: starts session (evidence: `src/pages/PracticeArena.tsx`)
- Session timing and scoring → Practice rules: checks answers (evidence: `src/hooks/use-practice-session.ts`)
- Practice arena → Timed answer screen: renders (evidence: `src/pages/PracticeArena.tsx`)
- Practice arena → Session results: renders (evidence: `src/pages/PracticeArena.tsx`)
- Settings and pairs → IndexedDB domain store: manages pairs and data (evidence: `src/pages/Settings.tsx`)
- Settings and pairs → JSON and CSV portability: imports and exports (evidence: `src/pages/Settings.tsx`)
- Settings and pairs → Selected language pair: uses pair state (evidence: `src/pages/Settings.tsx`)
- Selected language pair → Store persistence fallback: persists through (evidence: `src/store/language-pair-store.ts`)
- App routing → Error boundary: renders within (evidence: `src/main.tsx`)
- App routing → Toast display: renders alongside (evidence: `src/main.tsx`)
- Toast display → Toast state and errors: reads notifications (evidence: `src/components/Toaster.tsx`)
- App layout → Shared UI components: uses controls (evidence: `src/components/layout/AppLayout.tsx`)
- App layout → Error boundary: uses boundary (evidence: `src/components/layout/AppLayout.tsx`)
- Dashboard → Headers and mascot: uses header (evidence: `src/pages/Dashboard.tsx`)
- Search and edit library → Toast state and errors: reports mutation errors (evidence: `src/pages/Library.tsx`)
- Settings and pairs → Toast state and errors: reports database errors (evidence: `src/pages/Settings.tsx`)
