Instacab Dispatcher is a Node.js app which coordinates drivers and clients, dispatches ride requests to nearest drivers, keeps GPS logs, provides API via WebSockets for client and driver apps, provides ETA using Google Distance Matrix, provides REST API for God View
interface to display all clients, drivers and trips in real-time on the map.
- Listens port 9000 for API WebSocket connections
- Waits for AMQP (RabbitMQ) messages from Instacab Backend to update city vehicle options availability
- All client and driver state is kept in memory with Redis as storage between restarts.
- Node.js 0.10.x
- Redis 2.8
- MongoDB
- RabbitMQ
- TODO
- TODO
-
Checkout Dispatcher source at the command prompt if you haven't yet:
git checkout https://github.com/tisunov/InstacabDispatcher
-
At the command prompt, install required npm packages:
npm install
-
Install and start RabbitMQ
-
Start Instacab Dispatcher
node app.js
-
Start Instacab Backend
Please refer to Instacab Backend
Please refer to Instacab Client
- Memory footprint keeps growing while running in production, node.js memory leak detection tools yielded no results so far.
- Write unit tests
- Translate Russian strings
- Consider ditching WebSockets in favor REST API, we are updating whole app state anyways.
- Use AMQP to communicate with backend instead HTTP
- Use winston for logging