Issue: Supabase and Drizzle ORM Integration for Escrow State Sync
Difficulty: Intermediate
Estimated Time: 6-8 hours
Documentation:
Goal
Integrate Supabase and Drizzle ORM to store and retrieve escrow-related data such as engagements, milestones, approvals, and user metadata. Build reusable hooks to enable interaction with the database using a modular and maintainable approach.
Expected Outcome
- Schemas for escrows, users, milestones, statuses, and approvals.
- Custom hooks to create, update, delete, and fetch data from Supabase.
- Integration with frontend components.
Tasks
-
Set Up Drizzle + Supabase
-
Create Custom Hooks
-
Organize Services
- Place database access logic under
/services/supabase/
- Follow RORO (Receive an object, return an object) pattern
-
Real-Time Updates
- Use Supabase real-time subscriptions or implement polling to update UI on status changes
-
Secure Access
- Ensure data is scoped per user using Supabase auth
- Protect routes and hook logic from unauthorized access
-
Write Seed Script
- Add a utility to populate the database with sample escrows and milestone records
-
Testing
- Add tests to verify custom hooks perform the correct DB actions
- Simulate end-to-end usage of creating and updating escrow records
Issue: Supabase and Drizzle ORM Integration for Escrow State Sync
Difficulty: Intermediate
Estimated Time: 6-8 hours
Documentation:
Goal
Integrate Supabase and Drizzle ORM to store and retrieve escrow-related data such as engagements, milestones, approvals, and user metadata. Build reusable hooks to enable interaction with the database using a modular and maintainable approach.
Expected Outcome
Tasks
Set Up Drizzle + Supabase
Connect Drizzle ORM to Supabase using the proper configuration.
Create schema definitions for the following tables:
Create Custom Hooks
Create the following hooks under
/apps/webapp/hooks/escrow/:useCreateEscrowuseUpdateEscrowuseDeleteEscrowuseGetEscrowsuseAddMilestoneuseApproveMilestoneOrganize Services
/services/supabase/Real-Time Updates
Secure Access
Write Seed Script
Testing