# maadhu938/minnalearn-app architecture

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

- Interactive diagram: https://gitdiagram.com/maadhu938/minnalearn-app
- Repository: https://github.com/maadhu938/minnalearn-app

## Overview

1. **Overall shape**
   - MinnaLearn is a **Flutter client application** in `flutter_minnalearn/`, built as a **single Dart app** that runs across Android, iOS, web, macOS, Windows, and Linux.
   - There is **no custom backend in this repo**; the app talks to **Firebase Authentication** and **Cloud Firestore** for cloud features, and uses **SQLite locally** for primary app state.

2. **App bootstrap and navigation**
   - `lib/main.dart` is the entry point and likely initializes Flutter/Firebase, then hands off to `startup_screen.dart`.
   - `startup_screen.dart` appears to coordinate first-run setup such as database initialization, notification setup, and routing.
   - `main_screen.dart` is the main shell after login/onboarding, using a **bottom-tab/PageView style navigation** across Home, Lessons, Games, Stats, and Profile.

3. **Content model and curriculum boundary**
   - The learning content is organized around **25 lessons**.
   - Lesson structure is represented in `lib/models/lesson.dart`, while `lib/data/minna_data.dart` and `lib/data/n5_kanji_data.dart` hold the curated study content.
   - This is the core curriculum boundary: lessons aggregate vocabulary, kanji, and grammar tied to a progression from N5 material.

4. **Local content and asset-driven data flow**
   - The app relies heavily on bundled assets in `assets/`:
     - `assets/vocab/*.txt` for vocabulary by lesson
     - `assets/grammar/*.txt` for lesson grammar points
     - `assets/audio/*.mp3` for feedback sounds
   - `data_seeder.dart` is the key bridge from bundled files into the local database, so the study content is not hardcoded in the UI.

5. **Local persistence as the primary state store**
   - `database_service.dart` is the main CRUD boundary for **SQLite** storage.
   - This local database likely stores progress, learned items, bookmarks, game history, streaks, and completion state.
   - The app’s learning and stats features should be diagrammed as reading from and writing to this local state layer first, with cloud sync layered on top.

6. **Cloud sync and identity**
   - `auth_service.dart` handles sign-in, supporting **email/password and Google Sign-In**.
   - `cloud_service.dart` syncs user data to **Firestore**, specifically progress, achievements, bookmarks, and learned kanji.
   - In the architecture, Firebase is an external service boundary: authentication establishes identity, and Firestore mirrors selected app state for continuity across devices.

7. **Learning experiences**
   - The main study screens are split into distinct modes:
     - `lessons_screen.dart` and `lesson_detail_screen.dart` act as the lesson hub
     - `flashcards_screen.dart`, `vocabulary_list_screen.dart`, and `grammar_screen.dart` support structured study
     - `kanji_screen.dart` handles kanji flashcards, writing practice, and quizzes
     - `quiz_screen.dart` covers lesson quizzes and completion flow
   - These screens consume the shared lesson/content model but present different learning interactions.

8. **Mini-games and quiz generation**
   - `games_screen.dart` is the hub for practice games.
   - The game-specific screens are `matching_game_screen.dart`, `true_or_false_screen.dart`, `typing_test_screen.dart`, and `kana_puzzle_screen.dart`.
   - `quiz_engine.dart` is the shared logic boundary for generating questions, scoring, and feeding both quiz and game flows.
   - This is a good place in a diagram to show a **shared engine reused by multiple practice modes**.

9. **Feedback, audio, and speech**
   - `audio_service.dart` plays local sound effects like correct/wrong/click/success.
   - `speech_service.dart` provides text-to-speech for pronunciation and vocabulary reading.
   - `kanji_drawing_board.dart` supports writing practice as an interactive canvas.
   - These services are presentation-adjacent but functionally separate from content and persistence, and they depend on platform capabilities.

10. **Progress, achievements, and study tracking**
   - `stats_screen.dart` presents study streaks, weekly time, mastery meters, and score history.
   - `achievement_service.dart` defines and unlocks achievements across lessons, streaks, vocabulary, kanji, and scores.
   - `study_timer_service.dart` tracks study time, likely feeding stats and streak logic.
   - This subsystem reads from local progress data and writes derived state back to persistence and cloud sync.

11. **Notifications and retention**
   - `notification_service.dart` manages local scheduled reminders and permission flow, especially on Android 13+.
   - The scheduled reminders described in the README are daily study nudges and streak recovery reminders.
   - Architecturally, this is a client-side retention subsystem that depends on timezone/date scheduling rather than any server jobs.

12. **UI composition and reusable widgets**
   - Shared visual components live under `lib/widgets/`:
     - `bottom_nav.dart`
     - `feature_card.dart`
     - `stat_card.dart`
     - `kanji_drawing_board.dart`
   - `lib/utils/vocabulary_display.dart` provides formatting/display helpers used across screens.
   - The UI is therefore composed from a reusable widget layer above the screen layer, with services injected or called from screens.

13. **Platform wrappers and native shells**
   - `android/`, `ios/`, `macos/`, `windows/`, `linux/`, and `web/` are the generated platform shells Flutter uses to host the Dart app.
   - Native files like `MainActivity.kt`, `AppDelegate.swift`, and platform-specific build files are mostly integration scaffolding rather than business logic.
   - An architecture diagram should show these as thin wrappers around the shared Flutter runtime.

14. **Public docs and policy pages**
   - `docs/` and `flutter_minnalearn/delete_account.html` indicate a small public-facing static-doc boundary, including privacy policy and account deletion pages.
   - `store_listing.md` suggests app-store metadata is maintained alongside code, but it is not part of runtime architecture.

15. **Tests and quality boundary**
   - There is a lightweight test surface in `test/widget_test.dart` plus platform template tests in `ios/RunnerTests` and `macos/RunnerTests`.
   - The repo does not show a large dedicated backend or CI architecture, so the main runtime diagram should focus on the Flutter app, local storage, Firebase, and device services.

Main entry points: [`flutter_minnalearn/lib/services/database_service.dart`](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/services/database_service.dart) (SQLite state), [`flutter_minnalearn/lib/screens/main_screen.dart`](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/main_screen.dart) (Main shell), [`flutter_minnalearn/lib/main.dart`](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/main.dart) (Main), [`flutter_minnalearn/lib/screens/startup_screen.dart`](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/startup_screen.dart) (Startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_app["Flutter app"]
  node_node_main(("Main<br/>Flutter entry<br/>[main.dart]"))
  node_node_startup["Startup<br/>App bootstrap"]
  node_node_main_screen["Main shell<br/>Nav shell<br/>[main_screen.dart]"]
  node_node_auth["Auth<br/>Login screen<br/>[auth_screen.dart]"]
  node_node_onboarding["Onboarding<br/>Intro flow"]
  node_node_home["Home<br/>Dashboard screen<br/>[home_screen.dart]"]
  node_node_lessons["Lessons<br/>Lesson hub"]
  node_node_lesson_detail["Lesson detail<br/>Lesson view"]
  node_node_study["Study modes<br/>Study screens"]
  node_node_kanji["Kanji<br/>[kanji_screen.dart]"]
  node_node_quiz["Quiz<br/>Assessment screen<br/>[quiz_screen.dart]"]
  node_node_games["Games<br/>Practice hub<br/>[games_screen.dart]"]
  node_node_game_modes["Game modes<br/>Practice screens"]
  node_node_profile_stats["Profile & stats<br/>Progress screens"]
  node_node_widgets["Widgets<br/>UI components<br/>[bottom_nav.dart]"]
end

subgraph group_group_data["Content & state"]
  node_node_lessons_data["Curriculum data<br/>Lesson models<br/>[lesson.dart]"]
  node_node_assets["Bundled content<br/>Asset corpus<br/>[vocab1.txt]"]
  node_node_seeder_db[("SQLite state<br/>Local persistence")]
  node_node_cloud[("Firebase sync<br/>Cloud boundary<br/>[cloud_service.dart]")]
end

subgraph group_group_services["Services"]
  node_node_quiz_engine{{"Quiz engine<br/>Question engine<br/>[quiz_engine.dart]"}}
  node_node_services_core{{"Device services<br/>Client services<br/>[audio_service.dart]"}}
end

subgraph group_group_platform["Platform shells"]
  node_node_android["Android<br/>Native shell<br/>[MainActivity.kt]"]
  node_node_ios["iOS<br/>Native shell<br/>[AppDelegate.swift]"]
  node_node_desktop["Desktop shells<br/>Native shells<br/>[AppDelegate.swift]"]
  node_node_web["Web shell<br/>Web host<br/>[index.html]"]
end

subgraph group_group_docs["Docs"]
  node_node_docs["Docs pages<br/>Static docs"]
end

node_node_main -->|"boots"| node_node_startup
node_node_startup -->|"routes to"| node_node_auth
node_node_startup -->|"routes to"| node_node_onboarding
node_node_startup -->|"opens"| node_node_main_screen
node_node_main_screen -->|"tab"| node_node_home
node_node_main_screen -->|"tab"| node_node_lessons
node_node_main_screen -->|"tab"| node_node_games
node_node_main_screen -->|"tab"| node_node_profile_stats
node_node_lessons -->|"drills into"| node_node_lesson_detail
node_node_lesson_detail -->|"launches"| node_node_study
node_node_lesson_detail -->|"assesses"| node_node_quiz
node_node_study -->|"reads"| node_node_lessons_data
node_node_kanji -->|"reads"| node_node_lessons_data
node_node_quiz -->|"uses"| node_node_quiz_engine
node_node_game_modes -->|"uses"| node_node_quiz_engine
node_node_quiz_engine -->|"derives from"| node_node_lessons_data
node_node_lessons_data -->|"sourced from"| node_node_assets
node_node_assets -->|"seeded into"| node_node_seeder_db
node_node_home -->|"reads"| node_node_seeder_db
node_node_lessons -->|"reads"| node_node_seeder_db
node_node_profile_stats -->|"reads/writes"| node_node_seeder_db
node_node_kanji -->|"writes"| node_node_seeder_db
node_node_seeder_db -->|"syncs"| node_node_cloud
node_node_cloud -->|"depends on"| node_node_auth
node_node_services_core -->|"tracks"| node_node_seeder_db
node_node_services_core -->|"syncs"| node_node_cloud
node_node_services_core -->|"supports"| node_node_game_modes
node_node_widgets -->|"composes"| node_node_main_screen
node_node_widgets -->|"composes"| node_node_profile_stats
node_node_android -->|"hosts"| node_node_main
node_node_ios -->|"hosts"| node_node_main
node_node_desktop -->|"hosts"| node_node_main
node_node_web -->|"hosts"| node_node_main
node_node_docs -.->|"separate boundary"| node_node_cloud

click node_node_main "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/main.dart"
click node_node_startup "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/startup_screen.dart"
click node_node_main_screen "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/main_screen.dart"
click node_node_auth "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/auth_screen.dart"
click node_node_onboarding "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/onboarding_screen.dart"
click node_node_home "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/home_screen.dart"
click node_node_lessons "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/lessons_screen.dart"
click node_node_lesson_detail "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/lesson_detail_screen.dart"
click node_node_study "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/flashcards_screen.dart"
click node_node_kanji "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/kanji_screen.dart"
click node_node_quiz "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/quiz_screen.dart"
click node_node_games "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/games_screen.dart"
click node_node_game_modes "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/matching_game_screen.dart"
click node_node_profile_stats "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/profile_screen.dart"
click node_node_lessons_data "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/models/lesson.dart"
click node_node_assets "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/assets/vocab/vocab1.txt"
click node_node_seeder_db "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/services/database_service.dart"
click node_node_cloud "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/services/cloud_service.dart"
click node_node_quiz_engine "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/services/quiz_engine.dart"
click node_node_services_core "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/services/audio_service.dart"
click node_node_widgets "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/widgets/bottom_nav.dart"
click node_node_android "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/android/app/src/main/kotlin/com/maadhu/minnalearn/MainActivity.kt"
click node_node_ios "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/ios/Runner/AppDelegate.swift"
click node_node_desktop "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/macos/Runner/AppDelegate.swift"
click node_node_web "https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/web/index.html"
click node_node_docs "https://github.com/maadhu938/minnalearn-app/blob/main/docs/privacy-policy.html"

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_node_main,node_node_startup,node_node_main_screen,node_node_auth,node_node_onboarding,node_node_home,node_node_lessons,node_node_lesson_detail,node_node_study,node_node_kanji,node_node_quiz,node_node_games,node_node_game_modes,node_node_profile_stats,node_node_widgets toneBlue
class node_node_lessons_data,node_node_assets,node_node_seeder_db,node_node_cloud toneAmber
class node_node_quiz_engine,node_node_services_core toneMint
class node_node_android,node_node_ios,node_node_desktop,node_node_web toneRose
class node_node_docs toneIndigo
```

## Components

### Flutter app

Shared Dart runtime and UI architecture

- [Main](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/main.dart): Flutter entry · App bootstrap and top-level initialization · `flutter_minnalearn/lib/main.dart`
- [Startup](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/startup_screen.dart): App bootstrap · First-run setup, init, and routing gate · `flutter_minnalearn/lib/screens/startup_screen.dart`
- [Main shell](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/main_screen.dart): Nav shell · Bottom-tab app shell after onboarding/login · `flutter_minnalearn/lib/screens/main_screen.dart`
- [Auth](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/auth_screen.dart): Login screen · Sign-in and account access entry point · `flutter_minnalearn/lib/screens/auth_screen.dart`
- [Onboarding](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/onboarding_screen.dart): Intro flow · First-time user introduction and setup · `flutter_minnalearn/lib/screens/onboarding_screen.dart`
- [Home](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/home_screen.dart): Dashboard screen · Landing view for study progress and shortcuts · `flutter_minnalearn/lib/screens/home_screen.dart`
- [Lessons](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/lessons_screen.dart): Lesson hub · Lesson catalog and lesson navigation · `flutter_minnalearn/lib/screens/lessons_screen.dart`
- [Lesson detail](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/lesson_detail_screen.dart): Lesson view · Detailed lesson progression and content sections · `flutter_minnalearn/lib/screens/lesson_detail_screen.dart`
- [Study modes](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/flashcards_screen.dart): Study screens · Flashcards, vocabulary, grammar, and kanji study views · `flutter_minnalearn/lib/screens/flashcards_screen.dart`
- [Kanji](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/kanji_screen.dart): Kanji study · Kanji flashcards, writing practice, and quizzes · `flutter_minnalearn/lib/screens/kanji_screen.dart`
- [Quiz](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/quiz_screen.dart): Assessment screen · Lesson quiz and completion flow · `flutter_minnalearn/lib/screens/quiz_screen.dart`
- [Games](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/games_screen.dart): Practice hub · Mini-game launcher and practice selection · `flutter_minnalearn/lib/screens/games_screen.dart`
- [Game modes](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/matching_game_screen.dart): Practice screens · Matching, true/false, typing, and kana puzzle modes · `flutter_minnalearn/lib/screens/matching_game_screen.dart`
- [Profile & stats](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/screens/profile_screen.dart): Progress screens · Profile, achievements, streaks, and study analytics · `flutter_minnalearn/lib/screens/profile_screen.dart`
- [Widgets](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/widgets/bottom_nav.dart): UI components · Reusable bottom nav, stat cards, feature cards, and drawing board · `flutter_minnalearn/lib/widgets/bottom_nav.dart`

### Content & state

Curriculum assets, local persistence, and sync boundaries

- [Curriculum data](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/models/lesson.dart): Lesson models · Lesson structure and curated N5 study content · `flutter_minnalearn/lib/models/lesson.dart`
- [Bundled content](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/assets/vocab/vocab1.txt): Asset corpus · Vocabulary, grammar, and audio assets for lessons · `flutter_minnalearn/assets/vocab/vocab1.txt`
- [SQLite state](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/services/database_service.dart): Local persistence · Seeds and manages the on-device database for progress and study state · `flutter_minnalearn/lib/services/database_service.dart`
- [Firebase sync](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/services/cloud_service.dart): Cloud boundary · Authentication and Firestore-backed user state synchronization · `flutter_minnalearn/lib/services/cloud_service.dart`

### Services

Cross-cutting app services used by screens

- [Quiz engine](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/services/quiz_engine.dart): Question engine · Shared generator and scorer for quizzes and practice games · `flutter_minnalearn/lib/services/quiz_engine.dart`
- [Device services](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/lib/services/audio_service.dart): Client services · Audio, speech, notifications, study timer, achievements, and analytics · `flutter_minnalearn/lib/services/audio_service.dart`

### Platform shells

Native wrappers that host the Flutter app

- [Android](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/android/app/src/main/kotlin/com/maadhu/minnalearn/MainActivity.kt): Native shell · Platform host and Android integration scaffolding · `flutter_minnalearn/android/app/src/main/kotlin/com/maadhu/minnalearn/MainActivity.kt`
- [iOS](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/ios/Runner/AppDelegate.swift): Native shell · Platform host and iOS integration scaffolding · `flutter_minnalearn/ios/Runner/AppDelegate.swift`
- [Desktop shells](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/macos/Runner/AppDelegate.swift): Native shells · macOS, Windows, and Linux Flutter host wrappers · `flutter_minnalearn/macos/Runner/AppDelegate.swift`
- [Web shell](https://github.com/maadhu938/minnalearn-app/blob/main/flutter_minnalearn/web/index.html): Web host · Browser entry page and manifest wrapper · `flutter_minnalearn/web/index.html`

### Docs

Public static pages and store metadata

- [Docs pages](https://github.com/maadhu938/minnalearn-app/blob/main/docs/privacy-policy.html): Static docs · Privacy policy and account deletion pages · `docs/privacy-policy.html`

## Connections

- Main → Startup: boots · Main initializes app services and hands off to startup flow
- Startup → Auth: routes to · Startup directs unauthenticated users to sign-in
- Startup → Onboarding: routes to · Startup can launch first-run onboarding
- Startup → Main shell: opens · Startup transitions into the main shell when ready
- Main shell → Home: tab · Main shell exposes home as one primary tab
- Main shell → Lessons: tab · Main shell exposes lessons as one primary tab
- Main shell → Games: tab · Main shell exposes games as one primary tab
- Main shell → Profile & stats: tab · Main shell exposes profile and stats views
- Lessons → Lesson detail: drills into · Lesson hub opens individual lesson details
- Lesson detail → Study modes: launches · Lesson detail leads into study-specific views
- Lesson detail → Quiz: assesses · Lesson completion can launch quizzes
- Study modes → Curriculum data: reads · Study screens render the shared curriculum model
- Kanji → Curriculum data: reads · Kanji study uses the same progression content
- Quiz → Quiz engine: uses · Quizzes are generated and scored by the shared engine
- Game modes → Quiz engine: uses · Mini-games reuse shared question and scoring logic
- Quiz engine → Curriculum data: derives from · Question generation depends on lesson and vocabulary data
- Curriculum data → Bundled content: sourced from · Curriculum content is bundled in vocab, grammar, and audio assets
- Bundled content → SQLite state: seeded into · Seed process loads bundled content into local storage
- Home → SQLite state: reads · Dashboard shows progress from local state
- Lessons → SQLite state: reads · Lesson unlocks and completion state come from local storage
- Profile & stats → SQLite state: reads/writes · Progress, streaks, achievements, and history are tracked locally
- Kanji → SQLite state: writes · Kanji mastery and writing progress are persisted locally
- SQLite state → Firebase sync: syncs · Selected user state is mirrored to Firestore
- Firebase sync → Auth: depends on · Cloud sync relies on authenticated identity
- Device services → SQLite state: tracks · Study timer and achievement logic consume local progress
- Device services → Firebase sync: syncs · Retention and progress services can mirror state to cloud
- Device services → Game modes: supports · Audio, speech, notifications, and drawing enhance practice flows
- Widgets → Main shell: composes · Shared widgets build navigation and summary UI
- Widgets → Profile & stats: composes · Reusable stat and feature cards support dashboards
- Android → Main: hosts · Android shell runs the Flutter entrypoint
- iOS → Main: hosts · iOS shell runs the Flutter entrypoint
- Desktop shells → Main: hosts · Desktop shells run the Flutter entrypoint
- Web shell → Main: hosts · Web host loads the Flutter app in browser
- Docs pages → Firebase sync: separate boundary · Static policy and account pages sit outside the app runtime
