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`.

All activity is part of a single large feature branch (`feat/local-mike`) merged as PR #1. The work centers on infrastructure self-hosting rather than application feature development. No LLM, chat, or document-processing features are added or changed. The fork is at parity with the upstream application feature set; the only delta is the infrastructure layer.

View on GitHub →

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

Direction

infrastructureintegration

Activity

Themed changes and pull requests touching this fork, newest first. Themed changes that haven't been turned into a public post yet still appear — they're real work even without a published writeup.

📝 juanjo cuts Mike loose from Supabase 5 commits 2mo ago infrastructuresecurity draft
The fork can now run end-to-end on a developer's own machine, with no third-party accounts required to get started.
📝 juanjo cuts Mike loose from the cloud 16 commits 2mo ago infrastructuresecurity draft
The fork now runs end to end on your own machine - no hosted accounts, no external storage, one command to start.

Threads of work (detailed view)

17 threads have been distilled into posts.

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 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.

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.

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.

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)

1 PR touch this fork — inbound (filed against it) or outbound (filed from it). State icons match the editorial dashboard.

✅ Merged (1)