Git Product home page Git Product logo

apitaxi's Introduction

API Open Data Taxi

API and Backoffice for taxis' operators and local authorities.

Pre-requisites

  • Python 2.7
  • Alembic (for the database migration)
  • Pip
  • Postgresql and postgresql-dev (other databases might work)
  • libspatialindex-dev
  • Rabbit-MQ or redis: To queue asynchronous tasks
  • InfluxDB: To store views of the taxis activity

We also recommend the use of virtualenv

## Initialization ##

Install Python dependencies

Simply run pip install -r requirements.txt to install python dependencies

Edit the database settings

A database has to be created for this project. The default settings file default_settings.py should then be edited accordingly (SQLALCHEMY_DATABASE_URI field) and renamed dev_settings.py.

Initialize the database

In order to populate the database with the tables and default data, run: APITAXI_CONFIG_FILE=APITaxi/dev_settings.py PYTHON_PATH=. manage.py db upgrade head

Initialize the InfluxDB database

To initialize this database you need to run this command: `APITAXI_CONFIG_FILE=APITaxi/dev_settings.py PYTHON_PATH=. manage.py create_influx_db

Add an administrator

Just run this command APITAXI_CONFIG_FILE=APITaxi/dev_settings.py PYTHON_PATH=. manage.py create_admin your_email@your_domain.com type a password.

Run the server

APITAXI_CONFIG_FILE=APITaxi/dev_settings.py PYTHON_PATH=. manage.py runserver

you can then access:

  • the backoffice here: http://127.0.0.1:5000/
  • and the API doc here: http://127.0.0.1:5000/doc

A wsgi file is also provided if a webserver is required (Apache has been tested, Nginx should work).

Run taxi's activity storage

There are two unix services to install & run to store taxis' activity, one sending beats, another waiting for beats and interpreting them. This worker will also be able to run asynchronous tasks.

To install these services you need to copy:

  • scripts/celeryd in /etc/init.d/taxis_worker
  • scripts/celerybeat in /etc/init.d/activity_beat

Then you need to edit scripts/example/conf to stick with your configuration (you might need to create a celery user). Copy this file in:

  • /etc/default/taxis_worker
  • /etc/default/activity_beat

Now you should be able to run services with:

  • service taxis_worker start
  • service activity_beat start

apitaxi's People

Contributors

l-vincent-l avatar teleboas avatar offvince avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.