# yashkacholiya/bus-pass-management architecture

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

- Interactive diagram: https://gitdiagram.com/yashkacholiya/bus-pass-management
- Repository: https://github.com/yashkacholiya/bus-pass-management

## Overview

ICEM Smart Bus Pass is a Flutter/Firebase system for applying for, paying for, approving, and verifying college bus passes. The student path proceeds from sign-in and application through payment and administrator review to an active QR pass; staff can then verify that pass. The README documents the admin console, fleet management, reports, notifications, and personalization. Source excerpts are limited to platform runners, so most Flutter relationships below reflect README documentation rather than inspected implementation; the Cloud Functions client wiring is explicitly described as planned.

Main entry points: [`lib/features/student/presentation/views`](https://github.com/yashkacholiya/bus-pass-management/tree/main/lib/features/student/presentation/views) (Student dashboard and history), [`lib/main.dart`](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/main.dart) (Flutter app entry), [`lib/features/payment/presentation/views/student_payment_screen.dart`](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/payment/presentation/views/student_payment_screen.dart) (Payment and receipts), [`functions/index.js`](https://github.com/yashkacholiya/bus-pass-management/blob/main/functions/index.js) (Payment verification functions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and app access"]
  node_app["Flutter app entry<br/>[main.dart]"]
  node_auth["Sign-in and registration"]
  node_routing["Role-gated routes<br/>[app_routes.dart]"]
  node_preferences["Appearance preferences<br/>[app_theme.dart]"]
end

subgraph group_passes["Pass lifecycle"]
  node_student_views["Student dashboard and history"]
  node_application["Pass application"]
  node_payment["Payment and receipts"]
  node_pass_views["Pass detail and QR"]
end

subgraph group_operations["Transport operations"]
  node_admin_console["Admin console"]
  node_admin_repo["Application approval"]
  node_staff_views["Staff dashboard and scan"]
  node_fleet["Routes, buses, drivers"]
  node_reports["Reports and exports"]
  node_notifications["Targeted notifications"]
end

subgraph group_platform["Services and security"]
  node_functions["Payment verification functions<br/>[index.js]"]
  node_firebase["Firebase services"]
  node_firestore[("Firestore")]
  node_rules["Firestore security rules<br/>[firestore.rules]"]
end

node_student(("Student"))
node_staff(("Staff / conductor"))
node_admin(("Transport admin"))
node_razorpay["Razorpay Checkout"]

node_student -->|"opens"| node_app
node_staff -->|"opens"| node_app
node_admin -->|"opens"| node_app
node_app -->|"starts"| node_auth
node_auth -->|"gates access"| node_routing
node_student -->|"uses"| node_student_views
node_student_views -->|"applies or renews"| node_application
node_application -->|"records application"| node_firestore
node_student_views -->|"pays"| node_payment
node_payment -->|"opens checkout"| node_razorpay
node_payment -->|"records payment"| node_firestore
node_functions -->|"verifies and updates"| node_firestore
node_functions -.->|"handles webhook"| node_razorpay
node_admin -->|"reviews"| node_admin_console
node_admin_console -->|"requests approval"| node_admin_repo
node_admin_repo -->|"checks and issues pass"| node_firestore
node_firestore -->|"streams pass state"| node_student_views
node_staff -->|"scans QR"| node_staff_views
node_staff_views -->|"looks up pass"| node_firestore
node_admin -->|"manages fleet"| node_fleet
node_admin -->|"exports reports"| node_reports
node_admin -->|"composes alerts"| node_notifications
node_student -->|"customizes appearance"| node_preferences
node_preferences -->|"syncs preferences"| node_firestore
node_firebase -.->|"provides access"| node_firestore
node_rules -->|"restricts writes"| node_firestore

click node_app "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/main.dart"
click node_auth "https://github.com/yashkacholiya/bus-pass-management/tree/main/lib/features/auth/presentation/views"
click node_routing "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/config/routes/app_routes.dart"
click node_student_views "https://github.com/yashkacholiya/bus-pass-management/tree/main/lib/features/student/presentation/views"
click node_application "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/bus_pass/presentation/controllers/bus_pass_controller.dart"
click node_payment "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/payment/presentation/views/student_payment_screen.dart"
click node_functions "https://github.com/yashkacholiya/bus-pass-management/blob/main/functions/index.js"
click node_admin_console "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/admin/presentation/views/admin_dashboard.dart"
click node_admin_repo "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/admin/data/repositories/admin_repository.dart"
click node_pass_views "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/bus_pass/presentation/views/qr_verification_screen.dart"
click node_staff_views "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/admin/presentation/views/staff_dashboard.dart"
click node_fleet "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/admin/presentation/views/admin_routes_tab.dart"
click node_reports "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/admin/presentation/views/report_exporter.dart"
click node_notifications "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/notification/data/repositories/notification_repository.dart"
click node_preferences "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/config/theme/app_theme.dart"
click node_firebase "https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/services/firebase/firebase_service.dart"
click node_rules "https://github.com/yashkacholiya/bus-pass-management/blob/main/firestore.rules"

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_auth,node_routing,node_preferences toneBlue
class node_student_views,node_application,node_payment,node_pass_views toneAmber
class node_admin_console,node_admin_repo,node_staff_views,node_fleet,node_reports,node_notifications toneMint
class node_functions,node_firebase,node_firestore,node_rules toneRose
class node_student,node_staff,node_admin,node_razorpay toneIndigo
```

## Components

### Identity and app access

- [Flutter app entry](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/main.dart): `lib/main.dart`
- [Sign-in and registration](https://github.com/yashkacholiya/bus-pass-management/tree/main/lib/features/auth/presentation/views): `lib/features/auth/presentation/views`
- [Role-gated routes](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/config/routes/app_routes.dart): `lib/config/routes/app_routes.dart`
- [Appearance preferences](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/config/theme/app_theme.dart): `lib/config/theme/app_theme.dart`

### Pass lifecycle

- [Student dashboard and history](https://github.com/yashkacholiya/bus-pass-management/tree/main/lib/features/student/presentation/views): `lib/features/student/presentation/views`
- [Pass application](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/bus_pass/presentation/controllers/bus_pass_controller.dart): `lib/features/bus_pass/presentation/controllers/bus_pass_controller.dart`
- [Payment and receipts](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/payment/presentation/views/student_payment_screen.dart): `lib/features/payment/presentation/views/student_payment_screen.dart`
- [Pass detail and QR](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/bus_pass/presentation/views/qr_verification_screen.dart): `lib/features/bus_pass/presentation/views/qr_verification_screen.dart`

### Transport operations

- [Admin console](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/admin/presentation/views/admin_dashboard.dart): `lib/features/admin/presentation/views/admin_dashboard.dart`
- [Application approval](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/admin/data/repositories/admin_repository.dart): `lib/features/admin/data/repositories/admin_repository.dart`
- [Staff dashboard and scan](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/admin/presentation/views/staff_dashboard.dart): `lib/features/admin/presentation/views/staff_dashboard.dart`
- [Routes, buses, drivers](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/admin/presentation/views/admin_routes_tab.dart): `lib/features/admin/presentation/views/admin_routes_tab.dart`
- [Reports and exports](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/admin/presentation/views/report_exporter.dart): `lib/features/admin/presentation/views/report_exporter.dart`
- [Targeted notifications](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/features/notification/data/repositories/notification_repository.dart): `lib/features/notification/data/repositories/notification_repository.dart`

### Services and security

- [Payment verification functions](https://github.com/yashkacholiya/bus-pass-management/blob/main/functions/index.js): `functions/index.js`
- [Firebase services](https://github.com/yashkacholiya/bus-pass-management/blob/main/lib/services/firebase/firebase_service.dart): `lib/services/firebase/firebase_service.dart`
- **Firestore**
- [Firestore security rules](https://github.com/yashkacholiya/bus-pass-management/blob/main/firestore.rules): `firestore.rules`

### Other components

- **Student**
- **Staff / conductor**
- **Transport admin**
- **Razorpay Checkout**

## Connections

- Student → Flutter app entry: opens (evidence: `README.md`)
- Staff / conductor → Flutter app entry: opens (evidence: `README.md`)
- Transport admin → Flutter app entry: opens (evidence: `README.md`)
- Flutter app entry → Sign-in and registration: starts (evidence: `README.md`)
- Sign-in and registration → Role-gated routes: gates access (evidence: `README.md`)
- Student → Student dashboard and history: uses (evidence: `README.md`)
- Student dashboard and history → Pass application: applies or renews (evidence: `README.md`)
- Pass application → Firestore: records application (evidence: `README.md`)
- Student dashboard and history → Payment and receipts: pays (evidence: `README.md`)
- Payment and receipts → Razorpay Checkout: opens checkout (evidence: `README.md`)
- Payment and receipts → Firestore: records payment (evidence: `README.md`)
- Payment verification functions → Firestore: verifies and updates (evidence: `README.md`)
- Payment verification functions → Razorpay Checkout: handles webhook (evidence: `README.md`)
- Transport admin → Admin console: reviews (evidence: `README.md`)
- Admin console → Application approval: requests approval (evidence: `README.md`)
- Application approval → Firestore: checks and issues pass (evidence: `README.md`)
- Firestore → Student dashboard and history: streams pass state (evidence: `README.md`)
- Staff / conductor → Staff dashboard and scan: scans QR (evidence: `README.md`)
- Staff dashboard and scan → Firestore: looks up pass (evidence: `README.md`)
- Transport admin → Routes, buses, drivers: manages fleet (evidence: `README.md`)
- Transport admin → Reports and exports: exports reports (evidence: `README.md`)
- Transport admin → Targeted notifications: composes alerts (evidence: `README.md`)
- Student → Appearance preferences: customizes appearance (evidence: `README.md`)
- Appearance preferences → Firestore: syncs preferences (evidence: `README.md`)
- Firebase services → Firestore: provides access
- Firestore security rules → Firestore: restricts writes (evidence: `README.md`)
