Skip to content

elitan/mike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mike

Mike is a legal document assistant built on Next.js route handlers, Better Auth, Postgres, and Cloudflare R2-compatible object storage.

Website: mikeoss.com

Contents

  • app/ - Next.js app, route handlers, oRPC, Postgres access, and document processing
  • docs/db/schema.sql - Postgres schema for fresh databases

Prerequisites

  • 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

Database Setup

For a new Postgres database, run:

-- copy and run the contents of:
-- docs/db/schema.sql

For 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 app

Environment

Create local env files:

touch app/.env.local

Create 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-secret

Provider 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:4b

Then set OLLAMA_ENABLED=true in app/.env.local. OLLAMA_BASE_URL defaults to http://localhost:11434.

Install

Install the app package:

npm install --prefix app

Run Locally

Start the app:

npm run dev --prefix app

Open http://localhost:3000.

First Run

  1. Sign up in the app.
  2. 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.
  3. Create or open a project and start chatting with documents.

Troubleshooting

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.

Useful Checks

npm run build --prefix app
npm run lint --prefix app

About

open source alternative to Legora / Harvey

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages