How sujaldhiman/real-time-bus-tracking-system works
This is a real-time bus tracking application: drivers register and log in, publish location and passenger-count updates, and riders find active buses and follow their route on a map. Backend endpoints serve bus, route, and feedback data; Socket.io carries live updates and panic alerts. The README also describes an NLP/ML chatbot, but no chatbot implementation appears in the supplied tree. Edges reflect shown route declarations, calls, or documented capabilities; unsampled relationships are omitted.
Main entry points: main.jsx Application routes · busRoute.js Bus API routes · TrackVechicle.jsx Track bus · SendLocation.jsx Send location
Components 26
Rider experience
- Application routes
frontend/busApp/src/main.jsx - Choose user type
frontend/busApp/src/TypeOfUser.jsx - Find active buses
frontend/busApp/src/User/LookupVehicles/LookupVehicles.jsx - Track bus
frontend/busApp/src/User/TrackVechicle/TrackVechicle.jsx - Submit feedback
frontend/busApp/src/Feedback/Feedback.jsx - NLP chatbot
Driver operations
- Register driver
frontend/busApp/src/Driver/RegisterDriver/RegisterDriver.jsx - Driver login
frontend/busApp/src/Driver/LoginDriver/LoginDriver.jsx - Bus dashboard
frontend/busApp/src/Driver/BusDashboard/BusDashboard.jsx - Set bus status
frontend/busApp/src/Driver/BusStatus/BusStatus.jsx - Send location
frontend/busApp/src/Driver/SendLocation/SendLocation.jsx - Page state
frontend/busApp/src/Context/PageContext.jsx - Shared UI assets
frontend/busApp/src/Context/Assets.jsx
Backend services
- Bus API routes
backend/router/busRoute.js - Bus and feedback logic
backend/controllers/busController.js - Bus route station feedback models
backend/model - HTTP and socket server
backend/app.js - Database connection
backend/Database/db.js
State and integrations
- Socket client context
frontend/busApp/src/Context/SocketContext.jsx - Location cache
backend/Cache/cache.js - Image storage
backend/cloudStorage.js - Google Maps
- SOS mail service
- API and map config
frontend/busApp/src/Constants/config.js
Other components
- Rider
- Bus driver
Connections 32
- Rider → Application routes: opens
frontend/busApp/src/main.jsx - Bus driver → Application routes: opens
frontend/busApp/src/main.jsx - Application routes → Choose user type: routes to
frontend/busApp/src/main.jsx - Application routes → Register driver: routes to
frontend/busApp/src/main.jsx - Application routes → Driver login: routes to
frontend/busApp/src/main.jsx - Application routes → Bus dashboard: routes to
frontend/busApp/src/main.jsx - Application routes → Set bus status: routes to
frontend/busApp/src/main.jsx - Application routes → Send location: routes to
frontend/busApp/src/main.jsx - Application routes → Find active buses: routes to
frontend/busApp/src/main.jsx - Application routes → Track bus: routes to
frontend/busApp/src/main.jsx - Application routes → Submit feedback: routes to
frontend/busApp/src/main.jsx - Find active buses → Bus API routes: requests buses
- Track bus → Bus API routes: fetches bus details
frontend/busApp/src/User/TrackVechicle/TrackVechicle.jsx - Track bus → Socket client context: subscribes updates
frontend/busApp/src/User/TrackVechicle/TrackVechicle.jsx - Track bus → Google Maps: renders route
README.md - Track bus → SOS mail service: sends SOS
frontend/busApp/src/User/TrackVechicle/TrackVechicle.jsx - Submit feedback → Bus API routes: submits feedback
- Register driver → Bus API routes: registers driver
- Driver login → Bus API routes: authenticates
- Send location → Bus API routes: fetches route
frontend/busApp/src/Driver/SendLocation/SendLocation.jsx - Send location → Socket client context: emits location
frontend/busApp/src/Driver/SendLocation/SendLocation.jsx - Send location → Google Maps: uses directions
frontend/busApp/src/Driver/SendLocation/SendLocation.jsx - Register driver → Image storage: uploads image
- Bus API routes → Bus and feedback logic: dispatches handlers
backend/router/busRoute.js - Bus and feedback logic → Bus route station feedback models: reads and writes
backend/controllers/busController.js - Bus and feedback logic → Location cache: reads progress
backend/controllers/busController.js - Bus and feedback logic → Image storage: uploads image
backend/controllers/busController.js - HTTP and socket server → Bus API routes: mounts routes
backend/app.js - HTTP and socket server → Location cache: stores locations
backend/app.js - Database connection → HTTP and socket server: connects before serving
backend/server.js - Socket client context → API and map config: connects to server
frontend/busApp/src/Context/SocketContext.jsx - NLP chatbot → Rider: answers queries
README.md