Skip to content

Uber-like driver dispatcher, with ETAs and trip state management

License

Notifications You must be signed in to change notification settings

fameoflight/InstacabDispatcher

 
 

Repository files navigation

Welcome to Instacab Dispatcher

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.

How Does It Work

  • 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.

Requirements

  • Node.js 0.10.x
  • Redis 2.8
  • MongoDB
  • RabbitMQ

Client API Interface

  • TODO

Driver API Interface

  • TODO

Getting Started

  1. Checkout Dispatcher source at the command prompt if you haven't yet:

     git checkout https://github.com/tisunov/InstacabDispatcher
    
  2. At the command prompt, install required npm packages:

     npm install
    
  3. Install and start RabbitMQ

  4. Start Instacab Dispatcher

     node app.js
    
  5. Start Instacab Backend

Setting Up Instacab Backend

Please refer to Instacab Backend

Instacab iPhone Client App

Please refer to Instacab Client

Known Bugs

  • Memory footprint keeps growing while running in production, node.js memory leak detection tools yielded no results so far.

TODO

  • 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

About

Uber-like driver dispatcher, with ETAs and trip state management

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.5%
  • Ruby 6.3%
  • Shell 0.2%