How stevdza-san/recipesapp_modularization works
Main Components
• Platform-Specific Applications:
• "composeApp" for Android: Contains Android-specific entry points (e.g., MainActivity) and resources (manifests, drawables, mipmap folders).
• "iosApp": Contains the iOS project (Xcode project files, Info.plist, Swift content) with its own entry point (e.g., MainViewController, iOSApp.swift).
• Shared / Common Modules:
• "shared": Contains shared domain models (e.g., Recipe data), shared UI components, repository definitions, and even shared DI.
• "feature": This folder is organized into several submodules such as "home", "details", "joke", "saved", and "settings". Each feature encapsulates its own screens, view models, and even some domain logic.
• "navigation": Manages navigation graphs (for example, RootNavigationGraph) which likely define how these screens connect.
• "di": Provides dependency injection set up (using Koin as hinted in files like InitializeKoin.kt and KoinModules.kt) that is shared across features.
• Configurations and Build Setup:
• Gradle configuration files (build.gradle.kts, settings.gradle.kts, gradle wrapper) which are central to building and orchestrating the multi-module project structure.
• The ".fleet" folder and other config files might be used for deployment or build automation.
Relationships and Interactions
• The shared modules (features, di, navigation, and shared components) are the core building blocks that encapsulate business logic and shared UI components.
• Both platform-specific modules ("composeApp" and "iosApp") consume the shared logic by invoking common Compose code through their own platform-specific entry points.
• The Dependency Injection (DI) module centralizes component initialization using Koin to wire up dependencies across feature modules and shared components.
• The navigation module provides a centralized navigation graph (and related routing logic) which is referenced by each feature module.
Architectural Patterns and Technologies
• Modularization: Projects are divided into smaller modules for features, navigation, DI, and shared code. This clean separation helps in managing cross-platform concerns.
• Multiplatform Sharing: Utilizes commonMain sources (present under various modules) to share UI (Compose) and business logic between Android and iOS.
• Dependency Injection with Koin: The di modules set up DI which is consumed by multiple features.
• Navigation: A dedicated navigation module implies the use of a centralized navigation graph (e.g., RootNavigationGraph) for screen transitions.
• Build and Tooling: The project employs Gradle (with Kotlin DSL) and includes both Android and iOS specific build systems.