How muhammedelsami/compose-splash-onboarding-home works
Project type and purpose
• This is a modern single-activity Android application built with Jetpack Compose.
• Purpose: demonstrate a splash screen, an onboarding flow, and a home screen, with onboarding state persisted via DataStore.
File structure
• Top level: Gradle build files, settings, version catalogs.
• “app” module:
• build.gradle.kts, proguard rules – build configuration
• src/main/java/.../App.kt & MainActivity.kt – application & activity entry points
• data/datastore/DataStoreManager.kt – persistence layer encapsulating DataStore
• presentation/… – UI layer organized by feature (splash, onboarding, home) plus navigation
• Tests under androidTest and test: instrumentation and unit tests
Insights from README
• Confirms single-activity Jetpack Compose architecture
• Uses Navigation Component for screen routing
• DataStore for local persistence of onboarding completion
Main components
a. Android Framework Layer
– Android OS
– Activity Host: MainActivity
– Application class: App
b. UI Layer (Jetpack Compose)
– SplashScreen composable
– OnboardingScreen & OnboardingPage composables
– HomeScreen composable
c. Navigation Component
– NavHost (AppNavHost)
– Route definitions (Routes.kt)
– Navigation graph linking splash → onboarding → home
d. Data Layer
– DataStoreManager: read/write onboarding flag via Proto/DataStore
– DataStore files under app-internal storage
e. Build & CI
– Gradle (KTS) scripts, version catalog, proguard, wrapper
Relationships and data flows
• App→MainActivity launches NavHost
• NavHost controls which composable to display based on navigation state
• SplashScreen queries DataStoreManager (suspend)
• DataStoreManager returns “hasCompletedOnboarding” → NavHost routes to Onboarding or Home
• OnboardingScreen on completion writes flag via DataStoreManager
• HomeScreen displays main content
• Theme provider wraps all composables
Architectural patterns & design principles
• Single-Activity + multiple Compose screens
• Separation of concerns: UI layer vs. Data layer
• Unidirectional data flow: UI invokes DataStore through Manager, Manager returns state
• Dependency injection can be added around DataStoreManager (if desired)
Technologies & frameworks
• Kotlin + Coroutines
• Jetpack Compose UI
• Navigation Component for Compose
• DataStore (Preferences or Proto)
• Gradle KTS build system
Final checklist
– Clear, descriptive labels for each component
– Group related files/features together (presentation, data, resources)