# trio707/bus-pay architecture

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

- Interactive diagram: https://gitdiagram.com/trio707/bus-pay
- Repository: https://github.com/trio707/bus-pay

## Overview

Daladala is a Flutter app whose README identifies no product details beyond being a starter project. The file tree suggests a wallet and transit-card experience, including passenger payments and a separate agent workflow. The likely flow is sign-in, wallet or card action, then payment confirmation; NFC scanning and card registration/renewal are additional branches. The graph maps these apparent product areas and the domain/data layers. Dart implementation excerpts were not provided, so inferred relationships are dashed and unverified.

Main entry points: [`lib/home_shell.dart`](https://github.com/trio707/bus-pay/blob/main/lib/home_shell.dart) (Home shell), [`lib/screens/jihudumie_screen.dart`](https://github.com/trio707/bus-pay/blob/main/lib/screens/jihudumie_screen.dart) (Wallet home), [`lib/main.dart`](https://github.com/trio707/bus-pay/blob/main/lib/main.dart) (App entry), [`lib/screens/login_screen.dart`](https://github.com/trio707/bus-pay/blob/main/lib/screens/login_screen.dart) (Sign-in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and navigation"]
  node_app["App entry<br/>[main.dart]"]
  node_shell["Home shell<br/>[home_shell.dart]"]
end

subgraph group_passenger["Passenger wallet"]
  node_login["Sign-in<br/>[login_screen.dart]"]
  node_wallet["Wallet home"]
  node_payments["Payments and transfers"]
  node_card["Card management"]
  node_nfc["NFC scanning"]
  node_payment_result["Payment verification"]
  node_payment_success["Payment result"]
end

subgraph group_agent["Agent operations"]
  node_agent_login["Agent sign-in"]
  node_agent_home["Agent workspace"]
  node_agent_card["Agent card actions"]
end

subgraph group_services["Domain and services"]
  node_auth["Auth rules and storage"]
  node_domain["Card use cases<br/>[card_usecases.dart]"]
  node_repository["Repository implementation"]
  node_api["API service<br/>[api_service.dart]"]
  node_state["App state<br/>[app_state.dart]"]
end

node_user(("App user"))

node_user -.->|"opens"| node_app
node_app -.->|"starts"| node_shell
node_shell -.->|"routes to"| node_login
node_login -.->|"authenticates"| node_auth
node_shell -.->|"routes to"| node_wallet
node_wallet -.->|"starts"| node_payments
node_wallet -.->|"opens"| node_card
node_card -.->|"scans with"| node_nfc
node_payments -.->|"verifies"| node_payment_result
node_payment_result -.->|"shows result"| node_payment_success
node_shell -.->|"routes to"| node_agent_login
node_agent_login -.->|"authenticates"| node_auth
node_agent_home -.->|"offers actions"| node_agent_card
node_domain -.->|"uses"| node_repository
node_repository -.->|"requests data"| node_api
node_wallet -.->|"reads state"| node_state

click node_app "https://github.com/trio707/bus-pay/blob/main/lib/main.dart"
click node_shell "https://github.com/trio707/bus-pay/blob/main/lib/home_shell.dart"
click node_login "https://github.com/trio707/bus-pay/blob/main/lib/screens/login_screen.dart"
click node_wallet "https://github.com/trio707/bus-pay/blob/main/lib/screens/jihudumie_screen.dart"
click node_payments "https://github.com/trio707/bus-pay/tree/main/lib/screens"
click node_card "https://github.com/trio707/bus-pay/tree/main/lib/screens"
click node_nfc "https://github.com/trio707/bus-pay/blob/main/lib/screens/nfc_scanner_screen.dart"
click node_payment_result "https://github.com/trio707/bus-pay/blob/main/lib/screens/payment_verify_screen.dart"
click node_payment_success "https://github.com/trio707/bus-pay/blob/main/lib/screens/payment_success_screen.dart"
click node_agent_login "https://github.com/trio707/bus-pay/blob/main/lib/screens/agent_login_screen.dart"
click node_agent_home "https://github.com/trio707/bus-pay/blob/main/lib/presentation/agent/agent_home_page.dart"
click node_agent_card "https://github.com/trio707/bus-pay/tree/main/lib/presentation/agent"
click node_auth "https://github.com/trio707/bus-pay/tree/main/lib/auth"
click node_domain "https://github.com/trio707/bus-pay/blob/main/lib/domain/usecases/card_usecases.dart"
click node_repository "https://github.com/trio707/bus-pay/blob/main/lib/data/repositories/repository_impl.dart"
click node_api "https://github.com/trio707/bus-pay/blob/main/lib/services/api_service.dart"
click node_state "https://github.com/trio707/bus-pay/blob/main/lib/state/app_state.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_app,node_shell,node_user toneBlue
class node_login,node_wallet,node_payments,node_card,node_nfc,node_payment_result,node_payment_success toneAmber
class node_agent_login,node_agent_home,node_agent_card toneMint
class node_auth,node_domain,node_repository,node_api,node_state toneRose
```

## Components

### App and navigation

- [App entry](https://github.com/trio707/bus-pay/blob/main/lib/main.dart): `lib/main.dart`
- [Home shell](https://github.com/trio707/bus-pay/blob/main/lib/home_shell.dart): `lib/home_shell.dart`

### Passenger wallet

- [Sign-in](https://github.com/trio707/bus-pay/blob/main/lib/screens/login_screen.dart): `lib/screens/login_screen.dart`
- [Wallet home](https://github.com/trio707/bus-pay/blob/main/lib/screens/jihudumie_screen.dart): `lib/screens/jihudumie_screen.dart`
- [Payments and transfers](https://github.com/trio707/bus-pay/tree/main/lib/screens): `lib/screens`
- [Card management](https://github.com/trio707/bus-pay/tree/main/lib/screens): `lib/screens`
- [NFC scanning](https://github.com/trio707/bus-pay/blob/main/lib/screens/nfc_scanner_screen.dart): `lib/screens/nfc_scanner_screen.dart`
- [Payment verification](https://github.com/trio707/bus-pay/blob/main/lib/screens/payment_verify_screen.dart): `lib/screens/payment_verify_screen.dart`
- [Payment result](https://github.com/trio707/bus-pay/blob/main/lib/screens/payment_success_screen.dart): `lib/screens/payment_success_screen.dart`

### Agent operations

- [Agent sign-in](https://github.com/trio707/bus-pay/blob/main/lib/screens/agent_login_screen.dart): `lib/screens/agent_login_screen.dart`
- [Agent workspace](https://github.com/trio707/bus-pay/blob/main/lib/presentation/agent/agent_home_page.dart): `lib/presentation/agent/agent_home_page.dart`
- [Agent card actions](https://github.com/trio707/bus-pay/tree/main/lib/presentation/agent): `lib/presentation/agent`

### Domain and services

- [Auth rules and storage](https://github.com/trio707/bus-pay/tree/main/lib/auth): `lib/auth`
- [Card use cases](https://github.com/trio707/bus-pay/blob/main/lib/domain/usecases/card_usecases.dart): `lib/domain/usecases/card_usecases.dart`
- [Repository implementation](https://github.com/trio707/bus-pay/blob/main/lib/data/repositories/repository_impl.dart): `lib/data/repositories/repository_impl.dart`
- [API service](https://github.com/trio707/bus-pay/blob/main/lib/services/api_service.dart): `lib/services/api_service.dart`
- [App state](https://github.com/trio707/bus-pay/blob/main/lib/state/app_state.dart): `lib/state/app_state.dart`

### Other components

- **App user**

## Connections

- App user → App entry: opens
- App entry → Home shell: starts
- Home shell → Sign-in: routes to
- Sign-in → Auth rules and storage: authenticates
- Home shell → Wallet home: routes to
- Wallet home → Payments and transfers: starts
- Wallet home → Card management: opens
- Card management → NFC scanning: scans with
- Payments and transfers → Payment verification: verifies
- Payment verification → Payment result: shows result
- Home shell → Agent sign-in: routes to
- Agent sign-in → Auth rules and storage: authenticates
- Agent workspace → Agent card actions: offers actions
- Card use cases → Repository implementation: uses
- Repository implementation → API service: requests data
- Wallet home → App state: reads state
