How dattran2k/jetpack-compose-catalog works
Main Components
• App Module (Android Client)
• Entry point of the application (MainActivity, MyApplication)
• Android lifecycle components and ViewModel (Local UI logic)
• UI Module
• Houses Compose UI screens and feature implementations (Catalog screens for layout, animation, menu, and navigation)
• Organizes navigation and feature-specific UI components (e.g., CatalogCompose, CatalogOverview, MainScreen)
• Core Module (with submodules)
• Data: Contains repository implementations and dependency injection (e.g., DataModule, UserDataRepository)
• Datastore: Manages persistent storage through DataStore for user preferences and theme settings (PreferenceDataSource, serializers, etc.)
• Model: Defines the application's data models used across modules (UserData, DarkThemeConfig, UI models for Compose)
• Benchmark Module
• Contains performance test cases (for startup benchmarks) to measure and optimize the UI responsiveness
Relationships and Interactions
• Android App (in the “app” module) is the runtime host and consumer of the UI and core services.
• The MainActivity interacts with its corresponding ViewModel, which in turn leverages business logic from the core modules.
• And navigation logic implemented in the UI module will be invoked from MainActivity and its associated screens.
• The UI module calls into the DesignSystem (from core/designsystem) to render custom UI components and apply themes.
• The Data and Datastore submodules (core/data and core/datastore) interact with each other via dependency injection and service locator patterns (as set up in the respective DI packages), forming the data layer that supports features like user settings and theming.
• The Model module provides a common set of data definitions that are shared across the Data, UI, and Datastore layers.
Architectural Patterns & Design Principles
• MVVM (Model-View-ViewModel): Evident in the use of ViewModels and separation between business logic (core/data) and UI (ui module).
• Modularity: Clear separation between app, UI, core, and benchmark modules allow individual components to be developed and tested in isolation.
• Dependency Injection: The project uses DI modules (e.g., in core/data/di and core/datastore/di) to wire up dependencies.
• Component-based UI: The design system is built with reusable Compose components that are extended and customized.
Relevant Technologies, Frameworks, or Libraries
• Jetpack Compose for UI rendering and navigation (compose screens, animations, layouts).
• Material3 for modern UI theming.
• Android DataStore for persistent data storage.
• Gradle Kotlin DSL (build.gradle.kts files) managing project setup.
• Android testing frameworks for instrumented and unit tests (in the androidTest and test directories).