How imayordomo/lks_parking works
1. What this repo is
- A single Android application module (app/) for managing parking reservations at LKS Next offices.
- It is a client app only: there is no custom backend in this repo; the app talks to Firebase services for identity, data, and messaging.
2. Primary architecture style
- The app follows MVVM with Jetpack Compose UI.
- The code is organized into clear layers:
- ui/pages = screens
- ui/viewmodel = state and orchestration
- data = models, auth, and repository access
- utils = cross-cutting helpers
3. Entry point and navigation
- MainActivity is the app entry point.
- Compose navigation is centralized in ui/components/ParkingNavigation.kt.
- Screens are mostly page-level Compose functions under ui/pages, with navigation state and screen routing owned above them.
4. Presentation layer
- Screens cover the full user journey: landing, login/register, forgot password, dashboard, new/edit reservation, parking view, history, notifications, profile, report, help, and about.
- Shared UI pieces live in ui/components, including navigation shell and scrolling helpers.
- Theme and styling are isolated in ui/theme.
5. State and orchestration layer
- Each major screen has a dedicated ViewModel in ui/viewmodel.
- ViewModels expose state with StateFlow and coordinate validation, loading, and user actions.
- ViewModelFactory is a manual dependency injection boundary: it wires ViewModels to shared dependencies instead of using Hilt/Koin.
6. Data layer and business-facing services
- ParkingRepository / ParkingRepositoryImpl encapsulate parking-domain data access.
- AuthManager isolates authentication-related logic.
- The domain model is centralized in data/model/Models.kt, suggesting a shared set of reservation, vehicle, user, and notification entities used across screens.
7. Firebase integration
- The app relies on several Firebase services:
- Firebase Auth for registration/login and password recovery
- Cloud Firestore for reservation and parking data
- Firebase Cloud Messaging for push notifications
- Crashlytics and Performance Monitoring for observability
- google-services.json in app/ confirms Firebase is configured at the app module level.
8. Notification flow
- MyFirebaseMessagingService handles incoming push messages.
- utils/NotificationReceiver.kt and utils/ReservationReminderManager.kt support local notification delivery and scheduled reminders.
- This creates two notification paths: remote FCM-triggered messages and app-side reminder notifications.
9. Localization and device behavior
- The app is localized for Spanish, English, and Basque using resource folders values-es, values-en, and values-eu.
- utils/LocaleManager.kt likely manages runtime language selection.
- The localization strategy is app-wide and affects UI strings, not just isolated screens.
10. Testing boundaries
- Unit tests cover data, utils, and ViewModels under app/src/test.
- UI/instrumentation coverage exists under app/src/androidTest, including screen tests and end-to-end flows.
- The test structure mirrors production layers, which is useful for diagramming clear subsystem boundaries.
11. Quality, CI, and release pipeline
- GitHub Actions workflows (.github/workflows/main.yml, release.yml) automate validation and release tasks.
- Static analysis and quality tools include Detekt, Lint, JaCoCo, and SonarCloud.
- This repo also includes a scripts/seed.js utility, likely used to populate Firebase/Firestore test or demo data.
12. How data flows through the app
- User interaction starts in a Compose screen.
- The screen calls into a ViewModel.
- The ViewModel validates input, updates UI state, and invokes AuthManager or the repository.
- The repository talks to Firebase.
- Results flow back to the ViewModel as state, then to the UI.
- Notifications and reminders are side-channel flows that can be triggered by Firebase messages or local scheduling logic.
13. Architecture diagram boundaries to show
- Put UI/Compose, ViewModels, data/repository/auth, Firebase services, and notification/reminder services as separate boxes.
- Treat MainActivity + Navigation as the UI shell.
- Treat Localization, theme, and utilities as shared cross-cutting support.
- Treat tests and CI/CD as external quality/support systems, not runtime components.
Main entry points: viewmodel ViewModels · test Tests · ParkingRepositoryImpl.kt Repository · google-services.json Firebase
Components 18
App runtime
Android client app and its in-process layers
- MainActivity · App entry point
app/src/main/java/com/lksnext/ParkingIMayordomo/MainActivity.kt - Navigation · Centralized screen routing and nav host
app/src/main/java/com/lksnext/ParkingIMayordomo/ui/components/ParkingNavigation.kt - Screens · Landing, auth, dashboard, reservations, history, notifications, profile, report, help, about
- ViewModels · Screen state, validation, loading, and orchestration
app/src/main/java/com/lksnext/ParkingIMayordomo/ui/viewmodel - Factory · Wires ViewModels to shared dependencies
app/src/main/java/com/lksnext/ParkingIMayordomo/ui/viewmodel/ViewModelFactory.kt - Data layer · Repository, auth manager, and shared models
app/src/main/java/com/lksnext/ParkingIMayordomo/data - Repository · Parking domain data access implementation
app/src/main/java/com/lksnext/ParkingIMayordomo/data/repository/ParkingRepositoryImpl.kt - AuthManager · Authentication-related logic and Firebase Auth boundary
app/src/main/java/com/lksnext/ParkingIMayordomo/data/AuthManager.kt - Models · Reservation, vehicle, user, and notification entities
app/src/main/java/com/lksnext/ParkingIMayordomo/data/model/Models.kt - FCM service · Receives remote push messages
app/src/main/java/com/lksnext/ParkingIMayordomo/MyFirebaseMessagingService.kt - NotificationReceiver · Builds local notification delivery
app/src/main/java/com/lksnext/ParkingIMayordomo/utils/NotificationReceiver.kt - Reminder manager · Schedules reservation reminder notifications
app/src/main/java/com/lksnext/ParkingIMayordomo/utils/ReservationReminderManager.kt
Cross-cutting support
Shared UI, locale, and utility services
- LocaleManager · Runtime language selection
app/src/main/java/com/lksnext/ParkingIMayordomo/utils/LocaleManager.kt - Theme · Colors, typography, and app theme
app/src/main/java/com/lksnext/ParkingIMayordomo/ui/theme/Theme.kt - UI utils · Scrollbar, parking helpers, and test tags
app/src/main/java/com/lksnext/ParkingIMayordomo/utils/ParkingUtils.kt
Firebase services
External managed services used by the app
- Firebase · Auth, Firestore, messaging, crash reporting, and performance
app/google-services.json
Connections 22
- MainActivity → Navigation: starts · Activity hosts the Compose app shell
- Navigation → Screens: routes to · Navigation drives page-level screens
- Screens → ViewModels: collects state · Screens read UI state and dispatch user actions
- ViewModels → Factory: constructed by · ViewModels are manually wired through a factory
- Factory → Data layer: injects · Shared dependencies are provided to state holders
- ViewModels → AuthManager: auth actions · Login, register, and password reset flow through auth logic
- ViewModels → Repository: domain actions · Reservation and parking operations go through the repository
- Repository → Firebase: reads/writes · Firestore-backed persistence and related Firebase services
- AuthManager → Firebase: authenticates · Firebase Auth handles identity flows
- Data layer → Models: shares schema · Common entities are reused across layers
- ViewModels → Models: maps state · StateFlow state is built from shared models
- Screens → Theme: styled by · Compose UI uses centralized theme definitions
- Screens → LocaleManager: localized by · UI strings and runtime language selection are app-wide
- Screens → UI utils: uses · Shared UI helpers support page rendering
- FCM service → Firebase: receives push · Remote messaging enters through Firebase Cloud Messaging
- FCM service → NotificationReceiver: triggers · Incoming messages can become local notifications
- Reminder manager → NotificationReceiver: schedules · Reminder jobs deliver local notifications
- ViewModels → Reminder manager: requests reminders · Reservation flows can configure reminder scheduling
- Tests → ViewModels: covers · Unit tests verify orchestration and state logic
- Tests → Repository: covers · Repository behavior is unit tested
- Tests → Screens: covers · Instrumentation tests exercise Compose flows
- CI/CD → Tests: runs · Workflows automate validation and release checks