# schtroumphy/feedme architecture

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

- Interactive diagram: https://gitdiagram.com/schtroumphy/feedme
- Repository: https://github.com/schtroumphy/feedme

## Overview

##### Main Components

a. Presentation Layer:
- Jetpack Compose UI Components
- ViewModels (Command, Client, Product, Basket)
- UI States
- Navigation Components

b. Domain Layer:
- Use Cases (organized by feature)
- Domain Models
- Repository Interfaces

c. Data Layer:
- Local Storage (Room Database)
- Remote Services (Google Maps/Nominatim API)
- Repository Implementations
- Data Mappers

d. Core Module:
- Dependency Injection (Dagger-Hilt)
- Database Configuration
- Theme/Styling
- Common Extensions

**┌─────────────────────────────────────────────────────────────┐**
- Presentation Layer                       │
- ┌─────────────┐  ┌─────────────┐  ┌─────────────┐         │
- Command   │  │   Client    │  │   Basket    │         │
- Views    │  │    Views    │  │    Views    │         │
- ┬───────┘  └─────┬───────┘  └─────┬───────┘         │

- ┌─────┴───────┐  ┌─────┴───────┐  ┌─────┴───────┐         │
- ViewModels │  │  ViewModels │  │  ViewModels │         │
- ┬───────┘  └─────┬───────┘  └─────┬───────┘         │
- ┼────────────────┼────────────────┼─────────────────┘

**┌────────┼────────────────┼────────────────┼─────────────────┐**
- Domain Layer│                 │                 │
- ┌─────┴───────┐  ┌─────┴───────┐  ┌─────┴───────┐         │
- Use Cases  │  │  Use Cases  │  │  Use Cases  │         │
- ┬───────┘  └─────┬───────┘  └─────┬───────┘         │

- ┌─────┴───────┐  ┌─────┴───────┐  ┌─────┴───────┐         │
- Models    │  │   Models    │  │   Models    │         │
- ┬───────┘  └─────┬───────┘  └─────┬───────┘         │
- ┼────────────────┼────────────────┼─────────────────┘

**┌────────┼────────────────┼────────────────┼─────────────────┐**
- Data Layer │                 │                 │
- ┌─────┴───────┐  ┌─────┴───────┐  ┌─────┴───────┐         │
- Repositories│  │ Repositories│  │ Repositories│         │
- ┬───────┘  └─────┬───────┘  └─────┬───────┘         │

- ┌───┴────┐      ┌───┴────┐       ┌───┴────┐             │
- Room  │      │  APIs  │       │Mappers │             │
- ┘      └────────┘       └────────┘             │
- ┘

##### Important Relationships

- Dependency flow (always pointing towards the domain layer)
- Data flow between layers
- Feature module boundaries
- Database relationships
- API integrations

##### Additional Elements

- Notes for key architectural decisions
- Dependency injection flow
- Clean Architecture boundaries

##### Implementation Details

- Related components with containers
- Version information and tech stack details

Remember to include the core module's relationship with all features and how it provides common functionality across the application.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef presentation fill:#3498db,stroke:#2980b9,color:white
    classDef domain fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#e67e22,stroke:#d35400,color:white
    classDef core fill:#9b59b6,stroke:#8e44ad,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Core Module
    subgraph Core
        DI["Dependency Injection"]:::core
        DB_Config["Database Configuration"]:::core
        Theme["Theme/Styling"]:::core
        Extensions["Common Extensions"]:::core
    end

    %% Presentation Layer
    subgraph Presentation
        subgraph Views
            CommandViews["Command Views"]:::presentation
            ClientViews["Client Views"]:::presentation
            BasketViews["Basket Views"]:::presentation
            ProductViews["Product Views"]:::presentation
        end

        subgraph ViewModels
            CommandVM["Command ViewModel"]:::presentation
            ClientVM["Client ViewModel"]:::presentation
            BasketVM["Basket ViewModel"]:::presentation
            ProductVM["Product ViewModel"]:::presentation
        end
    end

    %% Domain Layer
    subgraph Domain
        UseCases["Use Cases"]:::domain
        DomainModels["Domain Models"]:::domain
        RepoInterfaces["Repository Interfaces"]:::domain
    end

    %% Data Layer
    subgraph Data
        LocalStorage["Room Database"]:::data
        RemoteServices["Maps/Nominatim API"]:::external
        RepoImpl["Repository Implementations"]:::data
        Mappers["Data Mappers"]:::data
    end

    %% Relationships
    CommandViews --> CommandVM
    ClientViews --> ClientVM
    BasketViews --> BasketVM
    ProductViews --> ProductVM

    CommandVM --> UseCases
    ClientVM --> UseCases
    BasketVM --> UseCases
    ProductVM --> UseCases

    UseCases --> DomainModels
    UseCases --> RepoInterfaces

    RepoInterfaces --> RepoImpl
    RepoImpl --> LocalStorage
    RepoImpl --> RemoteServices
    RepoImpl --> Mappers

    DI --> CommandVM
    DI --> ClientVM
    DI --> BasketVM
    DI --> ProductVM
    DI --> RepoImpl

    %% Click Events
    click DI "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/core/di/"
    click DB_Config "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/core/database/"
    click Theme "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/core/theme/"
    click Extensions "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/core/extensions/"
    click CommandViews "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/presentation/command/"
    click ClientViews "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/presentation/client/"
    click BasketViews "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/presentation/basket/"
    click ProductViews "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/presentation/products/"
    click UseCases "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/domain/usecases/"
    click DomainModels "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/domain/models/"
    click RepoInterfaces "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/domain/repository/"
    click LocalStorage "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/data/local/"
    click RemoteServices "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/data/external/services/"
    click RepoImpl "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/data/repositoryImpl/"
    click Mappers "https://github.com/Schtroumphy/FeedMe/tree/v1/app/src/main/java/com/jeanloth/project/android/kotlin/feedme/features/command/data/mappers/"
```
