# isham002/vokabeltrainer architecture

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

- Interactive diagram: https://gitdiagram.com/isham002/vokabeltrainer
- Repository: https://github.com/isham002/vokabeltrainer

## Overview

Vokabeltrainer is a cross-platform Flutter vocabulary-learning app built around short training sessions and gamified progress. The main user journey is to choose a session, practice vocabulary, and receive progress feedback; vocabulary can also be added manually or imported from photographed lists. The README documents Firebase authentication and Firestore persistence, plus on-device OCR and offline translation. The source excerpts cover native desktop and iOS launch plumbing, not the Dart implementation, so feature relationships below rely on README statements rather than inspected Dart calls.

Main entry points: [`lib/ui/screens/start_session_screen.dart`](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/start_session_screen.dart) (Session setup), [`lib/ui/screens/active_learning_screen.dart`](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/active_learning_screen.dart) (Active learning), [`lib/services/training_service.dart`](https://github.com/isham002/vokabeltrainer/blob/master/lib/services/training_service.dart) (Training logic), [`lib/ui/screens/add_vocabulary_screen.dart`](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/add_vocabulary_screen.dart) (Vocabulary entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning flow"]
  node_session_start["Session setup"]
  node_practice["Active learning"]
  node_training["Training logic"]
  node_review["Session review"]
  node_dashboard["Dashboard"]
end

subgraph group_vocabulary["Vocabulary tools"]
  node_vocab_entry["Vocabulary entry"]
  node_ocr_scan["Photo scan"]
  node_ocr["Text extraction<br/>[ocr_service.dart]"]
  node_translation["Offline translation"]
  node_vocab_state["Vocabulary state"]
  node_vocab_store[("Vocabulary records")]
end

subgraph group_progress["Progress and rewards"]
  node_gamification["Gamification state"]
  node_leaderboard["League leaderboard"]
  node_profile["User profile<br/>[user_profile.dart]"]
end

subgraph group_platform["Identity and data"]
  node_auth_ui["Sign-in screen<br/>[auth_screen.dart]"]
  node_auth_state["Authentication state<br/>[auth_provider.dart]"]
  node_auth_service["Firebase authentication<br/>[auth_service.dart]"]
end

node_learner(("Learner"))
node_firebase_auth{{"Firebase Auth"}}
node_firestore[("Cloud Firestore")]

node_learner -->|"starts session"| node_session_start
node_session_start -->|"begins practice"| node_practice
node_practice -.->|"runs training"| node_training
node_training -.->|"reports results"| node_review
node_learner -->|"views progress"| node_dashboard
node_learner -->|"adds vocabulary"| node_vocab_entry
node_learner -->|"scans list"| node_ocr_scan
node_ocr_scan -->|"extracts text"| node_ocr
node_ocr -->|"translates offline"| node_translation
node_vocab_entry -.->|"updates vocabulary"| node_vocab_state
node_vocab_state -.->|"persists vocabulary"| node_vocab_store
node_learner -->|"views league"| node_leaderboard
node_gamification -.->|"supplies rankings"| node_leaderboard
node_auth_ui -.->|"submits credentials"| node_auth_state
node_auth_state -.->|"delegates sign-in"| node_auth_service
node_auth_service -->|"authenticates"| node_firebase_auth
node_vocab_store -->|"stores records"| node_firestore

click node_session_start "https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/start_session_screen.dart"
click node_practice "https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/active_learning_screen.dart"
click node_training "https://github.com/isham002/vokabeltrainer/blob/master/lib/services/training_service.dart"
click node_review "https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/success_review_screen.dart"
click node_dashboard "https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/dashboard_screen.dart"
click node_vocab_entry "https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/add_vocabulary_screen.dart"
click node_ocr_scan "https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/ocr_scan_screen.dart"
click node_ocr "https://github.com/isham002/vokabeltrainer/blob/master/lib/services/ocr_service.dart"
click node_translation "https://github.com/isham002/vokabeltrainer/blob/master/lib/services/translate_service.dart"
click node_vocab_state "https://github.com/isham002/vokabeltrainer/blob/master/lib/providers/vocabulary_provider.dart"
click node_vocab_store "https://github.com/isham002/vokabeltrainer/blob/master/lib/services/firestore_service.dart"
click node_gamification "https://github.com/isham002/vokabeltrainer/blob/master/lib/providers/gamification_provider.dart"
click node_leaderboard "https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/leaderboard_screen.dart"
click node_profile "https://github.com/isham002/vokabeltrainer/blob/master/lib/models/user_profile.dart"
click node_auth_ui "https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/auth_screen.dart"
click node_auth_state "https://github.com/isham002/vokabeltrainer/blob/master/lib/providers/auth_provider.dart"
click node_auth_service "https://github.com/isham002/vokabeltrainer/blob/master/lib/services/auth_service.dart"

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_session_start,node_practice,node_training,node_review,node_dashboard toneBlue
class node_vocab_entry,node_ocr_scan,node_ocr,node_translation,node_vocab_state,node_vocab_store,node_firestore toneAmber
class node_gamification,node_leaderboard,node_profile toneMint
class node_auth_ui,node_auth_state,node_auth_service toneRose
class node_learner,node_firebase_auth toneIndigo
```

## Components

### Learning flow

- [Session setup](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/start_session_screen.dart): `lib/ui/screens/start_session_screen.dart`
- [Active learning](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/active_learning_screen.dart): `lib/ui/screens/active_learning_screen.dart`
- [Training logic](https://github.com/isham002/vokabeltrainer/blob/master/lib/services/training_service.dart): `lib/services/training_service.dart`
- [Session review](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/success_review_screen.dart): `lib/ui/screens/success_review_screen.dart`
- [Dashboard](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/dashboard_screen.dart): `lib/ui/screens/dashboard_screen.dart`

### Vocabulary tools

- [Vocabulary entry](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/add_vocabulary_screen.dart): `lib/ui/screens/add_vocabulary_screen.dart`
- [Photo scan](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/ocr_scan_screen.dart): `lib/ui/screens/ocr_scan_screen.dart`
- [Text extraction](https://github.com/isham002/vokabeltrainer/blob/master/lib/services/ocr_service.dart): `lib/services/ocr_service.dart`
- [Offline translation](https://github.com/isham002/vokabeltrainer/blob/master/lib/services/translate_service.dart): `lib/services/translate_service.dart`
- [Vocabulary state](https://github.com/isham002/vokabeltrainer/blob/master/lib/providers/vocabulary_provider.dart): `lib/providers/vocabulary_provider.dart`
- [Vocabulary records](https://github.com/isham002/vokabeltrainer/blob/master/lib/services/firestore_service.dart): `lib/services/firestore_service.dart`

### Progress and rewards

- [Gamification state](https://github.com/isham002/vokabeltrainer/blob/master/lib/providers/gamification_provider.dart): `lib/providers/gamification_provider.dart`
- [League leaderboard](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/leaderboard_screen.dart): `lib/ui/screens/leaderboard_screen.dart`
- [User profile](https://github.com/isham002/vokabeltrainer/blob/master/lib/models/user_profile.dart): `lib/models/user_profile.dart`

### Identity and data

- [Sign-in screen](https://github.com/isham002/vokabeltrainer/blob/master/lib/ui/screens/auth_screen.dart): `lib/ui/screens/auth_screen.dart`
- [Authentication state](https://github.com/isham002/vokabeltrainer/blob/master/lib/providers/auth_provider.dart): `lib/providers/auth_provider.dart`
- [Firebase authentication](https://github.com/isham002/vokabeltrainer/blob/master/lib/services/auth_service.dart): `lib/services/auth_service.dart`

### Other components

- **Learner**
- **Firebase Auth**
- **Cloud Firestore**

## Connections

- Learner → Session setup: starts session (evidence: `README.md`)
- Session setup → Active learning: begins practice (evidence: `README.md`)
- Active learning → Training logic: runs training
- Training logic → Session review: reports results
- Learner → Dashboard: views progress (evidence: `README.md`)
- Learner → Vocabulary entry: adds vocabulary (evidence: `README.md`)
- Learner → Photo scan: scans list (evidence: `README.md`)
- Photo scan → Text extraction: extracts text (evidence: `README.md`)
- Text extraction → Offline translation: translates offline (evidence: `README.md`)
- Vocabulary entry → Vocabulary state: updates vocabulary
- Vocabulary state → Vocabulary records: persists vocabulary
- Learner → League leaderboard: views league (evidence: `README.md`)
- Gamification state → League leaderboard: supplies rankings
- Sign-in screen → Authentication state: submits credentials
- Authentication state → Firebase authentication: delegates sign-in
- Firebase authentication → Firebase Auth: authenticates (evidence: `README.md`)
- Vocabulary records → Cloud Firestore: stores records (evidence: `README.md`)
