How xpeho/xpeapp_android works
Project Type and Purpose
• XpeApp is an Android mobile application built with Kotlin and Jetpack Compose.
• It follows a client-side architecture that consumes REST APIs (WordPress backend), uses Firebase services, and persists local preferences via DataStore.
File Structure Analysis
• Top-level “app” module contains all code and resources.
• data/… – data layer (entities, models, services, repository, network interceptor)
• domain/… – business logic managers (AuthenticationManager, FeatureFlippingManager)
• di/… – dependency injection modules and providers
• ui/… – presentation layer, subdivided into viewModels, pages, components, uiState, theme, notifications
• enums/… – enum definitions for navigation screens
• AndroidManifest.xml, Gradle build scripts, resource folders (drawables, layouts, values, xml).
• Test directories mirror production code for unit/integration tests.
• CI/CD: GitHub workflows for linting (detekt), code quality (SonarQube), building & releasing Android App Bundle.
README Insights
• Requires google-services.json for Firebase integration.
• Configurable back-end URLs via uat.properties and prod.properties.
• Uses external UI library (xpeho_ui_android) imported via GitHub Packages.
• Release process automated through GitHub Actions and Google Play Console.
Main Components
A. Android App (Client)
1. UI Layer (Jetpack Compose screens & components)
2. ViewModels (MVVM pattern: ui/viewModel)
3. Domain Layer (business managers)
4. Data Layer
– Repositories (WordpressRepository)
– Services (WordpressService, FirebaseService)
– Network Interceptor (AuthorizationHeaderInterceptor)
– Local Preferences (DatastorePref)
5. Dependency Injection (Koin/Hilt-like module in di/AppModule.kt)
6. Notifications (AlarmReceiver/Scheduler)
B. External Services
1. WordPress REST API (backend endpoints)
2. Firebase Cloud Messaging (push notifications or analytics)
3. GitHub Releases (version checking for forced updates)
4. Google Play Console (app distribution)
Relationships and Data Flows
• UI Components → bind to → ViewModels
• ViewModels → call → Domain Managers → orchestrate → Data Layer
• Data Layer → fetch/update → External REST API (WordPress) & Firebase, or Local DataStore
• DI Container → provides → all above dependencies at app startup (via XpeApp.kt)
• On release: GitHub Actions → build AAB → Google Play → publish → app version check via GitHub Releases
Architectural Patterns & Principles
• MVVM: clear separation between UI, state (uiState), and logic (ViewModel).
• Clean architecture layers: UI → Domain → Data.
• Single responsibility modules: each package has a focused concern.
• Dependency Injection centralizes object creation for decoupling and testability.
• Reactive state management: UI state flows from ViewModels exposing state objects.
Elements
• Clear labels: name each component/package.
• Configuration: note where google-services.json and properties files plug into the Data layer.
• CI/CD flow (optional overlay): GitHub Actions → SonarQube → Build → Release.