Skip to content

Responsive, client-side app that estimates rental costs for Gig Car Share from user-inputted route or time using React.js, Mapbox & Material-UI

Notifications You must be signed in to change notification settings

josh-p-thompson/farecalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fare Estimator for Gig Car Share

I built this single-page React app to demo how Gig Car Share could allow users to view price estimates based on an inputted route, schedule, or time. Gig charges by the minute, hour, or day with various caps based on the amount of time elapsed. The app does all of this nasty math for you!

A live version of the app can be viewed here.

Demo

Route

User can input pickup and dropoff lcoations.

The Mapbox geocoding API is called to populate search results and the Mapbox Directions API is called to determine the driving time between the two locations.

Schedule

User can input pickup and dropoff datetimes.

Time

User can input minutes, hours, and days.

Note how the estimate correctly accounts for the $15 per hour, $55 per 8 hours, and $85 per day pricing caps.

Built With

Getting Started

From the root directory, npm install to install all dependencies.

Update MAPBOX_TOKEN in App.js with your own public Mapbox token.

npm run start will get the local server running.

Components Overview

  • FareNavigation - The navigation bar at the top of the app; see Material-UI's Bottom Navigation.
  • Route - The two input boxes that query the Mapbox Geocoding API and show results as a dropdown; see Material-UI's Autocomplete.
  • Schedule - Houses both DatePicker components.
  • DatePicker - Inputs for DateTime that open calendar selectors; see Material-UI Pickers.
  • Time - Inputs for minutes, hours, days; see Material-UI's Text Field.
  • Receipt - Visualizes price as a table; see Material-UI's Table.

About

Responsive, client-side app that estimates rental costs for Gig Car Share from user-inputted route or time using React.js, Mapbox & Material-UI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published