# sinatpub/pu_driver architecture

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

- Interactive diagram: https://gitdiagram.com/sinatpub/pu_driver
- Repository: https://github.com/sinatpub/pu_driver

## Overview

This is a Flutter driver app, with screens and BLoCs for sign-in, account setup, online status, bookings, trip history, profile, wallet, and notifications. The likely driver workflow begins at app startup, proceeds through authentication and the home/booking experience, and reaches trip or account results. The README describes a presentation/domain/data layering, but the Flutter implementation was not sampled; dashed links therefore mark inferred wiring, not verified calls. The tree also exposes a separate coffee example feature.

Main entry points: [`lib/data/datasources`](https://github.com/sinatpub/pu_driver/tree/main/lib/data/datasources) (Driver Data Sources), [`lib/presentation/screens/home_screen/home_screen.dart`](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/home_screen/home_screen.dart) (Driver Home), [`lib/app/root_main.dart`](https://github.com/sinatpub/pu_driver/blob/main/lib/app/root_main.dart) (App Root), [`lib/presentation/screens/login_page.dart`](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/login_page.dart) (Login And OTP)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Foundation"]
  node_startup["App Startup<br/>[main.dart]"]
  node_app_root["App Root<br/>[root_main.dart]"]
end

subgraph group_driver["Driver Experience"]
  node_login["Login And OTP<br/>[login_page.dart]"]
  node_register["Registration<br/>[register_page.dart]"]
  node_home["Driver Home<br/>[home_screen.dart]"]
  node_home_state["Home State<br/>[home_bloc.dart]"]
  node_booking["Booking Flow"]
  node_booking_state["Booking State<br/>[booking_bloc.dart]"]
  node_history["Trip History"]
  node_profile["Driver Profile"]
  node_wallet["Driver Wallet"]
  node_notifications["Notifications"]
end

subgraph group_data["Data And Domain"]
  node_datasources["Driver Data Sources"]
  node_domain["Domain Use Cases"]
  node_coffee_example["Coffee Example"]
end

subgraph group_services["Shared Services"]
  node_api["HTTP Client"]
  node_location["Location Service<br/>[location_bloc.dart]"]
  node_socket["Taxi Socket<br/>[init_socket.dart]"]
  node_storage["Local Storage"]
  node_notifications_service["Notification Logic"]
end

node_driver_user(("Driver"))

node_driver_user -.->|"opens app"| node_startup
node_startup -.->|"starts"| node_app_root
node_app_root -.->|"routes to"| node_login
node_app_root -.->|"routes to"| node_home
node_login -.->|"offers signup"| node_register
node_home -.->|"uses state"| node_home_state
node_home -.->|"opens booking"| node_booking
node_booking -.->|"uses state"| node_booking_state
node_home -.->|"uses location"| node_location
node_home -.->|"booking updates"| node_socket
node_booking_state -.->|"loads booking data"| node_datasources
node_login -.->|"authenticates via"| node_datasources
node_history -.->|"loads history"| node_datasources
node_profile -.->|"loads profile"| node_datasources
node_wallet -.->|"loads wallet"| node_datasources
node_notifications -.->|"loads notifications"| node_datasources
node_datasources -.->|"uses client"| node_api
node_domain -.->|"implemented by"| node_datasources
node_notifications -.->|"uses logic"| node_notifications_service

click node_startup "https://github.com/sinatpub/pu_driver/blob/main/lib/main.dart"
click node_app_root "https://github.com/sinatpub/pu_driver/blob/main/lib/app/root_main.dart"
click node_login "https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/login_page.dart"
click node_register "https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/register_page.dart"
click node_home "https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/home_screen/home_screen.dart"
click node_home_state "https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/home_screen/bloc/home_bloc.dart"
click node_booking "https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/booking/booking/booking_screen.dart"
click node_booking_state "https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/booking/booking/bloc/booking_bloc.dart"
click node_history "https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/history_booking/riding_history_screen.dart"
click node_profile "https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/profile_screen.dart"
click node_wallet "https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/blocs/driver_wallet_bloc.dart"
click node_notifications "https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/notification/view/notification_screen.dart"
click node_api "https://github.com/sinatpub/pu_driver/blob/main/lib/core/api_service/client/dio_http_client.dart"
click node_datasources "https://github.com/sinatpub/pu_driver/tree/main/lib/data/datasources"
click node_domain "https://github.com/sinatpub/pu_driver/tree/main/lib/domain/usecases"
click node_location "https://github.com/sinatpub/pu_driver/blob/main/lib/services/location_bloc/location_bloc.dart"
click node_socket "https://github.com/sinatpub/pu_driver/blob/main/lib/taxi_single_ton/init_socket.dart"
click node_storage "https://github.com/sinatpub/pu_driver/tree/main/lib/core/storages"
click node_notifications_service "https://github.com/sinatpub/pu_driver/blob/main/lib/services/notification_logic.dart"
click node_coffee_example "https://github.com/sinatpub/pu_driver/blob/main/lib/data/repositories/coffee_repository_impl.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_startup,node_app_root toneBlue
class node_login,node_register,node_home,node_home_state,node_booking,node_booking_state,node_history,node_profile,node_wallet,node_notifications toneAmber
class node_datasources,node_domain,node_coffee_example toneMint
class node_api,node_location,node_socket,node_storage,node_notifications_service toneRose
class node_driver_user toneIndigo
```

## Components

### App Foundation

- [App Startup](https://github.com/sinatpub/pu_driver/blob/main/lib/main.dart): `lib/main.dart`
- [App Root](https://github.com/sinatpub/pu_driver/blob/main/lib/app/root_main.dart): `lib/app/root_main.dart`

### Driver Experience

- [Login And OTP](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/login_page.dart): `lib/presentation/screens/login_page.dart`
- [Registration](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/register_page.dart): `lib/presentation/screens/register_page.dart`
- [Driver Home](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/home_screen/home_screen.dart): `lib/presentation/screens/home_screen/home_screen.dart`
- [Home State](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/home_screen/bloc/home_bloc.dart): `lib/presentation/screens/home_screen/bloc/home_bloc.dart`
- [Booking Flow](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/booking/booking/booking_screen.dart): `lib/presentation/screens/booking/booking/booking_screen.dart`
- [Booking State](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/booking/booking/bloc/booking_bloc.dart): `lib/presentation/screens/booking/booking/bloc/booking_bloc.dart`
- [Trip History](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/history_booking/riding_history_screen.dart): `lib/presentation/screens/history_booking/riding_history_screen.dart`
- [Driver Profile](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/profile_screen.dart): `lib/presentation/screens/profile_screen.dart`
- [Driver Wallet](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/blocs/driver_wallet_bloc.dart): `lib/presentation/blocs/driver_wallet_bloc.dart`
- [Notifications](https://github.com/sinatpub/pu_driver/blob/main/lib/presentation/screens/notification/view/notification_screen.dart): `lib/presentation/screens/notification/view/notification_screen.dart`

### Data And Domain

- [Driver Data Sources](https://github.com/sinatpub/pu_driver/tree/main/lib/data/datasources): `lib/data/datasources`
- [Domain Use Cases](https://github.com/sinatpub/pu_driver/tree/main/lib/domain/usecases): `lib/domain/usecases`
- [Coffee Example](https://github.com/sinatpub/pu_driver/blob/main/lib/data/repositories/coffee_repository_impl.dart): `lib/data/repositories/coffee_repository_impl.dart`

### Shared Services

- [HTTP Client](https://github.com/sinatpub/pu_driver/blob/main/lib/core/api_service/client/dio_http_client.dart): `lib/core/api_service/client/dio_http_client.dart`
- [Location Service](https://github.com/sinatpub/pu_driver/blob/main/lib/services/location_bloc/location_bloc.dart): `lib/services/location_bloc/location_bloc.dart`
- [Taxi Socket](https://github.com/sinatpub/pu_driver/blob/main/lib/taxi_single_ton/init_socket.dart): `lib/taxi_single_ton/init_socket.dart`
- [Local Storage](https://github.com/sinatpub/pu_driver/tree/main/lib/core/storages): `lib/core/storages`
- [Notification Logic](https://github.com/sinatpub/pu_driver/blob/main/lib/services/notification_logic.dart): `lib/services/notification_logic.dart`

### Other components

- **Driver**

## Connections

- Driver → App Startup: opens app
- App Startup → App Root: starts
- App Root → Login And OTP: routes to
- App Root → Driver Home: routes to
- Login And OTP → Registration: offers signup
- Driver Home → Home State: uses state
- Driver Home → Booking Flow: opens booking
- Booking Flow → Booking State: uses state
- Driver Home → Location Service: uses location
- Driver Home → Taxi Socket: booking updates
- Booking State → Driver Data Sources: loads booking data
- Login And OTP → Driver Data Sources: authenticates via
- Trip History → Driver Data Sources: loads history
- Driver Profile → Driver Data Sources: loads profile
- Driver Wallet → Driver Data Sources: loads wallet
- Notifications → Driver Data Sources: loads notifications
- Driver Data Sources → HTTP Client: uses client
- Domain Use Cases → Driver Data Sources: implemented by
- Notifications → Notification Logic: uses logic
