juanjo finishes ripping Supabase out of Mike's backend

The fork's database rewrite is done - every backend route now talks to plain Postgres through a different toolkit, with the frontend none the wiser.

infrastructure

Mike originally leaned on Supabase, a hosted service that handled both the database and user logins. juanjo's fork swaps that out for a local Postgres setup, and this stretch of work is the mechanical finish line: every remaining backend file - user lookups, access checks, document storage, chat, projects, workflows, tabular data - has been rewritten against the new database layer.

The interesting trick is that the frontend didn't have to change at all. The team built small translator layers that keep the data shape going to the browser identical, even though the plumbing underneath is completely different. Two bugs surfaced after the sweep - a streaming-response crash and a column-naming mismatch - and both got patched, a useful warning for anyone copying this approach.

So what Anyone considering a Supabase-free build of Mike now has a complete, working reference for what that rewrite actually looks like end to end.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

16 commits from juanjo/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
68d18876 feat(backend): replace Supabase auth.admin.listUsers with Drizzle helper Juan Vidal 2026-05-08 ↗ GitHub
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cfc84fbf chore(backend): remove dead Supabase admin client from workflows.ts Juan Vidal 2026-05-08 ↗ GitHub
36c889ce feat(backend): migrate lib/access.ts to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
a41622ab feat(backend): migrate lib/userSettings.ts to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
3a5c8b6d feat(backend): migrate lib/documentVersions.ts to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
d352d15c feat(backend): migrate lib/chatTools.ts to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
ff63879b feat(backend): migrate downloads.ts to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d2f30d55 feat(backend): migrate projectChat.ts to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
318e5594 feat(backend): migrate chat.ts to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ed0cc463 fix(projectChat): guard outer catch against post-headers-sent SSE crash Juan Vidal 2026-05-08 ↗ GitHub
5e802ac6 feat(backend): migrate projects route to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
commit body
Replace all supabase-js calls in backend/src/routes/projects.ts with
Drizzle ORM equivalents, add projectToWire/docToWire/folderToWire helpers
for snake_case wire shape preservation, and wrap every async handler in
try/catch. Drop the redundant _db shim arg from all checkProjectAccess
call sites. The listAllUsers() usage from P2-1 is preserved intact.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3e8d1813 feat(backend): migrate documents route to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
commit body
Replace all 30 supabase-js calls in documents.ts with Drizzle ORM queries.
Drop _db shim args from lib calls; preserve snake_case wire shapes via
inline mappers; wrap all handlers in try/catch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b691f92c feat(backend): migrate workflows route to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
commit body
Replace all 18 supabase-js calls in workflows.ts with Drizzle ORM queries.
Add workflowToWire mapper for snake_case wire shape; drop _db shim args;
preserve listAllUsers() from P2-1; wrap all handlers in try/catch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7cf1e82e fix(backend): workflow list ordering + tighten Drizzle update types Juan Vidal 2026-05-08 ↗ GitHub
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
022434f9 feat(backend): migrate tabular route to Drizzle Juan Vidal 2026-05-08 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bdb80c46 fix(tabular): correct snake_case→camelCase mismatch in buildTabularContext Juan Vidal 2026-05-08 ↗ GitHub

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-183.md from inside the repo you want the changes in.

⬇ Download capture-thread-183.md