Skip to content

Latest commit

 

History

History
60 lines (51 loc) · 2.49 KB

File metadata and controls

60 lines (51 loc) · 2.49 KB

AllergenGuard - Mobile App (MenuFrontend)

Project Overview

KMP mobile app (Android/iOS) for consumers to browse restaurant menus and filter dishes by allergens. Part of the Menus platform (Jira project: MEN).

Architecture

  • Pattern: MVVM + Clean Architecture
  • DI: Koin (koinViewModel(), viewModelOf(), singleOf())
  • Navigation: Compose Navigation with @Serializable type-safe routes
  • State: MutableStateFlow + .collectAsStateWithLifecycle()
  • Networking: Ktor Client (OkHttp Android, Darwin iOS) - not yet implemented
  • Images: Coil 3

Package Structure

com.apptolast.menufrontend/
  core/theme/          - Color.kt, Theme.kt, Type.kt (DM Sans font)
  core/navigation/     - Routes.kt, Navigation.kt
  di/                  - AppModule.kt (Koin modules + initKoin)
  domain/model/        - Allergen, Restaurant, Dish, User
  data/repository/     - Repository interfaces
  data/fake/           - Fake implementations with hardcoded data
  features/{feature}/
    data/              - State + Action sealed interfaces
    presentation/      - ScreenRoot (VM-connected) + Screen (stateless) + ViewModel
    components/        - Feature-specific composables
  features/components/ - Shared composables (BottomNavigationBar, AllergenIcon)

Conventions

  • Colors: NEVER hardcode. Use MaterialTheme.colorScheme.* or semantic colors from Color.kt (SafeGreen, DangerRed, etc.)
  • Strings: NEVER hardcode. Use stringResource(Res.string.*). Default language: ES (values/strings.xml), EN in values-en/strings.xml
  • Screen pattern: ScreenRoot connects ViewModel via koinViewModel() and collects state. Screen is a stateless composable receiving state + onAction lambda.
  • Effects: Use MutableSharedFlow<Effect> for one-shot navigation events
  • State updates: Use _state.update { it.copy(...) } for thread-safe modifications

Git Workflow

  • Branch from main
  • Commit prefix: MEN-XX: description (Jira ticket reference)
  • Run code quality checks before committing

Build & Run

# Android
./gradlew composeApp:assembleDebug

# iOS
Open iosApp/iosApp.xcodeproj in Xcode

# Compile check (both targets)
./gradlew composeApp:compileDebugKotlinAndroid
./gradlew composeApp:compileKotlinIosSimulatorArm64

Key Design Tokens (from Pencil mockups)

  • Primary: #3B82F6 (blue)
  • Safe: #22C55E (green) - allergen-free dishes
  • Warning: #F59E0B (orange)
  • Danger: #EF4444 (red) - contains user's allergens
  • Font: DM Sans (Regular, Medium, SemiBold, Bold)