How maadhu938/minnalearn-app works
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: database_service.dart SQLite state · main_screen.dart Main shell · main.dart Main · startup_screen.dart Startup
Components 26
Flutter app
Shared Dart runtime and UI architecture
- Main · App bootstrap and top-level initialization
flutter_minnalearn/lib/main.dart - Startup · First-run setup, init, and routing gate
flutter_minnalearn/lib/screens/startup_screen.dart - Main shell · Bottom-tab app shell after onboarding/login
flutter_minnalearn/lib/screens/main_screen.dart - Auth · Sign-in and account access entry point
flutter_minnalearn/lib/screens/auth_screen.dart - Onboarding · First-time user introduction and setup
flutter_minnalearn/lib/screens/onboarding_screen.dart - Home · Landing view for study progress and shortcuts
flutter_minnalearn/lib/screens/home_screen.dart - Lessons · Lesson catalog and lesson navigation
flutter_minnalearn/lib/screens/lessons_screen.dart - Lesson detail · Detailed lesson progression and content sections
flutter_minnalearn/lib/screens/lesson_detail_screen.dart - Study modes · Flashcards, vocabulary, grammar, and kanji study views
flutter_minnalearn/lib/screens/flashcards_screen.dart - Kanji · Kanji flashcards, writing practice, and quizzes
flutter_minnalearn/lib/screens/kanji_screen.dart - Quiz · Lesson quiz and completion flow
flutter_minnalearn/lib/screens/quiz_screen.dart - Games · Mini-game launcher and practice selection
flutter_minnalearn/lib/screens/games_screen.dart - Game modes · Matching, true/false, typing, and kana puzzle modes
flutter_minnalearn/lib/screens/matching_game_screen.dart - Profile & stats · Profile, achievements, streaks, and study analytics
flutter_minnalearn/lib/screens/profile_screen.dart - Widgets · 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 · Lesson structure and curated N5 study content
flutter_minnalearn/lib/models/lesson.dart - Bundled content · Vocabulary, grammar, and audio assets for lessons
flutter_minnalearn/assets/vocab/vocab1.txt - SQLite state · Seeds and manages the on-device database for progress and study state
flutter_minnalearn/lib/services/database_service.dart - Firebase sync · Authentication and Firestore-backed user state synchronization
flutter_minnalearn/lib/services/cloud_service.dart
Services
Cross-cutting app services used by screens
- Quiz engine · Shared generator and scorer for quizzes and practice games
flutter_minnalearn/lib/services/quiz_engine.dart - Device 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 · Platform host and Android integration scaffolding
flutter_minnalearn/android/app/src/main/kotlin/com/maadhu/minnalearn/MainActivity.kt - iOS · Platform host and iOS integration scaffolding
flutter_minnalearn/ios/Runner/AppDelegate.swift - Desktop shells · macOS, Windows, and Linux Flutter host wrappers
flutter_minnalearn/macos/Runner/AppDelegate.swift - Web shell · Browser entry page and manifest wrapper
flutter_minnalearn/web/index.html
Docs
Public static pages and store metadata
- Docs pages · Privacy policy and account deletion pages
docs/privacy-policy.html
Connections 34
- 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