This project serves as the backend for the Traffic Tips! app.
The app is designed to help drivers decide if they should pay for the express lanes on the freeways in Denver.
It currently includes and API. Later it will also include a database connection for saving user data and a data analytics part to make the app even better.
cd project_directory
to change into the directory where the project should begit clone https://github.com/Solarus8/Traffic-Express-Lane-app.git
- enter username and password
- copy
example.env
and name it.env
, replace values as needed pip install --user pipenv
to install pipenvpipenv install
to install all requirements
python -m uvicorn run_api:app --reload
to run it, making it reload automatically when you save a file.
The file run_api.py
is the root of it all.
The folder api
contains all components of the API.
The folder common
contains everything that may not be unique to the API.
Replace <domain>
with our own domain or 127.0.0.0:8000
if you are testing locally.
request
URL: GET <domain>/api/recommend
Body: {"name": "name of gate", "session_id": "ID of app session", "fingerprint": "ID of phone used"}
Example: Look at test/get_recommend_express_lane.http
response example
{
"name": "Lowell (West Bound)",
"start_coordinate": "39.835657,-105.022941",
"end_coordinate": "39.842883,-105.040233",
"route": "US36 WB",
"recommend": false,
"estimated_time_saving": -3,
"comment": "Not recommended"
}
request
URL: POST <domain>/api/trip
Example: Look at test/post_trip_data.http
response
null