How philipplackner/runique works
Main Components
• Phone Application Module ("app"): Represents the main phone UI & navigation, handling user interaction with running features.
• Wear Application Module ("wear/app"): Represents the Wear OS counterpart with its own UI and limited features specifically designed for wearables.
• Core Shared Modules ("core"): Contains uniform functionalities such as data access, connectivity, notifications, and design systems that are shared across both platforms. Within it, you see submodules like core/data, core/domain, core/database, core/presentation (design system and UI), and connectivity.
• Feature-specific Modules: Such as "analytics" and "auth". These are self-contained modules following the same multi-layer structure (each having subdirectories like data, domain, and presentation) that deliver specific functionalities (e.g., tracking analytics and handling authentication).
• Run Modules (“run” and “wear/run”): These modules encapsulate the running tracking capabilities – initiating, syncing, displaying runs for phone and wearable interaction.
• Build Logic: The "build-logic" directory shows custom Gradle convention plugins and version catalogs used to manage and organize the large-scale multi-module build.
Relationships and Data Flow
• The Phone and Wear modules interact with the Core modules to access common functionality such as connectivity, network interactions, local storage (Room database via core/database), and UI design components.
• Feature modules like analytics and auth have their tri-layer architecture (data, domain, presentation) and are likely integrated into the main apps through dependency injection (noticing “di” folders in each module).
• Communication and data flow happen across layers – for example:
• The Presentation layer (in app, wear, or feature modules) sends user events to the ViewModels.
• The ViewModels call the Domain layer (repositories/services) to manage business logic.
• The Domain layer then interacts with the Data layer (network requests, local cached data) which may use functionalities from modules like connectivity, database, or networking.
• External services: The README mentions API keys for the Runique API and Google Maps. These external dependencies might be encapsulated inside the network and data modules, and their results are then piped into the UI modules.
Important Architectural Patterns and Design Principles
• Clean/Onion Architecture: Clear separation between presentation, domain, and data layers in each feature-specific module.
• Multi-Module Gradle Setup: Enhances component decoupling and scalability.
• Dependency Injection: Evident from “di” (dependency injection) directories across modules.
• Offline-first and dynamic features: Specific code segments (e.g., in the “run” and “auth” modules) indicate handling of offline data and dynamic feature modules.
• Platform-specific considerations: Separate modules for Wear and Phone are maintained, sharing core functionalities from common modules.
Relevant Technologies & Frameworks
• Jetpack Compose: Used in UI modules (as indicated by convention plugins like AndroidApplicationComposeConventionPlugin.kt).
• Room: For local database management (see core/database).
• Google Maps SDK & Runique API: For external service integration.
• Gradle (with version catalogs, convention plugins): For build orchestration.
• Architecture components & dependency injection frameworks (like Koin or Dagger – suggested from “di” directories).
• Clear Labels: Each component or module must be clearly labeled (for example, “App (Phone UI)”, “Wear App”, “Core: Data/Domain/Presentation”, “Auth Feature – Data/Domain/Presentation”).
• Architectural layers (group components by domain, data, and presentation)
• External services (APIs, maps, authentication endpoints)
• Additional Detail: Annotate key integration points such as API key configuration (external services) and offline-first behavior.
This approach should provide a comprehensive architectural blueprint that aligns with the project’s structure and purpose as described in the provided files.