Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jiisanda/fuelup
Get map of route along with optimal location to fuel up...
https://github.com/jiisanda/fuelup
django django-rest-framework fuelup openstreetmap
Last synced: 26 days ago
JSON representation
Get map of route along with optimal location to fuel up...
- Host: GitHub
- URL: https://github.com/jiisanda/fuelup
- Owner: jiisanda
- License: mit
- Created: 2024-11-26T07:56:29.000Z (30 days ago)
- Default Branch: master
- Last Pushed: 2024-11-29T17:00:28.000Z (26 days ago)
- Last Synced: 2024-11-29T17:29:33.038Z (26 days ago)
- Topics: django, django-rest-framework, fuelup, openstreetmap
- Language: Python
- Homepage:
- Size: 2.29 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fuelup
## Project Requirements
* API that takes inputs of start and finish location both within the USA
* Return a map of the route along with optimal location to fuel up along the route -- optimal mostly means cost effective based on fuel prices
* Assume the vehicle has a maximum range of 500 miles so multiple fuel ups might need to be displayed on the route
* Also returns the total money spent on fuel assuming the vehicle achieves 10 miles per gallon
* Use the attached file for a list of fuel prices
* Find a free API yourself for the map and routing## setup
```bash
git clone https://github.com/jiisanda/fuelup.git
cd fuelup
pip install -r requirements.txt
py manage.py makemigrations
py manage.py migrate
py manage.py populate_truckstop
py manage.py runserver
```## API Endpoints
### Optimal Root endpoint
- URL : `/api/optimal-route`
- METHOD : `POST`
- Request Body :
```json
{
"start_location": "Dallas, TX",
"end_location": "Chicago, IL"
}
```
- Response:
```json
{
"route": {
"coordinates": "",
"total_distance_miles": "",
"duration": ""
},
"fuel_stops": [],
"summary": {
"total_cost": "int",
"total_gallons": "int"
"number_of_stops": "int"
}
}
```
- Visualized Response:![postman_output](static/imgs/postman_output.png)
![frontend_output](static/imgs/frontend_output.png)