Architect a modern Android application using Kotlin with Jetpack Compose, clean architecture principles, dependency injection, and Google platform integration.
You are a senior Android developer specializing in Kotlin and modern Jetpack libraries. Create a comprehensive development blueprint for the following Android application. Project Details: App Name: [APP NAME] App Category: [SOCIAL/FINANCE/HEALTH/PRODUCTIVITY/ENTERTAINMENT] Minimum SDK: [API 26/28/31/33] UI Framework: [COMPOSE ONLY/COMPOSE WITH XML/XML ONLY] Backend: [REST/GRAPHQL/FIREBASE/GRPC] Distribution: [PLAY STORE/ENTERPRISE/BOTH] Section 1 - Architecture and Project Structure: Define the application architecture using Clean Architecture with clear separation between presentation, domain, and data layers. Recommend the project structure using multi-module Gradle configuration that enforces dependency rules between modules and enables parallel compilation. Specify the dependency injection framework choosing between Hilt and Koin with justification based on project requirements. Detail the convention plugins approach for sharing Gradle build logic across modules including common dependencies, compile options, and testing configurations. Address how to structure shared resources, theming, and design tokens across feature modules to maintain visual consistency. Section 2 - Jetpack Compose UI Architecture: Design the Compose UI layer following unidirectional data flow with ViewModels exposing state via StateFlow or the new Compose state management approaches. Define the composable function organization including screen-level composables, reusable components, and stateless UI primitives. Specify the navigation architecture using Navigation Compose with type-safe arguments and nested navigation graphs for feature modules. Create the theming strategy using Material 3 with dynamic color support, custom typography, and dark mode implementation. Address Compose performance optimization including stable annotations, remember usage patterns, derivedStateOf for computed values, and LazyColumn optimization for large lists. Section 3 - Data Layer and Repository Pattern: Design the data layer with repository interfaces defined in the domain layer and implementations in the data layer. Specify the local database strategy using Room with proper entity design, DAO patterns, and database migration handling. Define the networking layer using Retrofit or Ktor with Kotlin Serialization for type-safe API communication. Create the caching strategy using a single source of truth pattern where Room serves as the cache and network requests refresh the cache. Address the DataStore usage for preference storage and proto DataStore for structured data that does not require a full database. Section 4 - Kotlin Coroutines and Flow Architecture: Define the coroutine scope management strategy ensuring proper lifecycle awareness through viewModelScope and lifecycleScope. Specify the Flow usage patterns including SharedFlow for events, StateFlow for UI state, and cold flows for data streams from Room and network responses. Design the error handling approach using sealed classes or Result types that propagate errors from the data layer through use cases to the UI. Create guidelines for structured concurrency including SupervisorScope usage, exception handling in coroutine hierarchies, and cancellation propagation. Address how to handle complex async workflows such as parallel API calls, retry with exponential backoff, and debounced search operations. Section 5 - Platform Integration and Services: Define the strategy for integrating Android platform services including WorkManager for background task scheduling, Foreground Services for ongoing operations, and AlarmManager for time-sensitive tasks. Design the push notification architecture using Firebase Cloud Messaging with notification channels, deep link handling, and notification grouping. Specify the approach for permissions handling using the modern Activity Result API with rationale display and settings redirection. Create the app widget implementation plan using Glance for Compose-based widgets with proper data refresh strategies. Address integration with Google Play Services including In-App Updates, In-App Review, Google Sign-In, and Play Integrity API. Section 6 - Build System, Testing, and Release: Define the Gradle build configuration using Kotlin DSL with version catalogs for dependency management and build variants for different environments. Specify the testing strategy including unit tests with JUnit 5 and MockK, Compose UI tests with ComposeTestRule, and instrumented tests with Espresso. Design the CI/CD pipeline using GitHub Actions or Bitrise with automated builds, test execution, static analysis with Detekt, and Play Store deployment using the Google Play API. Create the ProGuard and R8 configuration strategy for code shrinking, obfuscation, and optimization. Address the release management process including staged rollouts, crash monitoring with Firebase Crashlytics, and Android App Bundle optimization for reduced download sizes.
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[APP NAME]