Mike is a legal document assistant built on Next.js route handlers, Better Auth, Postgres, and Cloudflare R2-compatible object storage.
Website: mikeoss.com
app/- Next.js app, route handlers, oRPC, Postgres access, and document processingdocs/db/schema.sql- Postgres schema for fresh databases
- Node.js 20 or newer
- npm
- git
- Any Postgres database
- A Cloudflare R2 bucket, MinIO bucket, or another S3-compatible bucket
- At least one supported model provider: Ollama, Anthropic, Google Gemini, or OpenAI
- LibreOffice installed locally if you need DOC/DOCX to PDF conversion
For a new Postgres database, run:
-- copy and run the contents of:
-- docs/db/schema.sqlFor an existing database, do not run the full schema file over production data.
Regenerate Kysely DB types after schema changes:
npm run db:codegen --prefix appCreate local env files:
touch app/.env.localCreate app/.env.local:
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000/api/v1
DOWNLOAD_SIGNING_SECRET=replace-with-a-random-32-byte-hex-string
BETTER_AUTH_SECRET=replace-with-a-random-32-byte-hex-string
BETTER_AUTH_URL=http://localhost:3000/api/v1/auth
FRONTEND_URL=http://localhost:3000
DATABASE_URL=postgres://postgres:postgres@localhost:5432/mike
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
OLLAMA_ENABLED=false
OLLAMA_BASE_URL=http://localhost:11434
RESEND_API_KEY=your-resend-key
USER_API_KEYS_ENCRYPTION_SECRET=your-long-random-secretProvider keys are only needed for the cloud models and email features you plan to use. Model provider keys can be configured in app/.env.local for the whole instance, or per user in Account > Models & API Keys. If a provider key is present in app/.env.local, that provider is available by default and the matching browser API key field is read-only.
To run fully local model inference, install Ollama, pull one of the listed models, and enable it:
ollama pull llama3.1
ollama pull qwen3:8b
ollama pull qwen3:4bThen set OLLAMA_ENABLED=true in app/.env.local. OLLAMA_BASE_URL defaults to http://localhost:11434.
Install the app package:
npm install --prefix appStart the app:
npm run dev --prefix appOpen http://localhost:3000.
- Sign up in the app.
- If you did not enable Ollama or set provider keys in
app/.env.local, open Account > Models & API Keys and add an Anthropic, Gemini, or OpenAI API key. - Create or open a project and start chatting with documents.
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 app/.env.local and restart Next. For Ollama, set OLLAMA_ENABLED=true or OLLAMA_BASE_URL.
DOC or DOCX conversion fails. Install LibreOffice locally and restart Next so document conversion commands are available on the process path.
npm run build --prefix app
npm run lint --prefix app