#907·midday

Replace Supabase with local Postgres + Drizzle

Author: ziahm6638Created Sep 22, 2026Updated Sep 22, 2026

Overview

Strip out Supabase dependency and replace with direct Postgres + Drizzle ORM.

Why

  • Simpler deployment (no Supabase dependency)
  • Full control over database
  • Consistent with other Sortx products
  • Easier local development

Tasks

  • Remove @midday/supabase package
  • Set up Drizzle schema from scratch (or migrate existing)
  • Replace Supabase client calls with Drizzle queries
  • Replace Supabase auth with better-auth or similar
  • Replace Supabase storage with S3-compatible (R2/MinIO)
  • Update all packages/db queries
  • Update environment variables
  • Set up local Postgres docker-compose for dev
  • Migration scripts

Files to modify

  • packages/supabase/ → Remove
  • packages/db/ → Rewrite for direct Postgres
  • All files importing from @midday/supabase
  • apps/*/ env configs

Dependencies

None - this is foundational work