leofuturer / eDrops3

The 3rd generation of the eDrops web application.
MIT License
0 stars 0 forks source link

Client cleanup #114

Closed Kenny477 closed 1 year ago

Kenny477 commented 1 year ago

Fixes a number of issues and also revamps our client-server architecture to be more developer friendly.

  1. Types are now exported from server for client usage
  2. Developed a mini client API library so all API calls are done through that. Helps with overall API call conformity. I will probably need to add documentation for this. But essentially for example, we have a model named Customer. On the frontend we import the type Customer and create a Resource that handles CRUD requests to customer endpoints and also add any additional custom functions.
  3. Moved Shopify API calls to backend. Ensures two things: we don't expose API keys to client and we don't have partial API calls (e.g. we don't make a call to Shopify's API and create an order there but accidentally not create an order in our own backend).
  4. Did some work on performance improvements. Converted some of our bigger static assets to webp (should aim to convert all images to webp in future). Moved logo_work folder outside so it's not bundled. Note that Vite's webserver may be slow because HMR doesn't do any optimizations. But if you npm run build and npm run preview, you will be able to determine what our deployed site performance is like.
  5. Setup automatic Ngrok webhook. Fetch ngrok tunnel URL from localhost:4040, then use Shopify Admin API to add webhook.
  6. All testing emails are now centralized using plus addressing to edropswebsite@gmail.com.
  7. File system-ish routing. Routes now correspond largely to locations of files. E.g. /manage/users will be at client/src/page/manage/users.

Addresses following issues:

103

104

106

93

Kenny477 commented 1 year ago

Still work in progress. Opened a PR to keep track of which issues are being addressed.

Kenny477 commented 1 year ago

I think it's maybe fine to merge to stage. There is a lot to be worked on but mostly just bug fixing and not any features/design fixes.

After the merge, we will focus on cleaning up everything.

The main problem right now is the checkout flow seems to have some errors with creating two carts on accident and also not being responsive (i.e. having to refresh page sometimes to see latest cart).