juanjo/mike
Drops Supabase entirely in favor of a self-hosted Docker stack: Postgres 16 + Auth.js v5 + Drizzle ORM + MinIO, all runnable from `docker compose up`.
juanjo/mike is a fork of the willchen96/mike legal-AI codebase whose main body of work is a complete Supabase removal. The fork replaces Supabase Auth and the managed Postgres instance with Auth.js v5 (Credentials provider, JWT strategy), a Docker Postgres 16 container, Drizzle ORM, and MinIO for local S3-compatible storage. After the migration, docker compose up -d brings up a fully functional local environment with no external accounts required.
The work was done in two plans. Plan 1 established the foundation: Docker Compose, Drizzle schema, Auth.js signup/login, and a cookie bridge that lets Express decode the Auth.js session token using a shared AUTH_SECRET. Plan 2 mechanically converted all remaining supabase-js call sites across the backend (roughly 60 call sites across 7 route files and 4 lib modules) and stripped the Supabase npm packages. The frontend auth removal ran in parallel - Authorization: Bearer headers replaced with credentials: "include" against relative /api/backend/* URLs via a Next.js rewrite.
Two runtime bugs were introduced and fixed during the route sweep: an SSE headers-already-sent crash in projectChat.ts and a camelCase/snake_case column key mismatch in the tabular context builder. Both are fixed in the commit history. A known hard-coded salt bug in the auth middleware will break the production __Secure- cookie variant - flagged in code but not yet resolved.
The fork also adds Serena AI assistant memory files, runbooks, and ADRs documenting the decisions, which serve as useful architecture references independent of the code changes.
What's in it
- Local Postgres database Mike's data layer rebuilt to run against a Postgres instance you control, with a typed query toolkit replacing the previous hosted-database client.
- Self-hosted authentication Signup and login moved off the hosted auth service onto a cookie-based session model that bridges cleanly between the Next.js frontend and the Express backend.
- Local S3-compatible object storage An in-stack object store stands in for the hosted bucket, so file uploads and document storage work end-to-end without any cloud dependency in development.
- Docker-compose stack The whole runtime - database, auth, storage - comes up together under a single compose file, aimed at making a fresh checkout runnable in one command.
- Plan-driven development Specs and detailed implementation plans land before each phase, giving the fork a paper trail of what's being changed and why - useful if you want to follow along or contribute.
- Project documentation infrastructure Contributor-facing scaffolding - runbooks, architecture decision records, a tracker for deferred work - sits alongside the code, suggesting this fork is being maintained for more than one pair of hands.
Direction
infrastructureintegration
Activity
juanjo ↗ analysis ↗ GitHub Threads of work (detailed view)
juanjo cuts Mike's tie to a single cloud vendor
His fork can now run end to end on a laptop, with no cloud account required.
MinIO added to docker-compose: local S3-compatible storage, no R2 credentials needed
juanjo adds MinIO to `docker-compose.yml` so a fresh clone can run end-to-end without real Cloudflare R2 credentials. The storage client change is six lines in `backend/src/lib/storage.ts`; the rest is compose services, env defaults, and docs.
juanjo puts the Supabase exit on the record, warts and all
A new set of decision documents explains why this fork is cutting ties with its hosted backend, and is unusually frank about what still isn't finished.
juanjo unplugs Supabase and brings the whole stack in-house
The fork now stands up on its own, with no third-party account needed to start running it.
Supabase packages uninstalled, env vars cleaned up, docs updated
Three commits close out Plan 2: the Supabase npm packages are removed from both frontend and backend, env example files drop the `SUPABASE_*` vars, and new Serena memory files document the post-migration codebase shape. After this sequence the fork has no Supabase code paths.
juanjo cuts Mike loose from Supabase
The fork can now run end-to-end on a developer's own machine, with no third-party accounts required to get started.
Frontend Supabase auth removed - hooks and components switch to cookie credentials
juanjo strips the remaining Supabase auth calls from the frontend: hooks, components, and `UserProfileContext` all switch from `supabase.auth.getSession()` + Bearer headers to `credentials: "include"` against relative `/api/backend/*` URLs. `frontend/src/lib/supabase.ts` is deleted.
juanjo cuts Mike loose from its cloud accounts
Mike no longer needs a third-party sign-up to run - the whole stack now comes up on hardware you control.
juanjo cuts Mike loose from the cloud
The fork now runs end to end on your own machine - no hosted accounts, no external storage, one command to start.
Backend route and lib sweep: all supabase-js call sites replaced with Drizzle
juanjo converts every remaining supabase-js consumer on the backend - four lib modules and seven route files - to Drizzle ORM in 16 commits. Two runtime bugs introduced by the sweep are fixed afterward: an SSE headers-already-sent crash and a column-name casing mismatch in the tabular context builder.
Plan 2: entire backend ported to Drizzle, Supabase packages removed
juanjo finishes the mechanical backend migration: 16 commits convert every remaining supabase-js call site to Drizzle ORM across all route files and lib helpers. Two post-migration bug fixes suggest the sweep was large enough to introduce subtle runtime errors.
juanjo is cutting Mike's cord to the cloud
A careful, fully-planned rebuild so Mike runs end-to-end on your own hardware, with no outside accounts required.
Design spec and implementation plans for the Supabase exit
juanjo wrote three planning documents - a design spec and two phased implementation plans - before writing any migration code. The plans are detailed enough to serve as checklists if you're doing a similar Supabase removal.
juanjo cuts the cloud cord so Mike runs on your own hardware
Mike no longer needs a third-party account to log a single user in - the whole stack now stands up on infrastructure you control.
Auth.js v5 signup and login, cookie bridge to Express backend
juanjo replaces Supabase Auth with Auth.js v5 on the Next.js frontend and wires the resulting session cookie into the Express backend. The backend's auth middleware is ~50 lines; there's a hard-coded salt bug that will break HTTPS deployments until fixed.
juanjo is cutting Mike's cord to Supabase
The fork is moving its database and logins off a hosted service and onto plumbing it controls.
Postgres docker-compose and Drizzle ORM scaffolding (foundation layer)
juanjo adds the Docker Postgres setup and Drizzle ORM scaffolding that underpin the Supabase removal. The schema commit defines the full application data model in TypeScript - if you want to understand what juanjo/mike stores, `backend/src/db/schema.ts` is the file.
Pull requests (detailed view)
✅ Merged (1)
juanjo · opened 2mo ago · merged 2mo ago by juanjo