https://github.com/valenradovich/taxi-fare-interface
https://github.com/valenradovich/taxi-fare-interface
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/valenradovich/taxi-fare-interface
- Owner: valenradovich
- Created: 2023-09-01T14:32:02.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-01T14:55:00.000Z (over 1 year ago)
- Last Synced: 2025-01-20T01:26:31.321Z (4 months ago)
- Language: JavaScript
- Size: 3.48 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NY Taxi Fare prediction interface

## Setup
The interface uses 3 APIs:
- The NY Taxi Fare prediction API
- The [MapBox Maps API](https://docs.mapbox.com/mapbox-gl-js/api/) to display a map and address autocomplete
- The [MapBox Directions API](https://docs.mapbox.com/api/navigation/) to display the route on the mapThese APIs require credentials and the following steps will guide you to get them and set the interface with.
### NY Taxi Fare prediction API
Update the `script.js` to get prediction from your own API hosted on GCP (make sure to use `https`, not `http`):
```js
// script.jsconst taxiFareApiUrl = 'https://YOUR_API_URL/predict';
```Hint: alternatively, you may use this Le Wagon Prediction API if you do not have one in production:
`https://taxifare.lewagon.ai/predict`
_Note: the following setup steps are optional as you can use Mapbox credentials given by Le Wagon_
### MapBox Maps and Directions APIs (optional)
- Go to [MapBox](https://www.mapbox.com/) and create an account
- Go to your [Account](https://account.mapbox.com/) and grab your `Access Token` then set it into the `script.js````js
//...
mapboxgl.accessToken = 'YOUR_MAPBOX_API_ACCESS_TOKEN';
````## Local development
To check your setup, run the interface locally with:
```bash
python -m http.server 5001
```Then go to [http://localhost:5001](http://localhost:5001)
## Deploy on GitHub Pages
Your app is ready to go live!
Create a new branch `gh-pages`:
```bash
git checkout -b gh-pages
```Deploy your app on GitHub:
```bash
git push origin gh-pages
```Your app will be visible shortly at `https://YOUR_GITHUB_NICKNAME.github.io/taxi-fare-interface`.