# ruk692004/bus_b_user architecture

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

- Interactive diagram: https://gitdiagram.com/ruk692004/bus_b_user
- Repository: https://github.com/ruk692004/bus_b_user

## Overview

#### Purpose and Entry Points
This is a cross-platform Flutter bus-route application. Its Dart application entry point is `flutter_app/lib/main.dart`; it initializes the app and Firebase configuration from `flutter_app/lib/firebase_options.dart`. Native launch hosts exist for Android (`flutter_app/android/app/src/main/kotlin/com/example/flutter_app/MainActivity.kt`), iOS (`flutter_app/ios/Runner/AppDelegate.swift`), desktop, and web (`flutter_app/web/index.html`).

#### Application Shell and Navigation
`flutter_app/lib/main.dart` is the composition boundary for Flutter initialization, global app styling, and screen flow. The UI is organized as independently rendered screens rather than a separate domain/service layer: introductory, authentication, search, route-detail, and settings experiences live under `flutter_app/lib/screens/`.

#### Onboarding and Authentication Flow
The user-facing entry sequence is represented by `flutter_app/lib/screens/intro_screen.dart`, followed by login and registration views in `flutter_app/lib/screens/login_screen.dart` and `flutter_app/lib/screens/sign_up_screen.dart`. Firebase project configuration is committed for Android through `flutter_app/android/app/google-services.json` and Flutter through `flutter_app/lib/firebase_options.dart`; the exact Firebase products used are not evident from the tree.

#### Bus Search and Route Details
The core product flow starts at `flutter_app/lib/screens/bus_search_screen.dart`: user search/select actions should produce bus or route data for the route-detail view at `flutter_app/lib/screens/bus_route_details_screen.dart`. `flutter_app/lib/models/bus_info.dart` is the principal shared data contract between these presentation stages, limiting route/bus data coupling to a model boundary.

#### Maps and Platform Capability Boundary
Route presentation can conditionally depend on Google Maps availability. `flutter_app/lib/utils/google_maps_availability.dart` supplies the shared interface, with platform-specific resolution in `flutter_app/lib/utils/google_maps_availability_web.dart` and `flutter_app/lib/utils/google_maps_availability_stub.dart`. This isolates web compatibility from map-capable targets rather than requiring every screen to contain platform checks.

#### Settings and Supporting UI
`flutter_app/lib/screens/settings_screen.dart` provides a separate settings surface. Image resources are centrally reserved under `flutter_app/assets/images`; no backend, API-client, persistence, or state-management directories are present, so data retrieval and mutable UI state likely remain within screen-level implementations.

#### Runtime and Delivery Surface
Flutter/Dart is the primary runtime, targeting Android, iOS, web, Linux, macOS, and Windows. Android uses Gradle (`flutter_app/android/app/build.gradle.kts`); iOS/macOS use Xcode projects; Linux/Windows use CMake. Firebase deployment metadata is present in `flutter_app/firebase.json`, while Google Maps is the other identifiable external integration.

Main entry points: [`flutter_app/lib/main.dart`](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/main.dart) (App shell), [`flutter_app/lib/screens/bus_search_screen.dart`](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/bus_search_screen.dart) (Bus search), [`flutter_app/lib/screens/bus_route_details_screen.dart`](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/bus_route_details_screen.dart) (Route details), [`flutter_app/lib/utils/google_maps_availability.dart`](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/utils/google_maps_availability.dart) (Maps availability)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flutter["Flutter application"]
  node_main["App shell<br/>Flutter entry point<br/>[main.dart]"]
  node_intro["Introduction<br/>screen<br/>[intro_screen.dart]"]
  node_login["Login<br/>screen<br/>[login_screen.dart]"]
  node_signup["Registration<br/>screen"]
  node_search["Bus search<br/>screen"]
  node_route_details["Route details<br/>screen"]
  node_bus_info["Bus info<br/>shared model<br/>[bus_info.dart]"]
  node_settings["Settings<br/>screen"]
end

subgraph group_integration["Platform integrations"]
  node_firebase_options["Firebase options<br/>Flutter config"]
  node_map_availability{{"Maps availability<br/>platform interface"}}
  node_map_web["Web maps resolver<br/>web implementation"]
  node_map_stub["Fallback maps resolver<br/>platform implementation"]
  node_firebase(("Firebase project<br/>external platform"))
  node_android_firebase["Android Firebase config<br/>native config"]
  node_firebase_deploy["Firebase deployment<br/>deployment metadata<br/>[firebase.json]"]
end

subgraph group_native["Runtime hosts"]
  node_android_host["Android host<br/>native launcher<br/>[MainActivity.kt]"]
  node_web_host["Web host<br/>web launcher<br/>[index.html]"]
  node_ios_host["iOS host<br/>native launcher<br/>[AppDelegate.swift]"]
  node_desktop_hosts["Desktop hosts<br/>native launchers"]
  node_android_build["Android build<br/>Gradle build<br/>[build.gradle.kts]"]
end

node_android_host -->|"launches"| node_main
node_web_host -->|"hosts"| node_main
node_ios_host -->|"launches"| node_main
node_desktop_hosts -->|"launch"| node_main
node_main -->|"initializes with"| node_firebase_options
node_firebase_options -->|"configures"| node_firebase
node_android_firebase -->|"configures"| node_firebase
node_firebase_deploy -->|"deployment metadata"| node_firebase
node_android_build -->|"builds"| node_android_host
node_main -->|"starts flow"| node_intro
node_intro -->|"continues to"| node_login
node_login -->|"offers"| node_signup
node_main -->|"renders"| node_search
node_main -->|"renders"| node_settings
node_search -->|"uses"| node_bus_info
node_search -->|"opens"| node_route_details
node_route_details -->|"displays"| node_bus_info
node_route_details -->|"checks"| node_map_availability
node_map_availability -.->|"web resolution"| node_map_web
node_map_availability -.->|"fallback resolution"| node_map_stub

click node_main "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/main.dart"
click node_firebase_options "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/firebase_options.dart"
click node_intro "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/intro_screen.dart"
click node_login "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/login_screen.dart"
click node_signup "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/sign_up_screen.dart"
click node_search "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/bus_search_screen.dart"
click node_route_details "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/bus_route_details_screen.dart"
click node_bus_info "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/models/bus_info.dart"
click node_settings "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/settings_screen.dart"
click node_map_availability "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/utils/google_maps_availability.dart"
click node_map_web "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/utils/google_maps_availability_web.dart"
click node_map_stub "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/utils/google_maps_availability_stub.dart"
click node_android_firebase "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/android/app/google-services.json"
click node_android_host "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/android/app/src/main/kotlin/com/example/flutter_app/MainActivity.kt"
click node_web_host "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/web/index.html"
click node_ios_host "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/ios/Runner/AppDelegate.swift"
click node_android_build "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/android/app/build.gradle.kts"
click node_firebase_deploy "https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/firebase.json"

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_main,node_intro,node_login,node_signup,node_search,node_route_details,node_bus_info,node_settings toneBlue
class node_firebase_options,node_map_availability,node_map_web,node_map_stub,node_firebase,node_android_firebase,node_firebase_deploy toneAmber
class node_android_host,node_web_host,node_ios_host,node_desktop_hosts,node_android_build toneMint
```

## Components

### Flutter application

- [App shell](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/main.dart): Flutter entry point · Composes initialization, styling, and screen flow. · `flutter_app/lib/main.dart`
- [Introduction](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/intro_screen.dart): screen · `flutter_app/lib/screens/intro_screen.dart`
- [Login](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/login_screen.dart): screen · `flutter_app/lib/screens/login_screen.dart`
- [Registration](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/sign_up_screen.dart): screen · `flutter_app/lib/screens/sign_up_screen.dart`
- [Bus search](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/bus_search_screen.dart): screen · Primary route and bus selection experience. · `flutter_app/lib/screens/bus_search_screen.dart`
- [Route details](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/bus_route_details_screen.dart): screen · `flutter_app/lib/screens/bus_route_details_screen.dart`
- [Bus info](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/models/bus_info.dart): shared model · Shared route and bus data contract. · `flutter_app/lib/models/bus_info.dart`
- [Settings](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/screens/settings_screen.dart): screen · `flutter_app/lib/screens/settings_screen.dart`

### Platform integrations

- [Firebase options](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/firebase_options.dart): Flutter config · `flutter_app/lib/firebase_options.dart`
- [Maps availability](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/utils/google_maps_availability.dart): platform interface · Isolates map capability checks from screens. · `flutter_app/lib/utils/google_maps_availability.dart`
- [Web maps resolver](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/utils/google_maps_availability_web.dart): web implementation · `flutter_app/lib/utils/google_maps_availability_web.dart`
- [Fallback maps resolver](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/lib/utils/google_maps_availability_stub.dart): platform implementation · `flutter_app/lib/utils/google_maps_availability_stub.dart`
- **Firebase project**: external platform · Configured Firebase products are not evident.
- [Android Firebase config](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/android/app/google-services.json): native config · `flutter_app/android/app/google-services.json`
- [Firebase deployment](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/firebase.json): deployment metadata · `flutter_app/firebase.json`

### Runtime hosts

- [Android host](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/android/app/src/main/kotlin/com/example/flutter_app/MainActivity.kt): native launcher · `flutter_app/android/app/src/main/kotlin/com/example/flutter_app/MainActivity.kt`
- [Web host](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/web/index.html): web launcher · `flutter_app/web/index.html`
- [iOS host](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/ios/Runner/AppDelegate.swift): native launcher · `flutter_app/ios/Runner/AppDelegate.swift`
- **Desktop hosts**: native launchers · Linux, macOS, and Windows targets.
- [Android build](https://github.com/ruk692004/bus_b_user/blob/main/flutter_app/android/app/build.gradle.kts): Gradle build · `flutter_app/android/app/build.gradle.kts`

## Connections

- Android host → App shell: launches
- Web host → App shell: hosts
- iOS host → App shell: launches
- Desktop hosts → App shell: launch
- App shell → Firebase options: initializes with
- Firebase options → Firebase project: configures
- Android Firebase config → Firebase project: configures
- Firebase deployment → Firebase project: deployment metadata
- Android build → Android host: builds
- App shell → Introduction: starts flow
- Introduction → Login: continues to
- Login → Registration: offers
- App shell → Bus search: renders
- App shell → Settings: renders
- Bus search → Bus info: uses
- Bus search → Route details: opens
- Route details → Bus info: displays
- Route details → Maps availability: checks
- Maps availability → Web maps resolver: web resolution
- Maps availability → Fallback maps resolver: fallback resolution
