Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pechouc/taxi-fare-interface
https://github.com/pechouc/taxi-fare-interface
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pechouc/taxi-fare-interface
- Owner: pechouc
- Created: 2020-06-19T10:31:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-19T12:33:17.000Z (over 4 years ago)
- Last Synced: 2024-11-19T19:07:07.860Z (3 months ago)
- Language: JavaScript
- Size: 3.49 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NY Taxi Fare prediction interface
![](images/snapshot.png)
## Setup
The interface uses 4 APIs:
- The NY Taxi Fare prediction API
- The [Algolia Places](https://community.algolia.com/places/) API for address autocomplete
- The [MapBox Maps API](https://docs.mapbox.com/mapbox-gl-js/api/) to display a map
- 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 Heroku:
```js
// script.jsconst taxiFareApiUrl = 'https://YOUR_API_URL.herokuapp.com/predict_fare';
```_Note: the following setup steps are optional as you can use Algolia and Mapbox credentials given by Le Wagon_
### Algolia Places Api (optional)
- Go to [Algolia](https://www.algolia.com/) and create an account and follow the steps to create your first application
- Go to your [dashboard](https://www.algolia.com/) then to the API Keys tab
- Grab an `Application ID` and a `Search-Only API Key` then set them into the `script.js````javascript
// script.jsconst algoliaPlacesApiAppId = 'YOUR_APPLICATION_ID';
const algoliaPlacesApiKey = 'YOUR_SEARCH_ONLY_API_KEY';
````### 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
//...
const mapboxApiToken = 'YOUR_MAPBOX_API_ACCESS_TOKEN';
````## Local development
To check your setup, run the interface locally with `serve`. Then go to [http://localhost:8000](http://localhost:8000).
## 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`.