How bill-gd/fpt_jp works
Project Type & Purpose
• Type: A cross-platform Flutter mobile/desktop app (Android & Windows targets)
• Purpose: Track and revise Japanese coursework (kanji lessons, vocabulary), following an MVVM-style separation (even if simplified).
High-Level Architecture Overview
a. Platform & Runtime
– Android Runner & Windows Runner (bind the OS window, lifecycle → Flutter Engine)
– Flutter Engine (Dart VM, rendering)
b. Dart App Layers (lib/)
1. UI Layer (screens & widgets)
3. Data Layer
– Repositories (kanji, vocab, about)
– Database Handler (SQLite schema from database.sql)
4. Domain Layer (pure models: KanjiLesson, Vocab, etc.)
5. Utilities & Assets (helpers, extensions, fonts/images)
File Structure
• android/, windows/: Platform-specific runners & build scripts.
• lib/main.dart: App entry point → initializes platform channels, DI, routes.
• lib/ui/: Flutter screens (home, kanji, vocab, about) composes widgets.
• lib/data/repositories/: Abstracts all data operations.
• lib/utils/handlers/database_handler.dart: Manages raw DB connections & queries.
• assets/: Static resources (fonts, images).
Key Architectural Patterns & Flows
• MVVM-style (View ↔ ViewModel ↔ Model).
• Repository Pattern isolating data sources.
• Single local SQLite database as the only persistence layer.
• No external network services.
• Flutter’s widget tree + custom styling in lib/ui/core/styling.
– Android Runner / Windows Runner
– Flutter Engine
– UI Layer (group lib/ui/…)
– ViewModel Layer (if present)
– Repository Layer (lib/data/repositories)
– Database (SQLite)
– Domain Models (lib/domain/models)
– Utilities & Assets
1. Platform Runners → Flutter Engine.
2. Flutter Engine → main.dart → initialize ViewModels or DI.
3. UI Layer → calls into ViewModels or directly into Repositories.
4. Repositories → Database Handler → SQLite store.
5. Database → returns raw rows → Repositories → map to Domain Models → back up to UI.
c. Patterns:
– Repository Pattern between UI/ViewModel and DB.
– Domain Models locked in a separate layer.
d. Technologies & Frameworks:
– Flutter (Dart)
– SQLite (via raw SQL in database.sql)
– MVVM concepts
– Flutter’s Navigator & Material widgets