# yokeshkumar19/bus-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/yokeshkumar19/bus-tracker
- Repository: https://github.com/yokeshkumar19/bus-tracker

## Overview

RIT BusTrack is a bus-tracking and fleet-coordination app with a React client and an Android Capacitor location plugin. Riders can find buses and submit pickup requests; drivers can share trip locations and see student locations; administrators can manage buses and review requests. The sampled UI is concentrated in `src/App.tsx`, while Firestore holds operational records and Supabase supplies live bus-location updates. The README is empty, and excerpts are partial, so this map includes only workflows and connections supported by the tree and sampled code.

Main entry points: [`src/App.tsx`](https://github.com/yokeshkumar19/bus-tracker/blob/main/src/App.tsx) (BusTrack App), [`android/app/src/main/java/com/rit/bustracker/BusLocationService.java`](https://github.com/yokeshkumar19/bus-tracker/blob/main/android/app/src/main/java/com/rit/bustracker/BusLocationService.java) (Background GPS Service), [`src/firestoreService.ts`](https://github.com/yokeshkumar19/bus-tracker/blob/main/src/firestoreService.ts) (Firestore Operations), [`android/app/src/main/java/com/rit/bustracker/BusLocationPlugin.java`](https://github.com/yokeshkumar19/bus-tracker/blob/main/android/app/src/main/java/com/rit/bustracker/BusLocationPlugin.java) (Location Plugin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Rider And Fleet Client"]
  node_app["BusTrack App<br/>[App.tsx]"]
  node_map["Map Display<br/>[App.tsx]"]
end

subgraph group_records["Fleet Records"]
  node_firestore_service["Firestore Operations"]
  node_firebase["Firebase Setup<br/>[firebase.ts]"]
  node_firestore[("Firestore")]
end

subgraph group_tracking["Location Tracking"]
  node_supabase_location["Location Client"]
  node_supabase[("Supabase Location Store")]
end

subgraph group_native["Android Location"]
  node_capacitor["Capacitor Bridge<br/>[MainActivity.java]"]
  node_plugin["Location Plugin"]
  node_service["Background GPS Service"]
end

node_riders(("Riders"))
node_drivers(("Drivers"))
node_admins(("Administrators"))
node_gps(("Android GPS"))

node_riders -->|"find buses, request stops"| node_app
node_drivers -->|"manage trips"| node_app
node_admins -->|"manage fleet, requests"| node_app
node_app -->|"renders locations and routes"| node_map
node_app -->|"calls record operations"| node_firestore_service
node_firestore_service -->|"uses database client"| node_firebase
node_firebase -->|"initializes"| node_firestore
node_firestore_service -->|"reads and writes records"| node_firestore
node_app -->|"subscribes, fallback uploads"| node_supabase_location
node_supabase_location -->|"reads and writes live locations"| node_supabase
node_app -->|"registers native plugin"| node_capacitor
node_capacitor -->|"bridges calls"| node_plugin
node_plugin -->|"starts and stops"| node_service
node_gps -->|"provides location updates"| node_service
node_service -->|"uploads bus locations"| node_supabase
node_service -->|"sends location events"| node_plugin

click node_app "https://github.com/yokeshkumar19/bus-tracker/blob/main/src/App.tsx"
click node_map "https://github.com/yokeshkumar19/bus-tracker/blob/main/src/App.tsx"
click node_firestore_service "https://github.com/yokeshkumar19/bus-tracker/blob/main/src/firestoreService.ts"
click node_firebase "https://github.com/yokeshkumar19/bus-tracker/blob/main/src/firebase.ts"
click node_supabase_location "https://github.com/yokeshkumar19/bus-tracker/blob/main/src/services/supabaseLocation.ts"
click node_capacitor "https://github.com/yokeshkumar19/bus-tracker/blob/main/android/app/src/main/java/com/rit/bustracker/MainActivity.java"
click node_plugin "https://github.com/yokeshkumar19/bus-tracker/blob/main/android/app/src/main/java/com/rit/bustracker/BusLocationPlugin.java"
click node_service "https://github.com/yokeshkumar19/bus-tracker/blob/main/android/app/src/main/java/com/rit/bustracker/BusLocationService.java"

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_map toneBlue
class node_firestore_service,node_firebase,node_firestore toneAmber
class node_supabase_location,node_supabase toneMint
class node_capacitor,node_plugin,node_service toneRose
class node_riders,node_drivers,node_admins,node_gps toneIndigo
```

## Components

### Rider And Fleet Client

- [BusTrack App](https://github.com/yokeshkumar19/bus-tracker/blob/main/src/App.tsx): `src/App.tsx`
- [Map Display](https://github.com/yokeshkumar19/bus-tracker/blob/main/src/App.tsx): `src/App.tsx`

### Fleet Records

- [Firestore Operations](https://github.com/yokeshkumar19/bus-tracker/blob/main/src/firestoreService.ts): `src/firestoreService.ts`
- [Firebase Setup](https://github.com/yokeshkumar19/bus-tracker/blob/main/src/firebase.ts): `src/firebase.ts`
- **Firestore**

### Location Tracking

- [Location Client](https://github.com/yokeshkumar19/bus-tracker/blob/main/src/services/supabaseLocation.ts): `src/services/supabaseLocation.ts`
- **Supabase Location Store**

### Android Location

- [Capacitor Bridge](https://github.com/yokeshkumar19/bus-tracker/blob/main/android/app/src/main/java/com/rit/bustracker/MainActivity.java): `android/app/src/main/java/com/rit/bustracker/MainActivity.java`
- [Location Plugin](https://github.com/yokeshkumar19/bus-tracker/blob/main/android/app/src/main/java/com/rit/bustracker/BusLocationPlugin.java): `android/app/src/main/java/com/rit/bustracker/BusLocationPlugin.java`
- [Background GPS Service](https://github.com/yokeshkumar19/bus-tracker/blob/main/android/app/src/main/java/com/rit/bustracker/BusLocationService.java): `android/app/src/main/java/com/rit/bustracker/BusLocationService.java`

### Other components

- **Riders**
- **Drivers**
- **Administrators**
- **Android GPS**

## Connections

- Riders → BusTrack App: find buses, request stops
- Drivers → BusTrack App: manage trips
- Administrators → BusTrack App: manage fleet, requests
- BusTrack App → Map Display: renders locations and routes
- BusTrack App → Firestore Operations: calls record operations
- Firestore Operations → Firebase Setup: uses database client
- Firebase Setup → Firestore: initializes
- Firestore Operations → Firestore: reads and writes records
- BusTrack App → Location Client: subscribes, fallback uploads
- Location Client → Supabase Location Store: reads and writes live locations
- BusTrack App → Capacitor Bridge: registers native plugin
- Capacitor Bridge → Location Plugin: bridges calls
- Location Plugin → Background GPS Service: starts and stops
- Android GPS → Background GPS Service: provides location updates
- Background GPS Service → Supabase Location Store: uploads bus locations
- Background GPS Service → Location Plugin: sends location events
