# droidkaigi/conference-app-2024 architecture

> Architecture diagram of the GitHub repository droidkaigi/conference-app-2024, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/droidkaigi/conference-app-2024
- Repository: https://github.com/droidkaigi/conference-app-2024

## Overview

##### Main Components
- Platform-specific Modules:
- Android: Listed under “app-android” with its Gradle scripts, AndroidManifest, and UI code.
- iOS: Modules under “app-ios” (and shared code in “app-ios-shared”) that integrate with Compose Multiplatform/SwiftUI.
- Shared / Cross-Platform Core:
- “core” directories that include “data”, “common”, “model”, “designsystem”, “droidkaigiui”, etc. These hold business logic, UI component definitions, network/data handling, and the design system.
- Feature Modules:
- Each major domain (e.g., “feature/about”, “feature/contributors”, “feature/eventmap”, “feature/sessions”, etc.) encapsulates presentation logic, composables, and specialized business logic.
- Build and Configuration Layers:
- “build-logic”, Gradle scripts, CI/CD workflows (set up under .github/workflows), and configuration files.
- Testing and Quality Assurance:
- Testing frameworks (Robolectric for unit tests, Roborazzi integrated with BDD tests for screenshot and behavior testing, and robot patterns for UI tests) are clearly represented.
- Data Stores and Remote Integration:
- Repositories (like SessionsRepository, ContributorsRepository, etc.) that bridge remote APIs and local data stores (such as sessionCacheDataStore and userDataStore).

##### Relationships and Data Flow
- UI Layer (Composables):
- Screens are implemented as composable functions (for example, TimetableScreen) and get their state via “presenters” that are also written as composable functions.
- Presenter and Event Handling:
- A Presenter (for example, timetableScreenPresenter) observes an EventFlow that passes events from the UI (like TimetableScreenEvent.Bookmark) and then interacts with underlying repositories.
- Repository/Data Store Layer:
- Repositories (for sessions, bookmarks, etc.) interact with a network API and persist changes locally via DataStore components.
- The updated data flows back upward to update the UI state (using safeCollectAsRetainedState to manage state across recompositions).
- Recomposition & State Management:
- The repository state (like updated timetable with bookmarks) is collected, triggering recomposition of the UI layer.
- Testing:

##### Architectural Patterns and Design Principles
- Clean separation of concerns:
- Divide the application into presentation (Composable/UIs and presenters), domain (repositories, use cases), and data layers (network, persistence).
- Multi-module/Multi-platform approach:
- Separate modules for platform-specific functionality (Android, iOS) versus shared logic.
- Event-Driven & Unidirectional Data Flow:
- Composable Architecture:
- Use of composable functions not only for rendering UI but also for managing state and even repository logic.
- Testing and Verification:
- BDD testing, visual regression (screenshot) testing with Roborazzi, and utilization of the Robot pattern to abstract how tests interact with UI components.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Platform Modules
    subgraph "Platform Modules"
        A1["Android App"]:::platform
        I1["iOS App"]:::platform
        I2["iOS Shared"]:::platform
    end

    %% Shared / Core Modules
    subgraph "Shared / Core Modules"
        D1["Data Module"]:::shared
        M1["Model Module"]:::shared
        DS1["Design System"]:::shared
        UI["UI Components"]:::shared
        C1["Common Modules"]:::shared
    end

    %% Feature Modules
    subgraph "Feature Modules"
        F1["About Feature"]:::feature
        F2["Contributors Feature"]:::feature
        F3["Event Map Feature"]:::feature
        F4["Favorites Feature"]:::feature
        F5["Main Feature"]:::feature
        F6["ProfileCard Feature"]:::feature
        F7["Sessions Feature"]:::feature
        F8["Settings Feature"]:::feature
        F9["Sponsors Feature"]:::feature
        F10["Staff Feature"]:::feature
    end

    %% Application Flow (Timetable Example)
    subgraph "Application Flow (Timetable Example)"
        UI_Layer["Composable UI (TimetableScreen)"]:::ui
        Presenter["Presenter (timetableScreenPresenter)"]:::presenter
        Repository["Repository (SessionsRepository)"]:::repository
        DataStore["DataStore (userDataStore)"]:::datastore
    end

    %% Build and CI/CD
    subgraph "Build & CI/CD"
        BL["Build Logic"]:::build
        GS["Gradle Scripts"]:::build
        CI["CI/CD Workflows"]:::build
    end

    %% Testing & QA
    subgraph "Testing & QA"
        T1["Android Tests"]:::testing
        T2["iOS Tests"]:::testing
    end

    %% Relationships and Data Flow

    %% Platform modules using UI layer
    A1 -->|"uses"| UI_Layer
    I1 -->|"integrates"| UI_Layer
    I2 -->|"shares"| UI_Layer

    %% UI triggers presenter flow
    UI_Layer -->|"triggers"| Presenter
    Presenter -->|"invokes"| Repository
    Repository -->|"persists to"| DataStore
    DataStore -->|"updates"| Repository
    Repository -->|"recomposes"| UI_Layer

    %% Feature module integration
    F7 -->|"provides screen"| UI_Layer
    F7 -->|"leverages"| Repository

    %% Shared core supporting business logic
    D1 -->|"data access"| Repository
    M1 -->|"domain models"| Repository
    DS1 -->|"design"| UI_Layer
    UI -->|"widgets"| UI_Layer
    C1 -->|"common utilities"| Repository

    %% Build & CI/CD integration
    BL --> A1
    BL --> I1
    BL --> I2
    BL --> D1
    GS --> A1
    CI --> A1
    CI --> I1
    CI --> I2

    %% Testing connections
    T1 --> A1
    T1 --> F7
    T2 --> I1

    %% Click Events
    click A1 "https://github.com/droidkaigi/conference-app-2024/tree/main/app-android"
    click I1 "https://github.com/droidkaigi/conference-app-2024/tree/main/app-ios"
    click I2 "https://github.com/droidkaigi/conference-app-2024/tree/main/app-ios-shared"
    click D1 "https://github.com/droidkaigi/conference-app-2024/tree/main/core/data"
    click M1 "https://github.com/droidkaigi/conference-app-2024/tree/main/core/model"
    click DS1 "https://github.com/droidkaigi/conference-app-2024/tree/main/core/designsystem"
    click UI "https://github.com/droidkaigi/conference-app-2024/tree/main/core/droidkaigiui"
    click C1 "https://github.com/droidkaigi/conference-app-2024/tree/main/core/common"
    click F1 "https://github.com/droidkaigi/conference-app-2024/tree/main/feature/about"
    click F2 "https://github.com/droidkaigi/conference-app-2024/tree/main/feature/contributors"
    click F3 "https://github.com/droidkaigi/conference-app-2024/tree/main/feature/eventmap"
    click F4 "https://github.com/droidkaigi/conference-app-2024/tree/main/feature/favorites"
    click F5 "https://github.com/droidkaigi/conference-app-2024/tree/main/feature/main"
    click F6 "https://github.com/droidkaigi/conference-app-2024/tree/main/feature/profilecard"
    click F7 "https://github.com/droidkaigi/conference-app-2024/tree/main/feature/sessions"
    click F8 "https://github.com/droidkaigi/conference-app-2024/tree/main/feature/settings"
    click F9 "https://github.com/droidkaigi/conference-app-2024/tree/main/feature/sponsors"
    click F10 "https://github.com/droidkaigi/conference-app-2024/tree/main/feature/staff"
    click BL "https://github.com/droidkaigi/conference-app-2024/tree/main/build-logic"
    click GS "https://github.com/droidkaigi/conference-app-2024/blob/main/build.gradle.kts"
    click CI "https://github.com/droidkaigi/conference-app-2024/tree/main/.github/workflows"

    %% Style Definitions
    classDef platform fill:#f9d5e5,stroke:#c08497,stroke-width:2px;
    classDef shared fill:#d0e8f2,stroke:#67a9cf,stroke-width:2px;
    classDef feature fill:#dff0d8,stroke:#5cb85c,stroke-width:2px;
    classDef ui fill:#ffe0b3,stroke:#f0ad4e,stroke-width:2px;
    classDef presenter fill:#f7e7ce,stroke:#d58512,stroke-width:2px;
    classDef repository fill:#e2dfe3,stroke:#a3a3a3,stroke-width:2px;
    classDef datastore fill:#e6e6fa,stroke:#8073ac,stroke-width:2px;
    classDef build fill:#ccebc5,stroke:#8cae66,stroke-width:2px;
    classDef testing fill:#fddede,stroke:#e74c3c,stroke-width:2px;
```
