A real-time ride-hailing platform demonstrating backend dispatch logic with WebSocket-based communication, asynchronous job processing, and geospatial queries.
This system implements core ride-hailing functionality similar to Uber/Lyft, featuring:
- Backend (PHP 8.4): WebSocket server, command queue worker, PostGIS-powered driver matching, and Redis pub/sub event system
- Passenger UI (Angular 20): Request rides, get fare quotes, track ride status in real-time
- Driver UI (Angular 20): Receive ride requests, accept/reject rides, manage availability and location
- 🚗 Smart Dispatch: Automatically assigns closest available driver using PostGIS geospatial queries
- ⚡ Real-time Updates: WebSocket connections provide instant bidirectional communication
- 🔄 Asynchronous Processing: Command queue handles ride dispatching without blocking
- 🗺️ Location-based Matching: Efficient distance calculations with PostGIS
- 🔁 Retry Logic: Automatically finds alternative drivers if rides are rejected
backend/- PHP backend with WebSocket server, worker processes, and PostgreSQL databasedriver-ui/- Angular application for drivers to manage rides and availabilitypassenger-ui/- Angular application for passengers to request and track rides
Start all services together from the root directory:
docker-compose upThis will start:
- Backend services (PostgreSQL, Redis, WebSocket server, Queue worker)
- Passenger UI at http://localhost:4201
- Driver UI at http://localhost:4202
To run in detached mode:
docker-compose up -dTo stop all services:
docker-compose down -vFor detailed setup instructions, configuration options, and troubleshooting, refer to: