Skip to content

[Integration] Supabase and Drizzle ORM Integration #13

@Bran18

Description

@Bran18

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

  1. Set Up Drizzle + Supabase

    • Connect Drizzle ORM to Supabase using the proper configuration.

    • Create schema definitions for the following tables:

      • escrows
      • milestones
      • approvals
      • users
  2. Create Custom Hooks

    • Create the following hooks under /apps/webapp/hooks/escrow/:

      • useCreateEscrow
      • useUpdateEscrow
      • useDeleteEscrow
      • useGetEscrows
      • useAddMilestone
      • useApproveMilestone
  3. Organize Services

    • Place database access logic under /services/supabase/
    • Follow RORO (Receive an object, return an object) pattern
  4. Real-Time Updates

    • Use Supabase real-time subscriptions or implement polling to update UI on status changes
  5. Secure Access

    • Ensure data is scoped per user using Supabase auth
    • Protect routes and hook logic from unauthorized access
  6. Write Seed Script

    • Add a utility to populate the database with sample escrows and milestone records
  7. Testing

    • Add tests to verify custom hooks perform the correct DB actions
    • Simulate end-to-end usage of creating and updating escrow records

Metadata

Metadata

Assignees

Labels

Milestone #1Road map tranchesfellowOnly Dust FellowshipintegrationAPI integration of another tool in the stellar ecosystemonlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions