How wncc/hello-foss-26_uberclone works
UberClone is a ride-hailing product: riders choose a route and vehicle, book and track a ride; drivers register, accept requests, navigate, start with a PIN, and complete trips. The backend handles accounts, ride operations, dispatch and live updates, supported by matching and a Mumbai-road routing engine. The README documents these user journeys and routing capabilities; several implementation links below rely on that documentation or are left unverified because their source was not sampled.
Main entry points: api.ts HTTP client · main.py FastAPI endpoints · index.tsx Rider booking · rides.py Ride lifecycle
Components 24
Rider and driver apps
- Rider booking
mobile/src/app/rider/index.tsx - Ride tracking
mobile/src/app/rider/ride/[id].tsx - Driver operations
mobile/src/app/driver/index.tsx - Driver trip
mobile/src/app/driver/trip/[id].tsx - App session
mobile/src/lib/session.tsx - HTTP client
mobile/src/lib/api.ts - Live socket
mobile/src/lib/socket.ts - Ride map
mobile/src/components/RideMap.tsx
Backend services
- FastAPI endpoints
backend/app/main.py - OTP authentication
backend/app/api/auth.py - Ride lifecycle
backend/app/services/rides.py - Dispatch loop
backend/app/services/dispatch.py - Fare calculation
backend/app/services/pricing.py - Trip routing service
backend/app/services/routes.py
Driver matching
- Nearby driver matching
matching/engine.py
Road routing
- OSM road import
routing/osm_import.py - Road graph
routing/graph.py - Route engine
routing/engine.py - Routing rules
routing/rule_engine.py - Road and vehicle models
routing/models.py - Traffic telemetry
routing/telemetry.py
Persistence and live state
- Realtime hub
backend/app/services/realtime.py - Application database
backend/app/db.py
Other components
- Rider or driver
Connections 32
- Rider or driver → Rider booking: books ride
- Rider or driver → Driver operations: accepts requests
- Rider booking → App session: uses session
- Driver operations → App session: uses session
- App session → HTTP client: calls
mobile/src/lib/session.tsx - App session → Live socket: configures
mobile/src/lib/session.tsx - Rider booking → Ride map: selects locations
- Rider booking → HTTP client: requests booking
- Driver operations → HTTP client: updates availability
- HTTP client → FastAPI endpoints: HTTP requests
- FastAPI endpoints → OTP authentication: registers routes
backend/app/main.py - FastAPI endpoints → Ride lifecycle: routes ride operations
- FastAPI endpoints → Dispatch loop: starts dispatch
backend/app/main.py - FastAPI endpoints → Realtime hub: configures hub
backend/app/main.py - OTP authentication → Application database: reads and writes
backend/app/api/auth.py - Ride lifecycle → Application database: persists rides
- Ride lifecycle → Fare calculation: calculates fare
backend/app/services/rides.py - Ride lifecycle → Trip routing service: requests estimates
- Dispatch loop → Nearby driver matching: assigns drivers
- Trip routing service → Nearby driver matching: provides pickup ETA
backend/app/services/routes.py - Trip routing service → Route engine: routes trips
backend/app/services/routes.py - Trip routing service → OSM road import: loads road data
backend/app/services/routes.py - OSM road import → Road graph: builds graph
routing/osm_import.py - Route engine → Road graph: searches graph
routing/engine.py - Route engine → Routing rules: evaluates model
routing/engine.py - Routing rules → Road and vehicle models: evaluates edge metadata
routing/rule_engine.py - OSM road import → Road and vehicle models: creates road metadata
routing/osm_import.py - Traffic telemetry → Routing rules: derives overlays
- Live socket → Realtime hub: receives live updates
- Realtime hub → Live socket: sends ride events
- Ride tracking → HTTP client: loads ride
- Driver trip → HTTP client: updates trip