mosenioring/front001/mosenioring
2026-01-12 22:43:29 +01:00
..
android login seems to work 2026-01-12 20:12:10 +01:00
assets doesnt work 2026-01-12 18:38:15 +01:00
ios doesnt work 2026-01-12 18:38:15 +01:00
lib works better 2026-01-12 22:39:32 +01:00
linux iteration with extr strs 2026-01-09 17:35:26 +01:00
macos integration, some parts works 2026-01-09 19:47:24 +01:00
test works better 2026-01-12 22:39:32 +01:00
web init 2026-01-09 15:55:15 +01:00
windows iteration with extr strs 2026-01-09 17:35:26 +01:00
.gitignore init 2026-01-09 15:55:15 +01:00
analysis_options.yaml init 2026-01-09 15:55:15 +01:00
l10n.yaml iteration with extr strs 2026-01-09 17:35:26 +01:00
pubspec.yaml doesnt work 2026-01-12 18:38:15 +01:00
README.md front docs improvement 2026-01-12 22:43:29 +01:00

mosenioring

Flutter app scaffolded with clean architecture layers, Riverpod state management, and a login flow ready to integrate with a Swagger/OpenAPI backend.

Architecture

  • lib/src/app: app shell + router (GoRouter)
  • lib/src/di: dependency providers
  • lib/src/core: config, networking, and core utilities
  • lib/src/features/auth: auth domain/data/presentation
  • lib/src/features/home: home screen
  • lib/src/features/telemetry: telemetry domain/data/presentation
  • lib/l10n: localization (arb files)

Configuration

Runtime configuration is provided via --dart-define values.

Auth + environment flags:

  • API_BASE_URL (required)
  • USE_LOCAL_AUTH (true/false, default: false)
  • LOCAL_TENANT_ID (default: 11111111-1111-1111-1111-111111111111)
  • LOCAL_ROLES (default: CAREGIVER)
  • KEYCLOAK_ISSUER_URI or KEYCLOAK_ISSUER (required when USE_LOCAL_AUTH=false)
  • KEYCLOAK_CLIENT_ID (required when USE_LOCAL_AUTH=false)
  • KEYCLOAK_REDIRECT_URL (required when USE_LOCAL_AUTH=false)

Local dev behavior:

  • When USE_LOCAL_AUTH=true, the app keeps the email/password fields and sends X-Local-Email, X-Local-Roles, and X-Tenant-Id headers to the backend.
  • The backend must run with SPRING_PROFILES_ACTIVE=local and ALLOW_LOCAL_AUTH=true.
  • Keycloak login via flutter_appauth is supported only on Android/iOS.

Keycloak redirect URI to register:

  • com.mosenioring.app://oauth2redirect (Android + iOS)

Swagger/OpenAPI integration

When the spec is ready, generate a client and replace ApiClient usage:

  1. Save your spec (e.g., openapi.yaml) or point to its URL.
  2. Generate a Dart client (OpenAPI Generator or Swagger Codegen).
  3. Swap AuthRemoteDataSource or TelemetryRemoteDataSource to call the generated client.

Running

flutter pub get
flutter run

Local run

flutter run \
  --dart-define=API_BASE_URL=http://10.0.2.2:8080 \
  --dart-define=USE_LOCAL_AUTH=true

Android emulator note:

  • Use 10.0.2.2 instead of localhost for API_BASE_URL and KEYCLOAK_ISSUER_URI.
  • http:// Keycloak issuers are allowed for local dev; the app enables insecure connections automatically for non-HTTPS issuers.
  • iOS dev builds allow HTTP via App Transport Security; tighten this for production.

Quick start (Keycloak mode):

flutter run -d emulator-5554 \
  --dart-define=API_BASE_URL=http://10.0.2.2:8080 \
  --dart-define=KEYCLOAK_ISSUER_URI=http://10.0.2.2:8081/realms/mosenioring \
  --dart-define=KEYCLOAK_CLIENT_ID=mosenioring-mobile \
  --dart-define=KEYCLOAK_REDIRECT_URL=com.mosenioring.app://oauth2redirect

Quick start (local auth, no Keycloak):

export SPRING_PROFILES_ACTIVE=local
export ALLOW_LOCAL_AUTH=true

flutter run -d <device_id> \
  --dart-define=API_BASE_URL=http://10.0.2.2:8080 \
  --dart-define=USE_LOCAL_AUTH=true \
  --dart-define=LOCAL_TENANT_ID=11111111-1111-1111-1111-111111111111 \
  --dart-define=LOCAL_ROLES=CAREGIVER

Redirect configuration:

  • Android: android/app/build.gradle.kts sets appAuthRedirectScheme/appAuthRedirectHost for AppAuth, and android/app/src/main/AndroidManifest.xml registers the RedirectUriReceiverActivity.
  • iOS: ios/Runner/Info.plist registers com.mosenioring.app under CFBundleURLTypes.
  • Localization: l10n.yaml and lib/l10n/*.arb files.

Launcher icons:

dart run flutter_launcher_icons