How code84/campusgo works
CampusGo is a role-based campus ride-dispatch platform. Passengers authenticate, request or schedule rides, track dispatch and ride status, pay after driver acceptance, then rate completed rides; drivers manage availability and requests, and admins verify drivers and monitor operations. The frontend routes these workflows to a FastAPI backend, with WebSockets for live events and MongoDB for persistence. The backend is represented as one service because the supplied tree contains a single implementation file; detailed backend route-to-storage internals were not sampled.
Main entry points: App.js Role Router · api.js API Client · SocketContext.jsx WebSocket Provider · PassengerHome.jsx Passenger Ride Booking
Components 22
Identity and App Shell
- Role Router
frontend/src/App.js - Login and Signup
frontend/src/pages/Login.jsx - Registration
frontend/src/pages/Register.jsx - Auth State
frontend/src/lib/AuthContext.jsx - API Client
frontend/src/lib/api.js
Ride Dispatch
- Passenger Ride Booking
frontend/src/pages/PassengerHome.jsx - Driver Dashboard
frontend/src/pages/DriverDashboard.jsx - Driver Request Inbox
frontend/src/pages/DriverInbox.jsx - FastAPI Service
backend/server.py - MongoDB
- Razorpay Checkout
frontend/src/pages/PassengerHome.jsx - Ride History
frontend/src/pages/History.jsx
Live Operations
- Live Map and Routes
frontend/src/components/LiveMap.jsx - WebSocket Provider
frontend/src/lib/SocketContext.jsx - Map Tiles and Routing
- Notification Inbox
frontend/src/pages/Notifications.jsx
Platform Operations
- Admin Dashboard
frontend/src/pages/AdminDashboard.jsx - Driver Analytics
frontend/src/pages/DriverAnalytics.jsx - Profile
frontend/src/pages/Profile.jsx
Other components
- Passenger
- Driver
- Admin
Connections 37
- Passenger → Role Router: opens app
frontend/src/App.js - Driver → Role Router: opens app
frontend/src/App.js - Admin → Role Router: opens app
frontend/src/App.js - Role Router → Login and Signup: routes to
frontend/src/App.js - Role Router → Registration: routes to
frontend/src/App.js - Role Router → Passenger Ride Booking: role-routes to
frontend/src/App.js - Role Router → Driver Dashboard: role-routes to
frontend/src/App.js - Role Router → Driver Request Inbox: role-routes to
frontend/src/App.js - Role Router → Admin Dashboard: role-routes to
frontend/src/App.js - Role Router → Ride History: routes to
frontend/src/App.js - Role Router → Notification Inbox: routes to
frontend/src/App.js - Role Router → Profile: routes to
frontend/src/App.js - Login and Signup → Auth State: authenticates through
frontend/src/lib/AuthContext.jsx - Registration → Auth State: registers through
frontend/src/lib/AuthContext.jsx - Auth State → API Client: sends auth requests
frontend/src/lib/AuthContext.jsx - Passenger Ride Booking → API Client: requests ride APIs
frontend/src/pages/PassengerHome.jsx - Driver Dashboard → API Client: updates ride state
frontend/src/pages/DriverDashboard.jsx - Driver Request Inbox → API Client: handles requests
frontend/src/pages/DriverInbox.jsx - Ride History → API Client: loads history
frontend/src/pages/History.jsx - Admin Dashboard → API Client: loads admin data
frontend/src/pages/AdminDashboard.jsx - Driver Analytics → API Client: loads analytics
frontend/src/pages/DriverAnalytics.jsx - Notification Inbox → API Client: manages notifications
frontend/src/pages/Notifications.jsx - Profile → API Client: loads profile
frontend/src/pages/Profile.jsx - API Client → FastAPI Service: calls REST API
README.md - Passenger Ride Booking → Razorpay Checkout: opens checkout
README.md - Razorpay Checkout → FastAPI Service: submits payment
README.md - FastAPI Service → MongoDB: persists platform data
README.md - Passenger Ride Booking → Live Map and Routes: renders ride map
frontend/src/pages/PassengerHome.jsx - Driver Dashboard → Live Map and Routes: renders ride route
frontend/src/pages/DriverDashboard.jsx - Live Map and Routes → Map Tiles and Routing: loads tiles and routes
frontend/src/components/LiveMap.jsx - WebSocket Provider → API Client: builds WebSocket URL
frontend/src/lib/SocketContext.jsx - WebSocket Provider → FastAPI Service: receives live events
README.md - Passenger Ride Booking → WebSocket Provider: subscribes to updates
frontend/src/pages/PassengerHome.jsx - Driver Dashboard → WebSocket Provider: subscribes to updates
frontend/src/pages/DriverDashboard.jsx - Driver Request Inbox → WebSocket Provider: receives ride events
frontend/src/pages/DriverInbox.jsx - Notification Inbox → WebSocket Provider: receives live updates
frontend/src/pages/Notifications.jsx - FastAPI Service → MongoDB: stores notifications and rides