How buvan45/ambulance-route-optimization-problem works
Trailz is an ambulance dispatch and live-navigation system. A dispatcher signs in, submits a patient location and required specialty, and receives a selected ambulance and hospital; the driver gets the job, shares GPS updates, follows route guidance, and completes the mission, which is logged for history and administration. The frontend also provides fleet, hospital, and dispatch analytics. The backend and key UI interactions are excerpted; several screens are represented from the SOURCE INDEX and README, so their internal behavior and some connections are not asserted.
Main entry points: app.py Dispatch API and Events · App.jsx App Routes · AmbulanceDispatch.jsx Dispatch Request · DriverStandby.jsx Driver Standby
Components 23
Access and Routing
- App Routes
frontend/Trailz-react/src/App.jsx - Dispatcher Access
frontend/Trailz-react/src/Dispatcher.jsx - Login
frontend/Trailz-react/src/Login.jsx - Signup
frontend/Trailz-react/src/Signup.jsx - API Base
frontend/Trailz-react/src/api.js
Dispatch Operations
- Dispatcher Dashboard
frontend/Trailz-react/src/Dashboard.jsx - Dispatch Request
frontend/Trailz-react/src/AmbulanceDispatch.jsx - Dispatch History
frontend/Trailz-react/src/History.jsx
Driver Navigation
- Driver Standby
frontend/Trailz-react/src/DriverStandby.jsx - Live Driver View
frontend/Trailz-react/src/DriverView.jsx - Live Map
frontend/Trailz-react/src/LeafletMap.jsx - Socket Client
frontend/Trailz-react/src/socket.js
Administration
- Admin Entry
frontend/Trailz-react/src/Admin.jsx - Admin Login
frontend/Trailz-react/src/AdminLogin.jsx - Admin Dashboard
frontend/Trailz-react/src/AdminDashboard.jsx
Backend Services
- Dispatch API and Events
backend/app.py - Authentication and Admin API
backend/auth.py - Database Collections
backend/db.py
Other components
- Dispatcher
- Ambulance Driver
- Administrator
- TomTom Routing
- MongoDB
Connections 35
- Dispatcher → App Routes: opens app
README.md - App Routes → Dispatcher Access: defaults to
frontend/Trailz-react/src/App.jsx - App Routes → Driver Standby: routes to
frontend/Trailz-react/src/App.jsx - App Routes → Live Driver View: routes to
frontend/Trailz-react/src/App.jsx - App Routes → Admin Entry: routes to
frontend/Trailz-react/src/App.jsx - Dispatcher Access → Login: renders
frontend/Trailz-react/src/Dispatcher.jsx - Dispatcher Access → Signup: renders
frontend/Trailz-react/src/Dispatcher.jsx - Dispatcher Access → Dispatcher Dashboard: renders
frontend/Trailz-react/src/Dispatcher.jsx - Dispatcher Dashboard → Dispatch Request: renders
frontend/Trailz-react/src/Dashboard.jsx - Dispatcher Dashboard → Dispatch History: renders
frontend/Trailz-react/src/Dashboard.jsx - Dispatch Request → Dispatch API and Events: requests route
frontend/Trailz-react/src/AmbulanceDispatch.jsx - Dispatch Request → Socket Client: joins dispatch room
frontend/Trailz-react/src/AmbulanceDispatch.jsx - Socket Client → Dispatch API and Events: exchanges events
backend/app.py - Ambulance Driver → Driver Standby: opens standby
README.md - Driver Standby → Socket Client: joins unit room
frontend/Trailz-react/src/DriverStandby.jsx - Driver Standby → Live Driver View: opens dispatch
frontend/Trailz-react/src/DriverStandby.jsx - Live Driver View → Socket Client: sends GPS and actions
frontend/Trailz-react/src/DriverView.jsx - Live Driver View → Live Map: renders route
frontend/Trailz-react/src/DriverView.jsx - Dispatch Request → Live Map: renders tracking map
frontend/Trailz-react/src/AmbulanceDispatch.jsx - Administrator → App Routes: opens admin
README.md - Admin Entry → Admin Login: renders
frontend/Trailz-react/src/Admin.jsx - Admin Entry → Admin Dashboard: renders
frontend/Trailz-react/src/Admin.jsx - Admin Dashboard → Dispatch API and Events: fetches operations data
frontend/Trailz-react/src/AdminDashboard.jsx - Login → API Base: uses API base
frontend/Trailz-react/src/Login.jsx - Signup → API Base: uses API base
frontend/Trailz-react/src/Signup.jsx - Dispatch History → API Base: uses API base
frontend/Trailz-react/src/History.jsx - Admin Dashboard → API Base: uses API base
frontend/Trailz-react/src/AdminDashboard.jsx - Dispatch API and Events → Authentication and Admin API: registers blueprints
backend/app.py - Authentication and Admin API → Database Collections: reads and writes
backend/auth.py - Dispatch API and Events → Database Collections: queries and updates
backend/app.py - Database Collections → MongoDB: stores collections
backend/db.py - Dispatch API and Events → TomTom Routing: geocodes and routes
backend/app.py - Dispatch API and Events → Dispatch Request: returns dispatch result
frontend/Trailz-react/src/AmbulanceDispatch.jsx - Dispatch API and Events → Live Driver View: sends route updates
backend/app.py - Dispatch API and Events → Driver Standby: notifies pending job
backend/app.py