juanitacosmica / FinalProject_RoadTrippr

2 stars 4 forks source link

Navigation <-> TrippRoller I/O #31

Open semionaut opened 2 years ago

semionaut commented 2 years ago

Navigation.html receives the end parameter as a user input. This needs to be used as dest before roll_trip(): is run. Then the place information needs to be returned to the empty list viewpoints = [] to construct the route.

The issue:

  1. The python function needs to receive end before running
  2. The python function can't be run itself in the midst of this already running JavaScript function
  3. The routeCalculate function needs to receive the place data before fully running in order to plot the route
  4. TrippRoller can't run inside the existing JS because this is a website, it would expose the API key and this needs to be kept secure

The proposal to mitigate this is:

  1. User inputs their starting and destination address
  2. Run the roll_trip() function separately off of the cloud via a simple Flask web API, with the gkey safely within FireBase
  3. Pass the necessary input data via the API to the roll function and run it
  4. Pass the necessary output data back to route calculation
  5. Continues running the route calculation

Simple diagram: image

A basic overview of running requests over Flask (under "Accessing Request Data")