phlask / phlask-map

Code behind the Phlask Web Map

Home Page:https://beta.phlask.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[V2] Pull new data format into the frontend

vontell opened this issue · comments

Is your feature request related to a problem? Please describe.
Now that our data is migrated into a new format and new table, we need to update the frontend to begin using this new data.

Describe the solution you'd like
This will require a few changes:

  • Update all instances in the frontend where *.firebaseio.com is used to now use the new DB url, https://phlask-beta.firebaseio.com/. There is also a https://phlask-test.firebaseio.com/ and https://phlask-prod.firebaseio.com/ that should be used based on the environment.
  • Update all places in the code that reference the fields of a resources to be updated to follow our new schema/standard. Although we don't have typescript, we might be able to create a class that can give us stronger typing on the fields that are available.
  • Create a way for us to filter for certain resource types when pulling the data from Firebase.

This does not include the changes for adding resources - that will come at a later date.

I can take this task, need pair programming

Just an update on this - @vkavith I am going to start this one while you are tackling the lat/lng ticket, but once you are done with that, we can tackle this one together depending on where I'm at with it!

(Thinking out loud so others can learn)

There are a few tricky parts of this that need to be implemented:

  • We need a way to determine if we should be using the new or old data format. I am doing this by introducing a new "environments" utility file that can help us determine if we are in test/beta/prod. Then, I want to add a featureFlags file that can be used to turn this on and off. Until we have more progress, we want to keep this feature flag off for most people, unless you are developing this locally.
  • Once that is defined, I want to make a ResourceEntry class that defines the new resource type, that way we know exactly what we are getting from the JSON types coming from Firebase. need to think about how we can "type" this within JavaScript
  • Once that type is defined, we need to add new code to our actions that will retrieve the resources. For the first pass, don't filter by resource type when fetching - we will get to that.