How droidkaigi/conference-app-2024 works
Main Components
• Platform-specific Modules:
• Android: Listed under “app-android” with its Gradle scripts, AndroidManifest, and UI code.
• iOS: Modules under “app-ios” (and shared code in “app-ios-shared”) that integrate with Compose Multiplatform/SwiftUI.
• Shared / Cross-Platform Core:
• “core” directories that include “data”, “common”, “model”, “designsystem”, “droidkaigiui”, etc. These hold business logic, UI component definitions, network/data handling, and the design system.
• Feature Modules:
• Each major domain (e.g., “feature/about”, “feature/contributors”, “feature/eventmap”, “feature/sessions”, etc.) encapsulates presentation logic, composables, and specialized business logic.
• Build and Configuration Layers:
• “build-logic”, Gradle scripts, CI/CD workflows (set up under .github/workflows), and configuration files.
• Testing and Quality Assurance:
• Testing frameworks (Robolectric for unit tests, Roborazzi integrated with BDD tests for screenshot and behavior testing, and robot patterns for UI tests) are clearly represented.
• Data Stores and Remote Integration:
• Repositories (like SessionsRepository, ContributorsRepository, etc.) that bridge remote APIs and local data stores (such as sessionCacheDataStore and userDataStore).
Relationships and Data Flow
• UI Layer (Composables):
• Screens are implemented as composable functions (for example, TimetableScreen) and get their state via “presenters” that are also written as composable functions.
• Presenter and Event Handling:
• A Presenter (for example, timetableScreenPresenter) observes an EventFlow that passes events from the UI (like TimetableScreenEvent.Bookmark) and then interacts with underlying repositories.
• Repository/Data Store Layer:
• Repositories (for sessions, bookmarks, etc.) interact with a network API and persist changes locally via DataStore components.
• The updated data flows back upward to update the UI state (using safeCollectAsRetainedState to manage state across recompositions).
• Recomposition & State Management:
• The repository state (like updated timetable with bookmarks) is collected, triggering recomposition of the UI layer.
• Testing:
Architectural Patterns and Design Principles
• Clean separation of concerns:
• Divide the application into presentation (Composable/UIs and presenters), domain (repositories, use cases), and data layers (network, persistence).
• Multi-module/Multi-platform approach:
• Separate modules for platform-specific functionality (Android, iOS) versus shared logic.
• Event-Driven & Unidirectional Data Flow:
• Composable Architecture:
• Use of composable functions not only for rendering UI but also for managing state and even repository logic.
• Testing and Verification:
• BDD testing, visual regression (screenshot) testing with Roborazzi, and utilization of the Robot pattern to abstract how tests interact with UI components.