Mike is a legal document assistant with a Next.js frontend, an Express backend, Supabase Auth/Postgres, and Cloudflare R2-compatible object storage.
Website: mikeoss.com
frontend/- Next.js applicationbackend/- Express API, Supabase access, document processing, and database schemabackend/schema.sql- Supabase schema for fresh databasesbackend/migrations/- incremental database updates for existing deployments
Spins up the frontend, backend, and a full local Supabase stack (Postgres, Auth, Storage, Realtime) — no cloud account required.
Prerequisites: Docker Desktop, Supabase CLI (brew install supabase/tap/supabase).
# 1. Start local Supabase (Postgres, Auth, Storage, etc.)
# The migration in supabase/migrations/ is applied automatically.
supabase start
# 2. Note the keys printed by `supabase start` (or run `supabase status`).
# Create env files from the examples and paste in the local values:
cp backend/.env.example backend/.env
cp frontend/.env.local.example frontend/.env.local
# 3. Start the app stack
docker compose up -dThen open http://localhost:4000.
Default ports (set in docker-compose.yml):
| Service | URL |
|---|---|
| Frontend | http://localhost:4000 |
| Backend | http://localhost:4001 |
| Supabase API | http://localhost:54321 |
| Supabase DB | postgresql://postgres:postgres@localhost:54322/postgres |
| Mailpit (auth emails) | http://localhost:54324 |
Env values for the local Supabase stack:
# backend/.env
SUPABASE_URL=http://host.docker.internal:54321 # container -> host
SUPABASE_SECRET_KEY=<secret key from `supabase status`>
R2_ENDPOINT_URL=http://host.docker.internal:54321/storage/v1/s3
R2_ACCESS_KEY_ID=<S3 access key from `supabase status`>
R2_SECRET_ACCESS_KEY=<S3 secret key from `supabase status`>
R2_BUCKET_NAME=mike
# frontend/.env.local
NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321 # browser -> host
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=<publishable key>
SUPABASE_SECRET_KEY=<secret key>
NEXT_PUBLIC_API_BASE_URL=http://localhost:4001
Create the mike storage bucket once:
docker exec supabase_db_mike psql -U postgres -d postgres -c \
"insert into storage.buckets (id, name, public) values ('mike','mike',false) on conflict (id) do nothing;"Lifecycle:
docker compose logs -f # tail app logs
docker compose restart # pick up env changes
docker compose down # stop the app
supabase stop # stop the supabase stack (volumes persist)
supabase db reset # wipe DB and re-run migrationsThe compose file bind-mounts source for hot reload and runs npm install on container start so the deps in the named volume are guaranteed consistent (works around a Docker Desktop named-volume init quirk when bind mounts overlap).
- Node.js 20 or newer
- npm
- git
- A Supabase project
- A Cloudflare R2 bucket, MinIO bucket, or another S3-compatible bucket
- At least one supported model provider API key: Anthropic, Google Gemini, or OpenAI
- LibreOffice installed locally if you need DOC/DOCX to PDF conversion
For a new Supabase database, open the Supabase SQL editor and run:
-- copy and run the contents of:
-- backend/schema.sqlThe schema file is based on supabase-migration.sql and folds in the later files in backend/migrations/.
For an existing database, do not run the full schema file over production data. Apply the incremental files in backend/migrations/ instead.
Create local env files:
touch backend/.env
touch frontend/.env.localCreate backend/.env:
PORT=3001
FRONTEND_URL=http://localhost:3000
DOWNLOAD_SIGNING_SECRET=replace-with-a-random-32-byte-hex-string
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SECRET_KEY=your-supabase-service-role-key
R2_ENDPOINT_URL=https://your-account-id.r2.cloudflarestorage.com
R2_ACCESS_KEY_ID=your-r2-access-key
R2_SECRET_ACCESS_KEY=your-r2-secret-key
R2_BUCKET_NAME=mike
GEMINI_API_KEY=your-gemini-key
ANTHROPIC_API_KEY=your-anthropic-key
OPENAI_API_KEY=your-openai-key
RESEND_API_KEY=your-resend-key
USER_API_KEYS_ENCRYPTION_SECRET=your-long-random-secretCreate frontend/.env.local:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=your-supabase-anon-key
SUPABASE_SECRET_KEY=your-supabase-service-role-key
NEXT_PUBLIC_API_BASE_URL=http://localhost:3001Supabase values come from the project dashboard. Use the project URL for SUPABASE_URL / NEXT_PUBLIC_SUPABASE_URL, the service role key for SUPABASE_SECRET_KEY, and the anon/public key for NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY. If your Supabase project shows multiple key formats, use the legacy JWT-style anon and service role keys expected by the Supabase client libraries.
Provider keys are only needed for the models and email features you plan to use. Model provider keys can be configured in backend/.env for the whole instance, or per user in Account > Models & API Keys. If a provider key is present in backend/.env, that provider is available by default and the matching browser API key field is read-only.
Install each app package:
npm install --prefix backend
npm install --prefix frontendStart the backend:
npm run dev --prefix backendStart the main app:
npm run dev --prefix frontendOpen http://localhost:3000.
- Sign up in the app.
- If you did not set provider keys in
backend/.env, open Account > Models & API Keys and add an Anthropic, Gemini, or OpenAI API key. - Create or open a project and start chatting with documents.
Sign-up confirmation email never arrives. Confirmation emails are sent by Supabase Auth, not by Mike. For local development, the simplest fix is to disable email confirmation in Supabase > Authentication > Providers > Email. For production, configure custom SMTP in Supabase; the built-in mailer is heavily rate-limited and may be restricted on newer projects.
The model picker shows a missing-key warning. Add a key for that provider in Account > Models & API Keys, or configure the provider key in backend/.env and restart the backend.
DOC or DOCX conversion fails. Install LibreOffice locally and restart the backend so document conversion commands are available on the process path.
npm run build --prefix backend
npm run build --prefix frontend
npm run lint --prefix frontend