# stevdza-san/recipesapp_modularization architecture

> Architecture diagram of the GitHub repository stevdza-san/recipesapp_modularization, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stevdza-san/recipesapp_modularization
- Repository: https://github.com/stevdza-san/recipesapp_modularization

## Overview

##### 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.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Platform-Specific Applications"
        Android["Android App (Compose for Android)"]:::platform
        iOS["iOS App (Compose for iOS)"]:::platform
    end

    subgraph "Shared Modules"
        subgraph "Shared Domain & UI"
            Shared["Shared Domain & UI"]:::shared
        end
        subgraph "Feature Modules"
            Home["Home Feature"]:::feature
            Details["Details Feature"]:::feature
            Joke["Joke Feature"]:::feature
            Saved["Saved Feature"]:::feature
            Settings["Settings Feature"]:::feature
            RootNav["Root Navigation Feature"]:::feature
        end
        DI["DI Module (Koin)"]:::di
        Nav["Navigation Module"]:::navigation
    end

    Build["Build & Configuration (Gradle, .fleet)"]:::build

    %% Relationships between layers
    Android -->|"calls"| RootNav
    iOS -->|"calls"| RootNav

    RootNav -->|"routes_to"| Home
    RootNav -->|"routes_to"| Details
    RootNav -->|"routes_to"| Joke
    RootNav -->|"routes_to"| Saved
    RootNav -->|"routes_to"| Settings

    DI -->|"injects"| Home
    DI -->|"injects"| Details
    DI -->|"injects"| Joke
    DI -->|"injects"| Saved
    DI -->|"injects"| Settings

    Nav -->|"provides_navigation"| RootNav

    Shared -->|"provides_domain&UI"| Home
    Shared -->|"provides_domain&UI"| Details
    Shared -->|"provides_domain&UI"| Joke
    Shared -->|"provides_domain&UI"| Saved
    Shared -->|"provides_domain&UI"| Settings

    Build -->|"orchestrates"| Android
    Build -->|"orchestrates"| iOS
    Build -->|"orchestrates"| Shared

    %% Click Events
    click Android "https://github.com/stevdza-san/recipesapp_modularization/blob/main/composeApp/src/androidMain/kotlin/com/stevdza_san/recipes/MainActivity.kt"
    click iOS "https://github.com/stevdza-san/recipesapp_modularization/blob/main/iosApp/iosApp/iOSApp.swift"
    click Shared "https://github.com/stevdza-san/recipesapp_modularization/tree/main/shared/src/commonMain/kotlin/com/stevdza_san/shared"
    click Home "https://github.com/stevdza-san/recipesapp_modularization/blob/main/feature/root/home/src/commonMain/kotlin/com/stevdza_san/home/HomeScreen.kt"
    click Details "https://github.com/stevdza-san/recipesapp_modularization/blob/main/feature/root/details/src/commonMain/kotlin/com/stevdza_san/details/DetailsScreen.kt"
    click Joke "https://github.com/stevdza-san/recipesapp_modularization/blob/main/feature/root/joke/src/commonMain/kotlin/com/stevdza_san/joke/JokeScreen.kt"
    click Saved "https://github.com/stevdza-san/recipesapp_modularization/blob/main/feature/root/saved/src/commonMain/kotlin/com/stevdza_san/saved/SavedScreen.kt"
    click Settings "https://github.com/stevdza-san/recipesapp_modularization/blob/main/feature/settings/src/commonMain/kotlin/com/stevdza_san/settings/SettingsScreen.kt"
    click RootNav "https://github.com/stevdza-san/recipesapp_modularization/tree/main/feature/root/src/commonMain/kotlin/com/stevdza_san/root"
    click DI "https://github.com/stevdza-san/recipesapp_modularization/blob/main/di/src/commonMain/kotlin/com/stevdza_san/di/KoinModules.kt"
    click DI "https://github.com/stevdza-san/recipesapp_modularization/blob/main/composeApp/src/commonMain/kotlin/com/stevdza_san/recipes/di/InitializeKoin.kt"
    click DI "https://github.com/stevdza-san/recipesapp_modularization/blob/main/shared/src/commonMain/kotlin/com/stevdza_san/shared/di/RepositoryModule.kt"
    click Nav "https://github.com/stevdza-san/recipesapp_modularization/blob/main/navigation/src/commonMain/kotlin/com/stevdza_san/navigation/RootNavigationGraph.kt"

    %% Styles
    classDef platform fill:#f9f,stroke:#333,stroke-width:2px;
    classDef shared fill:#ccf,stroke:#333,stroke-width:2px;
    classDef feature fill:#cfc,stroke:#333,stroke-width:2px;
    classDef di fill:#ffc,stroke:#333,stroke-width:2px;
    classDef navigation fill:#fcf,stroke:#333,stroke-width:2px;
    classDef build fill:#cff,stroke:#333,stroke-width:2px;
```
