Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

RikiPath Mobile

Flutter mobile app for the RikiPath Japanese/JLPT learning platform.

Tech Stack

  • Flutter and Dart
  • Riverpod (flutter_riverpod) for state management and dependency injection
  • go_router for navigation
  • Dio for HTTP networking
  • Drift and drift_flutter for local persistence
  • flutter_secure_storage for authentication-token storage
  • build_runner and drift_dev for generated database code

Environment values are currently supplied with Dart compile-time definitions; the project does not use flutter_dotenv.

Requirements

  • Flutter stable compatible with the project's Dart SDK constraint (>=3.12.0 <4.0.0)
  • Tested and verified with Flutter 3.47.3
  • Android Studio with the Android SDK
  • Java 21 (the Android Studio JBR is recommended)
  • Android NDK 28.2.13676358
  • Git

The Dart SDK ships with Flutter and does not need to be installed separately. If another machine encounters a dependency or Android toolchain compatibility issue, Flutter 3.47.3 is the known-good fallback for this project.

Visual Studio is not required for Android development. It is only relevant when building Flutter Windows desktop applications.

Clone

git clone https://github.com/RikiPath/RikiPath.Mobile.git
cd RikiPath.Mobile

Environment Setup

Normal development uses built-in public defaults and does not require a local .env file:

flutter run

To override those defaults, create an optional local environment file:

New-Item .env -ItemType File

Add only the public values you need to override, using the variable names in Environment Configuration, then pass the file through Dart compile-time definitions:

flutter run --dart-define-from-file=.env

The built-in defaults target the current public development backend. Staging and production builds must supply their own deployment values. Never put secrets, JWT signing keys, database passwords, or backend private credentials in a Flutter .env file. Dart-defined values can be extracted from a built mobile application and are not secret storage. The local .env file is ignored by Git and must not be committed.

See Environment Configuration for environment-specific rules and the current development HTTP limitation.

Install Dependencies

flutter pub get

Generate Code

The Drift database uses generated Dart code:

dart run build_runner build

Rerun this command after changing Drift tables, database annotations, or other generated model definitions, and whenever generated .g.dart files are missing or out of date.

Localization output is generated from lib/l10n/app_vi.arb and lib/l10n/app_ja.arb. Regenerate it after changing either ARB file:

flutter gen-l10n

Run Application

List available devices:

flutter devices

Run the application:

flutter run

The plain command uses the public development defaults. To override them with an optional file, use:

flutter run --dart-define-from-file=.env

To start an Android emulator, open Android Studio, go to Tools > Device Manager, create a virtual device if needed, and press the play button beside the device. Wait for it to boot before running flutter devices or flutter run.

Android Debug Build

Create a local debug APK with:

flutter build apk --debug

The APK is written under build/, which is ignored by Git. Release signing is not configured for production distribution; do not treat a debug APK as a store-ready artifact.

Development Validation

Before committing, run:

dart format .
flutter analyze
flutter test

Current validated baseline at the time this guide was written:

  • flutter analyze: No issues found
  • flutter test: 583 tests passed
  • flutter build apk --debug: Passed

This is a current baseline, not a permanent guarantee; update it when the test suite or toolchain changes.

Project Structure

lib/
  app/        -> application bootstrap, router, and theme
  core/       -> configuration, networking, database, storage, and shared widgets
  features/   -> feature modules
test/         -> automated tests
docs/codex/   -> architecture, API, and implementation documentation

RikiPath.Backend/ is a local, strictly read-only backend contract reference and is not part of the mobile repository. docs/ui_reference/ contains local Stitch design references and is ignored by Git.

Architecture Rules

UI
  -> Controller/Provider
  -> Repository
  -> API/Database
  • Widgets must not call Dio directly.
  • Do not invent backend endpoints or DTO fields; use the documented API contract and read-only backend reference.
  • Reuse the centralized RikiPath design system.
  • The learner mobile JLPT scope is N5, N4, and N3.
  • Store authentication tokens through flutter_secure_storage.

Known Backend Limitations

Some learner flows intentionally remain local or hybrid until the Backend publishes complete, safe contracts. These include live Learning discovery, live Review submission, learner-safe Mock Test question delivery/submission, fixture Lesson-to-Notebook identity, Grammar Notebook semantics, payments and booking, and Mentor mutations/grading. Firebase Phone Auth is experimental Backend test functionality and is not part of the current Mobile scope.

See Backend Replacement Points and Backend Requests for the verified boundaries. Do not replace them with invented frontend behavior.

Git Workflow

Use Conventional Commits, with one logical feature per commit. Examples:

feat(auth): implement authentication flow
feat(learning): implement learning roadmap
fix(core): resolve API error mapping
docs(readme): update setup guide
chore(config): update development configuration
  • Do not commit .env.
  • Do not commit RikiPath.Backend/.
  • Do not commit ZIP archives, build output, or temporary files.
  • Never force push to main unless the team explicitly agrees.

Useful Commands

flutter pub get
dart run build_runner build
flutter gen-l10n
dart format .
flutter analyze
flutter test
flutter build apk --debug
flutter run

API Environment Profiles

Every app run/build must explicitly select API_PROFILE; there is no implicit remote or tunnel fallback.

For the Android Emulator connected to a backend on the developer's host:

flutter run --dart-define=API_PROFILE=local-emulator

For a verified remote server, supply its approved HTTPS origins explicitly:

flutter run `
  --dart-define=APP_ENV=development `
  --dart-define=API_PROFILE=remote `
  --dart-define=API_BASE_URL=<approved-https-origin> `
  --dart-define=SWAGGER_URL=<approved-swagger-url>

The remote profile requires API and Swagger URLs and disables API metadata logging by default. Production additionally requires HTTPS and logging off. The team Test Server URL is intentionally not embedded; request the current approved endpoint from the project operator before using the remote profile.

Troubleshooting

flutter is not recognized

Add the Flutter SDK /bin directory to PATH, restart the terminal, and try again.

Generated .g.dart files are missing

dart run build_runner build

Android toolchain issue

flutter doctor

Resolve the Android SDK, license, or Java issues reported by the command.

Dependencies are out of sync

flutter pub get

Documentation

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages