platelet-app / platelet

Dispatch system for emergency volunteer couriers.
https://platelet.app
Apache License 2.0
38 stars 10 forks source link

Replacing the old API with DataStore. #7

Closed duckbytes closed 2 years ago

duckbytes commented 3 years ago

This pull request replaces use of the old REST API with DataStore and Amplify. It also updates Material UI from V4 to V5.

It adds extra forms and routes for admins to add locations, users, deliverable types and vehicles.

Three new environment variables are added:

REACT_APP_OFFLINE_ONLY REACT_APP_POPULATE_FAKE_DATA REACT_APP_DEMO_MODE

with descriptions in the README. To enable them they should be set to true. Anything else disables them.

Added a github action workflow that deploys a demo version of the app to an S3 bucket. It currently uses this branch but can be changed to master once merged.

Things still not implemented:

A lot of the forms showing detail about users/vehicles/locations are still ugly and their design needs to be revised at some point.

This pull request also makes minor changes to the design in the dashboard, task overview dialog and comments section.

There are two issues with DataStore effecting this implementation:

https://github.com/aws-amplify/amplify-js/issues/9034

DataStore sometimes throws an error when setting the ID for a connection. I've worked around this but it may mean that other users will not receive updates to their dashboard until it is fixed, as it prevents observers from working.

https://github.com/aws-amplify/amplify-js/issues/9035

Chrome and Edge do not register when the network connection goes down, so the user cannot be notified. A workaround for now might be to use some other method of checking network connectivity.