# karanongit/flow_app architecture

> Architecture diagram of the GitHub repository karanongit/flow_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/karanongit/flow_app
- Repository: https://github.com/karanongit/flow_app

## Overview

#### Purpose and Entry Points
FLOW is a cross-platform Flutter client that prototypes an electric ride-hailing journey: authentication, trip selection, driver matching/tracking, receipt/payment, and account management. Dart startup is `lib/main.dart`; app-wide dependency setup, routing, and theme establish the application boundary in `lib/core/providers/app_providers.dart`, `lib/core/router/app_router.dart`, and `lib/core/theme/app_theme.dart`.

#### Runtime and Platform Hosts
Flutter/Dart supplies the shared UI runtime for Android, iOS, macOS, and web. Native hosts bootstrap the Flutter engine rather than contain product logic: `android/app/src/main/kotlin/com/flow/app/flow_app/MainActivity.kt`, `ios/Runner/AppDelegate.swift`, and `macos/Runner/MainFlutterWindow.swift`. Web is hosted through `web/index.html`. The project has no indicated backend, authentication provider, payment gateway, or third-party map API.

#### Application Composition and Navigation
`go_router` declaratively maps auth, tab-shell, active-ride, and account subpage URLs. `lib/core/router/app_router.dart` is the central control-flow hub: screens invoke route transitions rather than directly composing the whole journey. Feature ownership is divided between `lib/features/auth`, `lib/features/ride`, and `lib/features/account`; the account shell provides persistent tab-level structure in `lib/features/account/widgets/account_shell_scaffold.dart`.

#### State, Domain, and Data Boundary
Riverpod providers expose shared application state and services through `lib/core/providers/app_providers.dart`. The ride workflow is coordinated by `lib/features/ride/controllers/ride_controller.dart`, which mediates screen interactions and trip state. Domain-shaped immutable data is organized under `lib/data/models`, notably `lib/data/models/trip_model.dart`, `lib/data/models/driver_model.dart`, and `lib/data/models/payment_model.dart`. `lib/data/repositories/flow_repository.dart` defines the app-facing data boundary, currently fulfilled by local fixture data in `lib/data/repositories/mock_flow_data.dart`, so UI flows are demonstrative rather than connected to remote infrastructure.

#### Ride Lifecycle
The primary flow proceeds from destination input and ride tier selection to simulated driver matching, in-progress tracking, then receipt/payment. Core stages are represented by `lib/features/ride/screens/home_screen.dart`, `lib/features/ride/screens/ride_selection_screen.dart`, `lib/features/ride/screens/matching_screen.dart`, `lib/features/ride/screens/tracking_screen.dart`, and `lib/features/ride/screens/receipt_screen.dart`. Search and scheduling are interaction boundaries encapsulated in `lib/features/ride/widgets/place_search_modal.dart` and `lib/features/ride/widgets/schedule_ride_modal.dart`.

#### Mapping, Location, and Routing
Maps are rendered locally via the custom vector canvas rather than an external map SDK: `lib/core/widgets/map_canvas.dart` supplies map visuals and route animation, while `lib/core/widgets/car_pin.dart` represents moving vehicle state. `lib/core/widgets/osm_map_view.dart` is an additional map-view abstraction. Location and route-calculation responsibilities are isolated behind `lib/core/services/location_service.dart` and `lib/core/services/routing_service.dart`; these are the natural integration boundaries for device geolocation and a future routing/maps service.

#### Presentation System
A centralized design system controls colors, typography, and theme modes through `lib/core/theme/app_colors.dart`, `lib/core/theme/app_typography.dart`, and `lib/core/theme/app_theme.dart`. Reusable branded and action primitives reside in `lib/core/widgets/flow_logo.dart` and `lib/core/widgets/primary_button.dart`, keeping feature screens focused on journey-specific composition.

Main entry points: [`lib/core/router/app_router.dart`](https://github.com/karanongit/flow_app/blob/main/lib/core/router/app_router.dart) (App router), [`lib/main.dart`](https://github.com/karanongit/flow_app/blob/main/lib/main.dart) (Flutter startup), [`lib/features/ride/controllers/ride_controller.dart`](https://github.com/karanongit/flow_app/blob/main/lib/features/ride/controllers/ride_controller.dart) (Ride controller), [`lib/data/repositories/mock_flow_data.dart`](https://github.com/karanongit/flow_app/blob/main/lib/data/repositories/mock_flow_data.dart) (Local fixtures)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform Hosts"]
  node_android["Android host<br/>Kotlin host<br/>[MainActivity.kt]"]
  node_ios["iOS host<br/>Swift host<br/>[AppDelegate.swift]"]
  node_macos["macOS host<br/>Swift host"]
  node_web["Web host<br/>HTML host<br/>[index.html]"]
end

subgraph group_core["App Core"]
  node_main(("Flutter startup<br/>Dart entry point<br/>[main.dart]"))
  node_providers["App providers<br/>Riverpod composition<br/>[app_providers.dart]"]
  node_router["App router<br/>go_router navigation<br/>[app_router.dart]"]
  node_theme["Design system<br/>Flutter theme<br/>[app_theme.dart]"]
  node_location{{"Location service<br/>integration boundary"}}
  node_routing{{"Routing service<br/>integration boundary"}}
  node_map["Map canvas<br/>custom map UI<br/>[map_canvas.dart]"]
  node_account_shell["Account shell<br/>tab scaffold"]
end

subgraph group_ride["Ride Journey"]
  node_ride_controller["Ride controller<br/>workflow controller"]
  node_home["Destination input<br/>ride screen<br/>[home_screen.dart]"]
  node_selection["Ride selection<br/>ride screen"]
  node_matching["Driver matching<br/>ride screen"]
  node_tracking["Ride tracking<br/>ride screen"]
  node_receipt["Receipt and payment<br/>ride screen"]
end

subgraph group_data["Data Layer"]
  node_repository{{"Flow repository<br/>data boundary"}}
  node_mock_data[("Local fixtures<br/>mock data source")]
  node_trip_model["Trip model<br/>immutable domain model<br/>[trip_model.dart]"]
  node_driver_model["Driver model<br/>immutable domain model<br/>[driver_model.dart]"]
  node_payment_model["Payment model<br/>immutable domain model<br/>[payment_model.dart]"]
end

node_android -->|"boots"| node_main
node_ios -->|"boots"| node_main
node_macos -->|"boots"| node_main
node_web -->|"hosts"| node_main
node_main -->|"initializes"| node_providers
node_main -->|"starts"| node_router
node_main -->|"applies"| node_theme
node_router -->|"routes to shell"| node_account_shell
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_selection
node_router -->|"routes to"| node_matching
node_router -->|"routes to"| node_tracking
node_router -->|"routes to"| node_receipt
node_home -->|"select ride"| node_selection
node_selection -->|"request ride"| node_matching
node_matching -->|"driver matched"| node_tracking
node_tracking -->|"complete trip"| node_receipt
node_ride_controller -->|"reads ride data"| node_repository
node_providers -->|"provides"| node_ride_controller
node_repository -->|"fulfilled by"| node_mock_data
node_mock_data -->|"uses"| node_trip_model
node_mock_data -->|"uses"| node_driver_model
node_mock_data -->|"uses"| node_payment_model
node_ride_controller -.->|"uses"| node_location
node_ride_controller -.->|"uses"| node_routing
node_tracking -->|"renders"| node_map
node_map -.->|"animates route from"| node_routing

click node_android "https://github.com/karanongit/flow_app/blob/main/android/app/src/main/kotlin/com/flow/app/flow_app/MainActivity.kt"
click node_ios "https://github.com/karanongit/flow_app/blob/main/ios/Runner/AppDelegate.swift"
click node_macos "https://github.com/karanongit/flow_app/blob/main/macos/Runner/MainFlutterWindow.swift"
click node_web "https://github.com/karanongit/flow_app/blob/main/web/index.html"
click node_main "https://github.com/karanongit/flow_app/blob/main/lib/main.dart"
click node_providers "https://github.com/karanongit/flow_app/blob/main/lib/core/providers/app_providers.dart"
click node_router "https://github.com/karanongit/flow_app/blob/main/lib/core/router/app_router.dart"
click node_theme "https://github.com/karanongit/flow_app/blob/main/lib/core/theme/app_theme.dart"
click node_location "https://github.com/karanongit/flow_app/blob/main/lib/core/services/location_service.dart"
click node_routing "https://github.com/karanongit/flow_app/blob/main/lib/core/services/routing_service.dart"
click node_map "https://github.com/karanongit/flow_app/blob/main/lib/core/widgets/map_canvas.dart"
click node_account_shell "https://github.com/karanongit/flow_app/blob/main/lib/features/account/widgets/account_shell_scaffold.dart"
click node_ride_controller "https://github.com/karanongit/flow_app/blob/main/lib/features/ride/controllers/ride_controller.dart"
click node_home "https://github.com/karanongit/flow_app/blob/main/lib/features/ride/screens/home_screen.dart"
click node_selection "https://github.com/karanongit/flow_app/blob/main/lib/features/ride/screens/ride_selection_screen.dart"
click node_matching "https://github.com/karanongit/flow_app/blob/main/lib/features/ride/screens/matching_screen.dart"
click node_tracking "https://github.com/karanongit/flow_app/blob/main/lib/features/ride/screens/tracking_screen.dart"
click node_receipt "https://github.com/karanongit/flow_app/blob/main/lib/features/ride/screens/receipt_screen.dart"
click node_repository "https://github.com/karanongit/flow_app/blob/main/lib/data/repositories/flow_repository.dart"
click node_mock_data "https://github.com/karanongit/flow_app/blob/main/lib/data/repositories/mock_flow_data.dart"
click node_trip_model "https://github.com/karanongit/flow_app/blob/main/lib/data/models/trip_model.dart"
click node_driver_model "https://github.com/karanongit/flow_app/blob/main/lib/data/models/driver_model.dart"
click node_payment_model "https://github.com/karanongit/flow_app/blob/main/lib/data/models/payment_model.dart"

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_android,node_ios,node_macos,node_web toneBlue
class node_main,node_providers,node_router,node_theme,node_location,node_routing,node_map,node_account_shell toneAmber
class node_ride_controller,node_home,node_selection,node_matching,node_tracking,node_receipt toneMint
class node_repository,node_mock_data,node_trip_model,node_driver_model,node_payment_model toneRose
```

## Components

### Platform Hosts

- [Android host](https://github.com/karanongit/flow_app/blob/main/android/app/src/main/kotlin/com/flow/app/flow_app/MainActivity.kt): Kotlin host · Bootstraps the Flutter engine. · `android/app/src/main/kotlin/com/flow/app/flow_app/MainActivity.kt`
- [iOS host](https://github.com/karanongit/flow_app/blob/main/ios/Runner/AppDelegate.swift): Swift host · Bootstraps the Flutter engine. · `ios/Runner/AppDelegate.swift`
- [macOS host](https://github.com/karanongit/flow_app/blob/main/macos/Runner/MainFlutterWindow.swift): Swift host · Bootstraps the Flutter engine. · `macos/Runner/MainFlutterWindow.swift`
- [Web host](https://github.com/karanongit/flow_app/blob/main/web/index.html): HTML host · Hosts the Flutter web runtime. · `web/index.html`

### App Core

- [Flutter startup](https://github.com/karanongit/flow_app/blob/main/lib/main.dart): Dart entry point · `lib/main.dart`
- [App providers](https://github.com/karanongit/flow_app/blob/main/lib/core/providers/app_providers.dart): Riverpod composition · Exposes shared state and services. · `lib/core/providers/app_providers.dart`
- [App router](https://github.com/karanongit/flow_app/blob/main/lib/core/router/app_router.dart): go_router navigation · Maps auth, shell, ride, and account routes. · `lib/core/router/app_router.dart`
- [Design system](https://github.com/karanongit/flow_app/blob/main/lib/core/theme/app_theme.dart): Flutter theme · Centralizes theme, color, and typography. · `lib/core/theme/app_theme.dart`
- [Location service](https://github.com/karanongit/flow_app/blob/main/lib/core/services/location_service.dart): integration boundary · Future device geolocation boundary. · `lib/core/services/location_service.dart`
- [Routing service](https://github.com/karanongit/flow_app/blob/main/lib/core/services/routing_service.dart): integration boundary · Future route-calculation boundary. · `lib/core/services/routing_service.dart`
- [Map canvas](https://github.com/karanongit/flow_app/blob/main/lib/core/widgets/map_canvas.dart): custom map UI · Renders local map visuals and route animation. · `lib/core/widgets/map_canvas.dart`
- [Account shell](https://github.com/karanongit/flow_app/blob/main/lib/features/account/widgets/account_shell_scaffold.dart): tab scaffold · Provides persistent account-level tab structure. · `lib/features/account/widgets/account_shell_scaffold.dart`

### Ride Journey

- [Ride controller](https://github.com/karanongit/flow_app/blob/main/lib/features/ride/controllers/ride_controller.dart): workflow controller · Coordinates ride interactions and trip state. · `lib/features/ride/controllers/ride_controller.dart`
- [Destination input](https://github.com/karanongit/flow_app/blob/main/lib/features/ride/screens/home_screen.dart): ride screen · `lib/features/ride/screens/home_screen.dart`
- [Ride selection](https://github.com/karanongit/flow_app/blob/main/lib/features/ride/screens/ride_selection_screen.dart): ride screen · `lib/features/ride/screens/ride_selection_screen.dart`
- [Driver matching](https://github.com/karanongit/flow_app/blob/main/lib/features/ride/screens/matching_screen.dart): ride screen · `lib/features/ride/screens/matching_screen.dart`
- [Ride tracking](https://github.com/karanongit/flow_app/blob/main/lib/features/ride/screens/tracking_screen.dart): ride screen · `lib/features/ride/screens/tracking_screen.dart`
- [Receipt and payment](https://github.com/karanongit/flow_app/blob/main/lib/features/ride/screens/receipt_screen.dart): ride screen · `lib/features/ride/screens/receipt_screen.dart`

### Data Layer

- [Flow repository](https://github.com/karanongit/flow_app/blob/main/lib/data/repositories/flow_repository.dart): data boundary · Defines the app-facing data contract. · `lib/data/repositories/flow_repository.dart`
- [Local fixtures](https://github.com/karanongit/flow_app/blob/main/lib/data/repositories/mock_flow_data.dart): mock data source · Supplies demonstrative ride data without remote infrastructure. · `lib/data/repositories/mock_flow_data.dart`
- [Trip model](https://github.com/karanongit/flow_app/blob/main/lib/data/models/trip_model.dart): immutable domain model · `lib/data/models/trip_model.dart`
- [Driver model](https://github.com/karanongit/flow_app/blob/main/lib/data/models/driver_model.dart): immutable domain model · `lib/data/models/driver_model.dart`
- [Payment model](https://github.com/karanongit/flow_app/blob/main/lib/data/models/payment_model.dart): immutable domain model · `lib/data/models/payment_model.dart`

## Connections

- Android host → Flutter startup: boots
- iOS host → Flutter startup: boots
- macOS host → Flutter startup: boots
- Web host → Flutter startup: hosts
- Flutter startup → App providers: initializes
- Flutter startup → App router: starts
- Flutter startup → Design system: applies
- App router → Account shell: routes to shell
- App router → Destination input: routes to
- App router → Ride selection: routes to
- App router → Driver matching: routes to
- App router → Ride tracking: routes to
- App router → Receipt and payment: routes to
- Destination input → Ride selection: select ride
- Ride selection → Driver matching: request ride
- Driver matching → Ride tracking: driver matched
- Ride tracking → Receipt and payment: complete trip
- Ride controller → Flow repository: reads ride data
- App providers → Ride controller: provides
- Flow repository → Local fixtures: fulfilled by
- Local fixtures → Trip model: uses
- Local fixtures → Driver model: uses
- Local fixtures → Payment model: uses
- Ride controller → Location service: uses
- Ride controller → Routing service: uses
- Ride tracking → Map canvas: renders
- Map canvas → Routing service: animates route from
