How abhiveeramallu/routefusion works
RouteFusion is a ride-and-parcel dispatch product: riders and senders submit requests, while captains receive an explainable recommendation to accept a ride, parcel, both, or neither. The React app routes role-specific pages through shared client state to a FastAPI JSON API. The captain workflow combines per-driver matching, route optimization, and an atomic acceptance decision; separate fleet-wide assignment analytics feed the dashboard. Authentication, demo seeding, concurrency protection, maps, and optional persistent storage are supporting capabilities. Some route and service implementations were not sampled, so those links are included only where the README or source index documents them.
Main entry points: api.ts REST client · captain.py Captain recommendations · models.py Domain records · App.tsx Page routing
Components 23
React client
- Page routing
frontend/src/App.tsx - Ride and parcel booking
frontend/src/pages/BookingHubPage.tsx - Captain decisions
frontend/src/pages/CaptainCornerPage.tsx - Dashboard view
frontend/src/pages/DashboardPage.tsx - Live map
frontend/src/components/LiveMapCanvas.tsx - Shared app state
frontend/src/context/RouteFusionContext.tsx - REST client
frontend/src/lib/api.ts
API workflows
- Authentication routes
backend/app/routes/auth.py - Ride and parcel routes
backend/app/routes/ride.py - Captain recommendations
backend/app/routes/captain.py - Dashboard analytics
backend/app/routes/dashboard.py - Demo controls
backend/app/routes/demo.py
Dispatch engine
- Assignment engine
backend/app/services/assignment_engine.py - Route optimizer
backend/app/services/route_optimizer.py - Acceptance guard
backend/app/services/concurrency.py
Identity and state
- JWT and identity
backend/app/auth.py - Domain records
backend/app/models.py - SQLAlchemy store
backend/app/database.py - Demo data
backend/app/services/demo_seed.py
Maps and analytics
- Map scenarios
frontend/src/lib/mapScenario.ts - Fleet assignment metrics
backend/app/services/assignment_engine.py - Google Maps integration
frontend/src/lib/googleMaps.ts
Other components
- Rider or captain
Connections 29
- Rider or captain → Page routing: uses
frontend/src/App.tsx - Page routing → Ride and parcel booking: routes to
frontend/src/App.tsx - Page routing → Captain decisions: routes to
frontend/src/App.tsx - Page routing → Dashboard view: routes to
frontend/src/App.tsx - Ride and parcel booking → Shared app state: reads and updates
frontend/src/pages/BookingHubPage.tsx - Captain decisions → Shared app state: reads and updates
- Dashboard view → Shared app state: reads
frontend/src/pages/DashboardPage.tsx - Live map → Google Maps integration: uses
frontend/src/components/LiveMapCanvas.tsx - Live map → Map scenarios: uses
frontend/src/components/LiveMapCanvas.tsx - Shared app state → REST client: calls
frontend/src/context/RouteFusionContext.tsx - REST client → Authentication routes: sends REST requests
- REST client → Ride and parcel routes: sends REST requests
- REST client → Captain recommendations: sends REST requests
- REST client → Dashboard analytics: sends REST requests
- REST client → Demo controls: sends REST requests
- Authentication routes → JWT and identity: authenticates
backend/app/routes/auth.py - Authentication routes → Demo data: seeds demo
backend/app/routes/auth.py - Captain recommendations → Assignment engine: matches driver
backend/app/routes/captain.py - Captain recommendations → Route optimizer: scores route
backend/app/routes/captain.py - Captain recommendations → Acceptance guard: guards acceptance
backend/app/routes/captain.py - Dashboard analytics → Assignment engine: computes fleet metrics
backend/app/routes/dashboard.py - Demo controls → Demo data: manages demo data
backend/app/routes/demo.py - Assignment engine → Domain records: queries records
backend/app/services/assignment_engine.py - Assignment engine → Route optimizer: evaluates routes
backend/app/services/assignment_engine.py - Acceptance guard → Domain records: records conflicts
backend/app/services/concurrency.py - JWT and identity → Domain records: reads and writes identity
backend/app/auth.py - Demo data → Domain records: creates demo records
backend/app/services/demo_seed.py - Domain records → SQLAlchemy store: maps to
backend/app/models.py - Dashboard analytics → Captain recommendations: reuses logic
backend/app/routes/dashboard.py