andrew-bierman / PackRat

PackRat is a versatile adventure planner tailored for outdoor enthusiasts. It simplifies the process of organizing trips from a simple day hike to cross-country journeys.
https://packrat.world/
Other
16 stars 33 forks source link

[Drizzle] Validation and Testing Tracking #815

Open andrew-bierman opened 2 months ago

andrew-bierman commented 2 months ago

We are in the final phases of completing the drizzle migration to improve backend performance and get prod ready. We now need to update the remaining components on the frontend to ensure a seamless merge.

Use this issue to track what is in progress and needed, with the primary focus on CRUD.

https://github.com/andrew-bierman/PackRat/pull/508

andrew-bierman commented 2 months ago

The feature: backend is too slow with mongo. Both prod and dev mode. We switched to cloudflare workers and sqlite d1 db. Much faster. This is nearly done. Need to wire up the frontend forms to work with similar but slightly different backend structures

andrew-bierman commented 2 months ago

Also another thing to keep in mind when we start testing e2e with frontend, I think drizzle integrates really well with zod for validation and types. We can likely stop using that validations package and just use the ones from server, they are nearly the same anyways so it will clear confusion

Will be pretty cool I think we will get type safety from schema to frontend with validation if we do it right

taronaleksanian commented 2 months ago

@andrew-bierman some details on this

With drizzle having first class zod support, we can likely remove the validation package and use our validations directly from the server with minimal changes. Test and monitor what we are changing here. This will allow us to get type safety from schema to frontend which will be cool.

It's a great idea, but according to my research it's not possible please check this issue for reference https://github.com/trpc/trpc/discussions/2021

Anyway our solution is also a good option, we have a shared folder for both the server and the client. The issue we have is that not all the routes of the backend using the validations workspace, I think we can just resolve it.

andrew-bierman commented 2 months ago

You raise a good point, all I meant by that comment is using the validations from the server on frontend instead of the validation package. This way we will be able to consolidate to one source of truth. If we get it working that way it’s fine for now, although the trpc issue you linked does seem like a better implementation for later if they resolve.

Long term I think we could do cool stuff by extending the insert schema zod types -> added validation (ie length, email etc) -> infer types from these -> use those on frontend for validation schema in form + data types.

taronaleksanian commented 2 months ago

@andrew-bierman made our backend and frontend applications use validation schemas from validations workspace, added axios for our trpc client too and used response interseptors to show validation errors from API.

andrew-bierman commented 2 months ago

trip creation + maps are not working for me. likely geojson error

andrew-bierman commented 2 months ago

The cloudflare deployment link on the PR is now live. Worker and D1 instance deployed. Any changes to db schema will need a migration fyi

Current issue is env values such as api url is undefined after build which is strange

andrew-bierman commented 2 months ago

undefined env issue can be reproduced by running the pages:preview command in next dir. strange

EngrAJ8888 commented 2 months ago

List of encountered errors:

  1. When creating a pack:

    • Unable to enter decimal numbers in the weight field.
    • Unable to add items to the pack.
  2. When creating a trip:

    • Unable to select destination.
    • Maps not working
    • Unable to create and save trips.
  3. Main Dashboard:

    • Destination search function not working.
  4. Global Item List:

    • Unable to add items.
JewelTee commented 2 months ago

List of encountered errors:

  1. Open Chat
    • Chat Feature not working properly
  2. Profile Settings
    • Cannot upload profile picture
EngrAJ8888 commented 2 months ago

List of encountered errors:

  1. Profile Settings

    • Unable to log in with the new password after updating the password. 36
  2. Feed and Packs Feature

    • The search functionality is not functioning as expected.
EngrAJ8888 commented 2 months ago

"Other" menu option missing on mobile web. (Appearance feature and Logout)

IMG_1016 (4)