Skip to content

pshrutiii/Lyft-vs-Uber

 
 

Repository files navigation

cmpe273_project

Repository for group project related to CMPE273.

Check contributers.txt for individual contributions.

How to run application

Refer requirements.txt for dependencies.

Make sure all the required softwares are installed, MySql is running on the machine and all the tables are created.

python price_comparator.py

Open http://localhost:5000

Link to the proposal Doc:

https://docs.google.com/document/d/1Dv45fS2HMaT3BaW8PK_gSF6a1j6jddj-Hg97TcsTi7U/edit#

2. Trip Planner using Uber vs Lyft's Price Estimation

Requirement

  • Plan a trip which consists of a set of places and estimate the total cost between Uber and Lyft.
  • You need to store location details and price estimate data into a persistent DB.
  • FEEL FREE TO ADD ANY APIS THAT YOU NEED.

I. Location APIs

    1. Create Location: POST /locations

Call Google Map API to look up coordinates. http://maps.google.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false

Request

{
   "name" : "My Home",
   "address" : "123 Main St",
   "city" : "San Francisco",
   "state" : "CA",
   "zip" : "94113"
}

Response

{
   "id" : 12345,
   "name" : "My Home",
   "address" : "123 Main St",
   "city" : "San Francisco",
   "state" : "CA",
   "zip" : "94113",
   "coordinate" : { 
      "lat" : 38.4220352,
      "lng" : -222.0841244
   }
}
    1. Get a location: GET /locations/12345

Response

{
   "id" : 12345,
   "name" : "My Home",
   "address" : "123 Main St",
   "city" : "San Francisco",
   "state" : "CA",
   "zip" : "94113",
   "coordinate" : { 
      "lat" : 38.4220352,
      "lng" : -222.0841244
   }
}
    1. Update a location: PUT /locations/12345

Request

{
   "name" : "My New Home"
}
    1. Delete a location: DELETE /locations/12345

II. Trip Planner APIs

    1. Plan a trip: POST /trips

Request

{
    "start": "/locations/12345",
    "others" : [ 
        "/locations/1000",
        "/locations/1001",
        "/locations/1002",
    ],
    "end": "/locations/12345"
}

Response

{
    "id": 200000,
    "start": "/locations/12345",
    "best_route_by_costs" : [ 
        "/locations/1002",
        "/locations/1000",
        "/locations/1001",
    ],
    "providers" : [
        {
            "name" : "Uber",
            "total_costs_by_cheapest_car_type" : 125,
            "currency_code": "USD",
            "total_duration" : 640,
            "duration_unit": "minute",
            "total_distance" : 25.05,
            "distance_unit": "mile"
        },
        {
            "name" : "Lyft",
            "total_costs_by_cheapest_car_type" : 110,
            "currency_code": "USD",
            "total_duration" : 620,
            "duration_unit": "minute",
            "total_distance" : 25.05,
            "distance_unit": "mile"
        }
    ],
    "end": "/locations/12345"
}

Dependency

About

Repository for group project related to CMPE273.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 53.9%
  • CSS 26.5%
  • Python 11.2%
  • HTML 8.4%