# adityagarwal15/bugease architecture

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

- Interactive diagram: https://gitdiagram.com/adityagarwal15/bugease
- Repository: https://github.com/adityagarwal15/bugease

## Overview

Campus Buggy Tracker is a student-and-driver campus transport web app. Students authenticate, view buggy availability and follow live vehicle locations; drivers authenticate, set running status and share GPS updates. The frontend routes role-specific pages and uses REST and WebSocket services, while Django provides user and tracking APIs. The README also describes booking, history, alerts and analytics, though it labels some capabilities planned; those areas are shown as product surfaces without assuming they are fully operational. Evidence for unsampled page internals and several backend routes is limited.

Main entry points: [`frontend/src/App.tsx`](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/App.tsx) (Route application), [`frontend/src/pages/TrackingMap.tsx`](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/TrackingMap.tsx) (Tracking map), [`backend/campusbuggy/tracking/consumers.py`](https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/tracking/consumers.py) (Location consumer), [`frontend/src/pages/Dashboard.tsx`](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/Dashboard.tsx) (Student views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route application<br/>[App.tsx]"]
  node_student_views["Student views<br/>[Dashboard.tsx]"]
  node_driver_views["Driver views<br/>[Dashboard.tsx]"]
  node_map_view["Tracking map<br/>[TrackingMap.tsx]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth_ui["Login and signup<br/>[Signup.tsx]"]
  node_profile_ui["Profiles<br/>[Profile.tsx]"]
  node_auth_service["Auth service<br/>[authService.ts]"]
end

subgraph group_tracking["Vehicle tracking"]
  node_tracking_service["Tracking service<br/>[trackingService.ts]"]
  node_ws_service["WebSocket service"]
end

subgraph group_transport["Transport features"]
  node_booking["Ride booking<br/>[BookRide.tsx]"]
  node_history["Ride history<br/>[RideHistory.tsx]"]
  node_admin["Admin panel<br/>[AdminPanel.tsx]"]
  node_alerts["Alerts and notices<br/>[Alerts.tsx]"]
  node_analytics["Usage analytics<br/>[UsageStats.tsx]"]
end

subgraph group_backend["Django services"]
  node_user_api["User API views<br/>[views.py]"]
  node_user_serializers["User serializers<br/>[serializers.py]"]
  node_user_model[("User model<br/>[models.py]")]
  node_buggy_api["Tracking REST API<br/>[views.py]"]
  node_buggy_model[("Buggy data<br/>[models.py]")]
  node_ws_routes["WebSocket routing<br/>[routing.py]"]
  node_location_consumer["Location consumer<br/>[consumers.py]"]
end

node_students(("Students"))
node_drivers(("Drivers"))
node_rest_api{{"REST API"}}
node_websocket_server{{"WebSocket server"}}
node_maps{{"Google Maps"}}

node_students -->|"use"| node_app
node_drivers -->|"use"| node_app
node_app -->|"routes"| node_student_views
node_app -->|"routes"| node_driver_views
node_app -->|"routes"| node_map_view
node_app -->|"routes"| node_booking
node_app -->|"routes"| node_history
node_app -->|"routes"| node_admin
node_app -->|"routes"| node_alerts
node_app -->|"routes"| node_analytics
node_students -->|"authenticate"| node_auth_ui
node_drivers -->|"authenticate"| node_auth_ui
node_auth_ui -.->|"uses"| node_auth_service
node_auth_service -->|"HTTP requests"| node_rest_api
node_rest_api -.->|"serves user endpoints"| node_user_api
node_user_api -->|"validates and formats"| node_user_serializers
node_user_serializers -->|"creates and authenticates"| node_user_model
node_students -->|"view availability"| node_student_views
node_student_views -.->|"fetches buggy data"| node_tracking_service
node_map_view -.->|"loads locations"| node_tracking_service
node_tracking_service -->|"HTTP requests"| node_rest_api
node_rest_api -.->|"serves tracking endpoints"| node_buggy_api
node_buggy_api -.->|"reads and updates"| node_buggy_model
node_drivers -->|"share location"| node_driver_views
node_driver_views -.->|"sends location"| node_ws_service
node_ws_service -->|"connects and sends updates"| node_websocket_server
node_websocket_server -.->|"routes connection"| node_ws_routes
node_ws_routes -->|"dispatches"| node_location_consumer
node_location_consumer -->|"updates locations"| node_buggy_model
node_location_consumer -.->|"broadcasts updates"| node_websocket_server
node_map_view -.->|"renders map"| node_maps
node_students -->|"manage profile"| node_profile_ui
node_app -->|"routes"| node_profile_ui

click node_app "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/App.tsx"
click node_student_views "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/Dashboard.tsx"
click node_driver_views "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/driver/Dashboard.tsx"
click node_map_view "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/TrackingMap.tsx"
click node_booking "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/BookRide.tsx"
click node_history "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/RideHistory.tsx"
click node_admin "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/AdminPanel.tsx"
click node_alerts "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/Alerts.tsx"
click node_analytics "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/UsageStats.tsx"
click node_auth_ui "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/Signup.tsx"
click node_profile_ui "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/Profile.tsx"
click node_auth_service "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/services/authService.ts"
click node_user_api "https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/users/views.py"
click node_user_serializers "https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/users/serializers.py"
click node_user_model "https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/users/models.py"
click node_buggy_api "https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/tracking/views.py"
click node_buggy_model "https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/tracking/models.py"
click node_tracking_service "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/services/trackingService.ts"
click node_ws_service "https://github.com/adityagarwal15/bugease/blob/main/frontend/src/services/websocketService.ts"
click node_ws_routes "https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/tracking/routing.py"
click node_location_consumer "https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/tracking/consumers.py"

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_student_views,node_driver_views,node_map_view toneBlue
class node_auth_ui,node_profile_ui,node_auth_service toneAmber
class node_tracking_service,node_ws_service,node_rest_api,node_websocket_server toneMint
class node_booking,node_history,node_admin,node_alerts,node_analytics toneRose
class node_user_api,node_user_serializers,node_user_model,node_buggy_api,node_buggy_model,node_ws_routes,node_location_consumer,node_students,node_drivers,node_maps toneIndigo
```

## Components

### Web client

- [Route application](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Student views](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Driver views](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/driver/Dashboard.tsx): `frontend/src/pages/driver/Dashboard.tsx`
- [Tracking map](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/TrackingMap.tsx): `frontend/src/pages/TrackingMap.tsx`

### Identity and profiles

- [Login and signup](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/Signup.tsx): `frontend/src/pages/Signup.tsx`
- [Profiles](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/Profile.tsx): `frontend/src/pages/Profile.tsx`
- [Auth service](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/services/authService.ts): `frontend/src/services/authService.ts`

### Vehicle tracking

- [Tracking service](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/services/trackingService.ts): `frontend/src/services/trackingService.ts`
- [WebSocket service](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/services/websocketService.ts): `frontend/src/services/websocketService.ts`

### Transport features

- [Ride booking](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/BookRide.tsx): `frontend/src/pages/BookRide.tsx`
- [Ride history](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/RideHistory.tsx): `frontend/src/pages/RideHistory.tsx`
- [Admin panel](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/AdminPanel.tsx): `frontend/src/pages/AdminPanel.tsx`
- [Alerts and notices](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/Alerts.tsx): `frontend/src/pages/Alerts.tsx`
- [Usage analytics](https://github.com/adityagarwal15/bugease/blob/main/frontend/src/pages/UsageStats.tsx): `frontend/src/pages/UsageStats.tsx`

### Django services

- [User API views](https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/users/views.py): `backend/campusbuggy/users/views.py`
- [User serializers](https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/users/serializers.py): `backend/campusbuggy/users/serializers.py`
- [User model](https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/users/models.py): `backend/campusbuggy/users/models.py`
- [Tracking REST API](https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/tracking/views.py): `backend/campusbuggy/tracking/views.py`
- [Buggy data](https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/tracking/models.py): `backend/campusbuggy/tracking/models.py`
- [WebSocket routing](https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/tracking/routing.py): `backend/campusbuggy/tracking/routing.py`
- [Location consumer](https://github.com/adityagarwal15/bugease/blob/main/backend/campusbuggy/tracking/consumers.py): `backend/campusbuggy/tracking/consumers.py`

### Other components

- **Students**
- **Drivers**
- **REST API**
- **WebSocket server**
- **Google Maps**

## Connections

- Students → Route application: use
- Drivers → Route application: use
- Route application → Student views: routes (evidence: `frontend/src/App.tsx`)
- Route application → Driver views: routes (evidence: `frontend/src/App.tsx`)
- Route application → Tracking map: routes (evidence: `frontend/src/App.tsx`)
- Route application → Ride booking: routes (evidence: `frontend/src/App.tsx`)
- Route application → Ride history: routes (evidence: `frontend/src/App.tsx`)
- Route application → Admin panel: routes (evidence: `frontend/src/App.tsx`)
- Route application → Alerts and notices: routes (evidence: `frontend/src/App.tsx`)
- Route application → Usage analytics: routes (evidence: `frontend/src/App.tsx`)
- Students → Login and signup: authenticate
- Drivers → Login and signup: authenticate
- Login and signup → Auth service: uses
- Auth service → REST API: HTTP requests (evidence: `frontend/src/services/authService.ts`)
- REST API → User API views: serves user endpoints
- User API views → User serializers: validates and formats (evidence: `backend/campusbuggy/users/views.py`)
- User serializers → User model: creates and authenticates (evidence: `backend/campusbuggy/users/serializers.py`)
- Students → Student views: view availability
- Student views → Tracking service: fetches buggy data
- Tracking map → Tracking service: loads locations
- Tracking service → REST API: HTTP requests (evidence: `frontend/src/services/trackingService.ts`)
- REST API → Tracking REST API: serves tracking endpoints
- Tracking REST API → Buggy data: reads and updates
- Drivers → Driver views: share location
- Driver views → WebSocket service: sends location
- WebSocket service → WebSocket server: connects and sends updates (evidence: `frontend/src/services/websocketService.ts`)
- WebSocket server → WebSocket routing: routes connection
- WebSocket routing → Location consumer: dispatches (evidence: `backend/campusbuggy/tracking/routing.py`)
- Location consumer → Buggy data: updates locations (evidence: `backend/campusbuggy/tracking/consumers.py`)
- Location consumer → WebSocket server: broadcasts updates
- Tracking map → Google Maps: renders map
- Students → Profiles: manage profile
- Route application → Profiles: routes (evidence: `frontend/src/App.tsx`)
