# tituski/sewlesew-mobile-app architecture

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

- Interactive diagram: https://gitdiagram.com/tituski/sewlesew-mobile-app
- Repository: https://github.com/tituski/sewlesew-mobile-app

## Overview

##### Overall Project Structure
- At the highest level, show two major blocks: Client (Flutter UI) and the underlying Platform-Specific layers (Android, iOS, etc.) that Flutter compiles to.

##### Main Components within the Flutter Application
- Presentation Layer: Cover all the UI pages and widgets found under lib/features/*/presentation. Indicate that each feature (e.g., authentication, campaign, donations, explore, user_profile) has its own presentation logic (using BLoC, Cubit, etc.).
- Domain Layer: For each feature, highlight the domain entities, use cases, and repositories (interfaces) defined under lib/features/*/domain. This layer dictates the core business logic and validations.
- Data Layer: This includes models, mappers, repositories (implementations), and services (both remote and local) as seen under lib/features/*/data. It handles external API interactions, data persistence, and conversion.
- Core & Config Modules: Display a separate “Core/Config” section representing shared constants, utility functions, theming, and routes. This supports all the feature modules.
- Dependency Injection: Notice the presence of injection_container.dart. Represent the DI container that wires up the various components (services, use cases, blocs, etc.).

##### Cross-Cutting Concerns and Additional Modules
- State Management: Emphasize that BLoC/Cubit is used extensively for managing presentation state (found throughout the presentation/bloc directories).
- Routing & Theming: Under lib/config, showcase that routing configuration and theme settings help manage navigation and the appearance across the app.
- External Data Sources: Indicate connections from the data layer to any remote APIs or local storage systems (such as token storage in auth or campaigns/donations services).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Flutter Client Block
    subgraph "Flutter Client"
        DI["Dependency Injection"]:::di
        CC["Core & Config Modules"]:::core
        subgraph "Core & Config Modules"
            Core["Core"]:::core
            Config["Config"]:::core
        end
        subgraph "Features"
            subgraph "Auth Feature"
                APres["Auth Presentation"]:::presentation
                ADom["Auth Domain"]:::domain
                AData["Auth Data"]:::data
            end
            subgraph "Campaign Feature"
                CPres["Campaign Presentation"]:::presentation
                CDom["Campaign Domain"]:::domain
                CData["Campaign Data"]:::data
            end
            subgraph "Donations Feature"
                DPres["Donations Presentation"]:::presentation
                DDom["Donations Domain"]:::domain
                DData["Donations Data"]:::data
            end
            subgraph "Explore Feature"
                EPres["Explore Presentation"]:::presentation
            end
            subgraph "User Profile Feature"
                UPres["User Profile Presentation"]:::presentation
                UDom["User Profile Domain"]:::domain
                UData["User Profile Data"]:::data
            end
        end
    end

    %% Platform-Specific Layers Block
    subgraph "Platform-Specific Layers"
        Android["Android"]:::platform
        iOS["iOS"]:::platform
        Web["Web"]:::platform
        Linux["Linux"]:::platform
        macOS["macOS"]:::platform
        Windows["Windows"]:::platform
    end

    %% Interaction: Dependency Injection wires up components in features
    DI -->|"wires_components"| APres
    DI -->|"wires_components"| ADom
    DI -->|"wires_components"| AData
    DI -->|"wires_components"| CPres
    DI -->|"wires_components"| CDom
    DI -->|"wires_components"| CData
    DI -->|"wires_components"| DPres
    DI -->|"wires_components"| DDom
    DI -->|"wires_components"| DData
    DI -->|"wires_components"| EPres
    DI -->|"wires_components"| UPres
    DI -->|"wires_components"| UDom
    DI -->|"wires_components"| UData

    %% Core & Config support to Presentation level
    Core -->|"provides_utilities"| APres
    Core -->|"provides_utilities"| CPres
    Core -->|"provides_utilities"| DPres
    Core -->|"provides_utilities"| EPres
    Core -->|"provides_utilities"| UPres
    Config -->|"manages_routing_theme"| APres
    Config -->|"manages_routing_theme"| CPres
    Config -->|"manages_routing_theme"| DPres
    Config -->|"manages_routing_theme"| EPres
    Config -->|"manages_routing_theme"| UPres

    %% Feature Internal Flows
    APres -->|"triggers_usecase"| ADom
    ADom -->|"fetches_data"| AData

    CPres -->|"triggers_usecase"| CDom
    CDom -->|"fetches_data"| CData

    DPres -->|"triggers_usecase"| DDom
    DDom -->|"fetches_data"| DData

    UPres -->|"triggers_usecase"| UDom
    UDom -->|"fetches_data"| UData

    %% Flutter Client compiles to Platform-Specific Layers
    DI ---|"compiled_by_Flutter"| Android
    DI ---|"compiled_by_Flutter"| iOS
    DI ---|"compiled_by_Flutter"| Web
    DI ---|"compiled_by_Flutter"| Linux
    DI ---|"compiled_by_Flutter"| macOS
    DI ---|"compiled_by_Flutter"| Windows

    %% External API Call from Data Layers
    AData -->|"calls_external_API"| External["External Service"]:::external
    CData -->|"calls_external_API"| External
    DData -->|"calls_external_API"| External
    UData -->|"calls_external_API"| External

%% Click Events
click Android "https://github.com/tituski/sewlesew-mobile-app/blob/master/android/app/src/main/kotlin/com/example/unity_fund/MainActivity.kt"
click iOS "https://github.com/tituski/sewlesew-mobile-app/blob/master/ios/Runner/AppDelegate.swift"
click Web "https://github.com/tituski/sewlesew-mobile-app/blob/master/web/index.html"
click Linux "https://github.com/tituski/sewlesew-mobile-app/blob/master/linux/main.cc"
click macOS "https://github.com/tituski/sewlesew-mobile-app/blob/master/macos/Runner/MainFlutterWindow.swift"
click Windows "https://github.com/tituski/sewlesew-mobile-app/blob/master/windows/runner/main.cpp"

click APres "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/auth/presentation"
click ADom "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/auth/domain"
click AData "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/auth/data"

click CPres "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/campaign/presentation"
click CDom "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/campaign/domain"
click CData "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/campaign/data"

click DPres "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/donations/presentation"
click DDom "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/donations/domain"
click DData "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/donations/data"

click EPres "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/explore/presentation"

click UPres "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/user_profile/presentation"
click UDom "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/user_profile/domain"
click UData "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/features/user_profile/data"

click Core "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/core"
click Config "https://github.com/tituski/sewlesew-mobile-app/tree/master/lib/config"
click DI "https://github.com/tituski/sewlesew-mobile-app/blob/master/lib/injection_container.dart"

%% Styles
classDef presentation fill:#ADD8E6,stroke:#333,stroke-width:2px;
classDef domain fill:#FFD700,stroke:#333,stroke-width:2px;
classDef data fill:#FFB6C1,stroke:#333,stroke-width:2px;
classDef core fill:#90EE90,stroke:#333,stroke-width:2px;
classDef di fill:#C0C0C0,stroke:#333,stroke-width:2px;
classDef platform fill:#DDA0DD,stroke:#333,stroke-width:2px;
classDef external fill:#FFA07A,stroke:#333,stroke-width:2px;
```
