# flux-bytebloom-org/flux-team architecture

> Architecture diagram of the GitHub repository flux-bytebloom-org/flux-team, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/flux-bytebloom-org/flux-team
- Repository: https://github.com/flux-bytebloom-org/flux-team

## Overview

Flux is a logistics and fleet-management application, presented primarily as a Kotlin console program. Its main workflow loads warehouses, packages, routes, and vehicles through repositories, then exercises routing, package/fleet dispatch, pricing, and CRUD scenarios. A separate Compose Multiplatform frontend currently shows a generic greeting rather than a logistics workflow. The README is empty, so product capabilities are inferred from the source tree and sampled entry-point code; use-case internals and most persistence wiring were not sampled.

Main entry points: [`src/main/kotlin/org/byte_bloom/flux/ui/Main.kt`](https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/ui/Main.kt) (Console scenarios), [`src/main/kotlin/org/byte_bloom/flux/data/repositoryimplementation`](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/data/repositoryimplementation) (Repository adapters), [`src/main/kotlin/org/byte_bloom/flux/domain/repository`](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/repository) (Repository contracts), [`src/main/kotlin/org/byte_bloom/flux/domain/algorithm/routing`](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/algorithm/routing) (Route search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_console["Console scenarios<br/>[Main.kt]"]
  node_compose["Compose greeting<br/>[App.kt]"]
end

subgraph group_domain["Logistics domain"]
  node_dispatch["Dispatch use cases"]
  node_reroute["Shipment rerouting"]
  node_othercases["Other logistics use cases"]
  node_warehouse["Warehouse model<br/>[Warehouse.kt]"]
  node_package["Package model<br/>[Package.kt]"]
  node_vehicle["Vehicle model<br/>[Vehicle.kt]"]
  node_route["Route model<br/>[Route.kt]"]
  node_repositories["Repository contracts"]
  node_exceptions["Domain exceptions"]
end

subgraph group_algorithms["Planning algorithms"]
  node_routing["Route search"]
  node_pricing["Rate calculation"]
  node_dispatchalg["Dispatch algorithms"]
end

subgraph group_data["Persistence and integrations"]
  node_repositoryimpl["Repository adapters"]
  node_csv["CSV data sources"]
  node_remote["Supabase data sources"]
  node_supabase["Supabase HTTP client"]
end

node_operator(("Operator"))
node_supabase_service[("Supabase")]

node_operator -->|"runs"| node_console
node_console -->|"loads entities"| node_repositories
node_console -->|"dispatches vehicles"| node_dispatch
node_console -->|"runs scenarios"| node_othercases
node_console -->|"compares routers"| node_routing
node_console -->|"stacks decorators"| node_pricing
node_operator -.->|"opens app"| node_compose
node_dispatch -.->|"uses contracts"| node_repositories
node_reroute -.->|"updates packages"| node_repositories
node_othercases -.->|"plans paths"| node_routing
node_othercases -.->|"selects fleet"| node_dispatchalg
node_repositories -->|"implemented by"| node_repositoryimpl
node_repositoryimpl -->|"reads local data"| node_csv
node_repositoryimpl -->|"uses remote data"| node_remote
node_repositoryimpl -->|"implements"| node_repositories
node_repositoryimpl -->|"maps entities"| node_warehouse
node_repositoryimpl -->|"maps entities"| node_package
node_remote -.->|"sends requests"| node_supabase
node_supabase -.->|"calls API"| node_supabase_service
node_warehouse -->|"queues cargo"| node_package
node_package -->|"supports pricing"| node_pricing
node_routing -->|"searches routes"| node_route
node_routing -->|"searches hubs"| node_warehouse

click node_console "https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/ui/Main.kt"
click node_compose "https://github.com/flux-bytebloom-org/flux-team/blob/develop/frontend/logiroute/src/commonMain/kotlin/edu/logiroute/logiroute/App.kt"
click node_dispatch "https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/usecase/DispatchVehicleUseCase.kt"
click node_reroute "https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/usecase/ReroutePackageUseCase.kt"
click node_othercases "https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/usecase"
click node_warehouse "https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/model/Warehouse.kt"
click node_package "https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/model/Package.kt"
click node_vehicle "https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/model/Vehicle.kt"
click node_route "https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/model/Route.kt"
click node_repositories "https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/repository"
click node_exceptions "https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/exception/LogisticsException.kt"
click node_routing "https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/algorithm/routing"
click node_pricing "https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/algorithm/pricing"
click node_dispatchalg "https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/dispatch"
click node_repositoryimpl "https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/data/repositoryimplementation"
click node_csv "https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/data/csv/datasource"
click node_remote "https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/data/remote/datasource"
click node_supabase "https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/data/remote/client/SupabaseHttpClient.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_console,node_compose toneBlue
class node_dispatch,node_reroute,node_othercases,node_warehouse,node_package,node_vehicle,node_route,node_repositories,node_exceptions,node_supabase_service toneAmber
class node_routing,node_pricing,node_dispatchalg toneMint
class node_repositoryimpl,node_csv,node_remote,node_supabase toneRose
class node_operator toneIndigo
```

## Components

### Application entry

- [Console scenarios](https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/ui/Main.kt): `src/main/kotlin/org/byte_bloom/flux/ui/Main.kt`
- [Compose greeting](https://github.com/flux-bytebloom-org/flux-team/blob/develop/frontend/logiroute/src/commonMain/kotlin/edu/logiroute/logiroute/App.kt): `frontend/logiroute/src/commonMain/kotlin/edu/logiroute/logiroute/App.kt`

### Logistics domain

- [Dispatch use cases](https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/usecase/DispatchVehicleUseCase.kt): `src/main/kotlin/org/byte_bloom/flux/domain/usecase/DispatchVehicleUseCase.kt`
- [Shipment rerouting](https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/usecase/ReroutePackageUseCase.kt): `src/main/kotlin/org/byte_bloom/flux/domain/usecase/ReroutePackageUseCase.kt`
- [Other logistics use cases](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/usecase): `src/main/kotlin/org/byte_bloom/flux/domain/usecase`
- [Warehouse model](https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/model/Warehouse.kt): `src/main/kotlin/org/byte_bloom/flux/domain/model/Warehouse.kt`
- [Package model](https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/model/Package.kt): `src/main/kotlin/org/byte_bloom/flux/domain/model/Package.kt`
- [Vehicle model](https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/model/Vehicle.kt): `src/main/kotlin/org/byte_bloom/flux/domain/model/Vehicle.kt`
- [Route model](https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/model/Route.kt): `src/main/kotlin/org/byte_bloom/flux/domain/model/Route.kt`
- [Repository contracts](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/repository): `src/main/kotlin/org/byte_bloom/flux/domain/repository`
- [Domain exceptions](https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/domain/exception/LogisticsException.kt): `src/main/kotlin/org/byte_bloom/flux/domain/exception/LogisticsException.kt`

### Planning algorithms

- [Route search](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/algorithm/routing): `src/main/kotlin/org/byte_bloom/flux/domain/algorithm/routing`
- [Rate calculation](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/algorithm/pricing): `src/main/kotlin/org/byte_bloom/flux/domain/algorithm/pricing`
- [Dispatch algorithms](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/domain/dispatch): `src/main/kotlin/org/byte_bloom/flux/domain/dispatch`

### Persistence and integrations

- [Repository adapters](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/data/repositoryimplementation): `src/main/kotlin/org/byte_bloom/flux/data/repositoryimplementation`
- [CSV data sources](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/data/csv/datasource): `src/main/kotlin/org/byte_bloom/flux/data/csv/datasource`
- [Supabase data sources](https://github.com/flux-bytebloom-org/flux-team/tree/develop/src/main/kotlin/org/byte_bloom/flux/data/remote/datasource): `src/main/kotlin/org/byte_bloom/flux/data/remote/datasource`
- [Supabase HTTP client](https://github.com/flux-bytebloom-org/flux-team/blob/develop/src/main/kotlin/org/byte_bloom/flux/data/remote/client/SupabaseHttpClient.kt): `src/main/kotlin/org/byte_bloom/flux/data/remote/client/SupabaseHttpClient.kt`

### Other components

- **Operator**
- **Supabase**

## Connections

- Operator → Console scenarios: runs (evidence: `src/main/kotlin/org/byte_bloom/flux/ui/Main.kt`)
- Console scenarios → Repository contracts: loads entities (evidence: `src/main/kotlin/org/byte_bloom/flux/ui/Main.kt`)
- Console scenarios → Dispatch use cases: dispatches vehicles (evidence: `src/main/kotlin/org/byte_bloom/flux/ui/Main.kt`)
- Console scenarios → Other logistics use cases: runs scenarios (evidence: `src/main/kotlin/org/byte_bloom/flux/ui/Main.kt`)
- Console scenarios → Route search: compares routers (evidence: `src/main/kotlin/org/byte_bloom/flux/ui/Main.kt`)
- Console scenarios → Rate calculation: stacks decorators (evidence: `src/main/kotlin/org/byte_bloom/flux/ui/Main.kt`)
- Operator → Compose greeting: opens app
- Dispatch use cases → Repository contracts: uses contracts
- Shipment rerouting → Repository contracts: updates packages
- Other logistics use cases → Route search: plans paths
- Other logistics use cases → Dispatch algorithms: selects fleet
- Repository contracts → Repository adapters: implemented by (evidence: `src/main/kotlin/org/byte_bloom/flux/di/repositoryModule.kt`)
- Repository adapters → CSV data sources: reads local data (evidence: `src/main/kotlin/org/byte_bloom/flux/di/repositoryModule.kt`)
- Repository adapters → Supabase data sources: uses remote data (evidence: `src/main/kotlin/org/byte_bloom/flux/data/repositoryimplementation/PackageRepositoryImpl.kt`)
- Repository adapters → Repository contracts: implements (evidence: `src/main/kotlin/org/byte_bloom/flux/di/repositoryModule.kt`)
- Repository adapters → Warehouse model: maps entities (evidence: `src/main/kotlin/org/byte_bloom/flux/data/repositoryimplementation/PackageRepositoryImpl.kt`)
- Repository adapters → Package model: maps entities (evidence: `src/main/kotlin/org/byte_bloom/flux/data/repositoryimplementation/PackageRepositoryImpl.kt`)
- Supabase data sources → Supabase HTTP client: sends requests
- Supabase HTTP client → Supabase: calls API
- Warehouse model → Package model: queues cargo (evidence: `src/main/kotlin/org/byte_bloom/flux/domain/model/Warehouse.kt`)
- Package model → Rate calculation: supports pricing (evidence: `src/main/kotlin/org/byte_bloom/flux/domain/model/Package.kt`)
- Route search → Route model: searches routes (evidence: `src/main/kotlin/org/byte_bloom/flux/domain/algorithm/routing/BidirectionalBfsRouter.kt`)
- Route search → Warehouse model: searches hubs (evidence: `src/main/kotlin/org/byte_bloom/flux/domain/algorithm/routing/BidirectionalBfsRouter.kt`)
