Skip to content

dexity/bikespot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bicycle Parking
===============

Description
-----------

BikeSpot is the application which helps to find the nearest bicycle parking using open DataSF for San Francisco, CA (http://data.sfgov.org/resource/w969-5mn4.json). The application presents the Google map with the current user location and neighboring bicycle parking spots. Clicking the "Park Me" the application tries to find the directions for the nearest parking and display the trajectory on the map step by step.

The DataSF data contain parking locations and some metadata related to the parking. The service doesn't have geolocation API so it makes it hard to use them directly to find the nearest location. In order to add geolocation feature I loaded the data to the PostgreSQL database with PostGIS module. For every current location it used the PostGIS algorithms to find the nearest parking.

To visualize the parking locations I used the Google Maps Javascript API v3 library which allows to make requests directly to the Google Maps API from the browser and display the necessary data. The directions trajectory uses Google Directions API and has more tricky implementation. The requests to the Directions API are performed by the server and the trajectory polylines returned upon AJAX requests. Please see the architecture in the source code.

For client MVC I used backbone.js which allows to create collection of directions and render them as a table of directions and display trajectory on the map. The current user location is detected based on Geolocation browser feature. If user doesn't accept the geolocation request, the default current location will be displayed.


Author
------

    Alexander Dementsov, [email protected]


Technology
----------

Front-end
~~~~~~~~~

    * Bootstrap 3.1.1
    * Underscore.js 1.6.0
    * Backbone.js 1.0.0
    * jQuery 1.11.0
    * jQuery.tmpl 1.0.4
    * json2.js 2014-02-04

Back-end
~~~~~~~~

    * Flask 0.10.1
    * Flask-SQLAlchemy 1.0
    * GeoAlchemy2 0.2.3
    * Flask-Script 0.6.7
    * PostgreSQL 9.1
    * PostGIS 2.1.1
    * Psycopg2 2.5.2
    * Nose 1.3.0

Deployment
~~~~~~~~~~

    * Nginx 1.4.1
    * Python-uwsgi 2.0.2
    * uWsgi 1.9.13
    * Supervisor 3.0b2-1

Run Application
---------------

    $ # Set up database and user for PostgreSQL
    $ pip install -r requirements.txt
    $ python manage.py init_db
    $ python manage.py load_datasf
    $ nosetests
    $ python server.py