# flow-mn/flow architecture

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

- Interactive diagram: https://gitdiagram.com/flow-mn/flow
- Repository: https://github.com/flow-mn/flow

## Overview

##### Main Components

a. Frontend Layer:
- UI Components (lib/widgets/)
- Routes/Pages (lib/routes/)
- Theme System (lib/theme/)
- Localization (lib/l10n/)

b. Data Layer:
- Entity Models (lib/entity/)
- Data Models (lib/data/)
- ObjectBox Database (lib/objectbox/)
- Preferences Management (lib/prefs/)

c. Business Logic Layer:
- Services (lib/services/)
- Sync Management (lib/sync/)
- Utils (lib/utils/)

d. Platform-Specific Implementations:
- Android (android/)
- iOS (ios/)
- macOS (macos/)
- Linux (linux/)
- Windows (windows/)

**┌─────────────────────────────────────────────────────────────┐**
- Presentation Layer                       │
- ┬─────────────┬────────────────┬───────────────┤
- Widgets   │   Routes    │     Theme      │ Localization  │
- ┬───────┴─────┬───────┴────────┬───────┴───────┬───────┘

**┌─────▼─────────────▼────────────────▼──────────────▼───────┐**
- Business Logic Layer                     │
- ┬────────────┬─────────────────┬───────────────┤
- Services  │   Sync    │     Utils       │    Constants   │
- ┬──────┴─────┬─────┴────────┬────────┴───────┬───────┘

**┌─────▼────────────▼──────────────▼────────────────▼───────┐**
- Data Layer                           │
- ┬────────────┬─────────────────┬─────────────┤
- Entities  │ObjectBox DB│  Preferences    │ Data Models │
- ┴────────────┴─────────────────┴─────────────┘

##### Important Relationships

- Database interactions (ObjectBox)
- Platform-specific implementations
- Sync/Export/Import flows
- Currency and transaction management flows

##### Additional Elements

- Notes about cross-platform compatibility
- Integration points with external services
- Data flow direction indicators
- Sync/backup paths

##### Implementation Details to Highlight

- ObjectBox database integration
- Multi-currency support system
- Export/Import functionality
- Account management system
- Category management system
- Transaction tracking system

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef presentation fill:#e1f5fe,stroke:#01579b
    classDef business fill:#e8f5e9,stroke:#1b5e20
    classDef data fill:#fff3e0,stroke:#e65100
    classDef platform fill:#f3e5f5,stroke:#4a148c
    
    %% Presentation Layer
    subgraph PresentationLayer
        UI["UI Components"]:::presentation
        Routes["Routes/Pages"]:::presentation
        Theme["Theme System"]:::presentation
        L10n["Localization"]:::presentation
    end

    %% Business Logic Layer
    subgraph BusinessLayer
        Services["Services"]:::business
        Sync["Sync Management"]:::business
        Utils["Utils"]:::business
        Constants["Constants"]:::business
    end

    %% Data Layer
    subgraph DataLayer
        Entities["Entity Models"]:::data
        ObjectBox["ObjectBox DB"]:::data
        Prefs["Preferences"]:::data
        DataModels["Data Models"]:::data
    end

    %% Platform Layer
    subgraph PlatformLayer
        Android["Android"]:::platform
        iOS["iOS"]:::platform
        macOS["macOS"]:::platform
        Linux["Linux"]:::platform
        Windows["Windows"]:::platform
    end

    %% Relationships
    UI --> Services
    UI --> Theme
    UI --> L10n
    Routes --> Services
    Services --> Sync
    Services --> ObjectBox
    Services --> Prefs
    Sync --> ObjectBox
    ObjectBox --> Entities
    ObjectBox --> DataModels
    Prefs --> DataModels

    %% Platform Connections
    Services --> Android
    Services --> iOS
    Services --> macOS
    Services --> Linux
    Services --> Windows

    %% Click Events
    click UI "https://github.com/flow-mn/flow/tree/main/lib/widgets/"
    click Routes "https://github.com/flow-mn/flow/tree/main/lib/routes/"
    click Theme "https://github.com/flow-mn/flow/tree/main/lib/theme/"
    click L10n "https://github.com/flow-mn/flow/tree/main/lib/l10n/"
    click Entities "https://github.com/flow-mn/flow/tree/main/lib/entity/"
    click DataModels "https://github.com/flow-mn/flow/tree/main/lib/data/"
    click ObjectBox "https://github.com/flow-mn/flow/tree/main/lib/objectbox/"
    click Prefs "https://github.com/flow-mn/flow/blob/main/lib/prefs.dart"
    click Services "https://github.com/flow-mn/flow/tree/main/lib/services/"
    click Sync "https://github.com/flow-mn/flow/tree/main/lib/sync/"
    click Utils "https://github.com/flow-mn/flow/tree/main/lib/utils/"
    click Android "https://github.com/flow-mn/flow/tree/main/android/"
    click iOS "https://github.com/flow-mn/flow/tree/main/ios/"
    click macOS "https://github.com/flow-mn/flow/tree/main/macos/"
    click Linux "https://github.com/flow-mn/flow/tree/main/linux/"
    click Windows "https://github.com/flow-mn/flow/tree/main/windows/"

    %% Legend
    subgraph Legend
        P["Presentation Component"]:::presentation
        B["Business Logic Component"]:::business
        D["Data Component"]:::data
        PL["Platform Component"]:::platform
    end
```
