Skip to content

Independent project for Hackbright Academy Fall 2016

Notifications You must be signed in to change notification settings

nnegri/RideThrift

Repository files navigation

Ride Thrift

Ride Thrift provides price comparisons for rideshare apps, using the Uber and Lyft APIs to retrieve on the minute estimates for a route chosen by the user. Google Maps and Places APIs provide autocomplete and geolocation functionality, as well as a route map. Users have the option to save and delete addresses in their account, which are stored in the database. Users may request rides from their own accounts through OAuth, and the status of the trip is dynamically updated via AJAX. C3.js, a D3-based library, is utilized for data visualization of historical surge/primetime rates for any given day and time. Data on surge pricing was collected via automated API requests running over the course of a week.

Deployment

https://ridethrift.herokuapp.com/

*Please note the "request a ride" feature is for proof of concept only; requests have been set to sandbox mode.

Contents

Technologies

Backend: Python, Flask, PostgreSQL, SQLAlchemy
Frontend: JavaScript, jQuery, AJAX, Jinja2, Bootstrap, HTML5, CSS3
APIs: Uber, Lyft, Google Places Autocomplete and Distance Matrix, Google Maps

Features

User can choose their origin and destination, based on current location, autocomplete options or saved addresses:

Users can also delete addresses stored in their account:

Current estimates are retrieved from Uber and Lyft APIs, and shown here. Prices have been slightly manipulated as to comply with API usage agreements.

Users can see historical surge prices on the line chart for current time or a selected day and time:

They can then select a ride and authorize their Uber/Lyft account to request:

Once the request is completed, a status message is updated throughout the trip:

Installation

To run Ride Thrift:

Install PostgreSQL (Mac OSX)

Clone or fork this repo:

https://github.com/nnegri/RideThrift.git

Create and activate a virtual environment inside your Ride Thrift directory:

virtualenv env
source env/bin/activate

Install the dependencies:

pip install -r requirements.txt

Sign up to use the Uber API, the Lyft API, and the Google Places API.

Save your API keys in a file called secrets.sh using this format:

export UBER_CLIENT_ID="YOUR_KEY_HERE"
export UBER_CLIENT_SECRET="YOUR_KEY_HERE"
export UBER_SERVER_TOKEN="YOUR_KEY_HERE"
export LYFT_CLIENT_ID="YOUR_KEY_HERE"
export LYFT_CLIENT_SECRET="YOUR_KEY_HERE"
export GOOGLE_API_KEY="YOUR_KEY_HERE"

Source your keys from your secrets.sh file into your virtual environment:

source secrets.sh

Set up the database:

createdb rideshares
python model.py
python seed.py
psql rideshares < estimates.sql

Run the app:

python server.py

You can now navigate to 'localhost:5000/' to access Ride Thrift.

About Me

Nicole Negri is a Software Engineer in the Bay Area; this is her first project. Visit her on LinkedIn.

About

Independent project for Hackbright Academy Fall 2016

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published