OSS AI Legal Platform
Find a file
Amal e551028726 fix(e2e): realign selectors with the olp UI and upstream route shape
upstream-main (olp's tip) ships the #215/#216 liquid-surfaces UI, so the same
selector drifts fixed on the fork's suite (commit 3d46814 on main) also apply
here. Ports those realigned hunks, plus one upstream-specific route fix.

  * Chat input placeholder is "How can I help?", not
    "Ask a question about your documents..." (ChatInput/TRChatInput). Updated in
    chat-management (rename/delete/project-assistant) and critical-path.
  * The project-assistant empty state replaced the "+ Create New" text link with
    a PillButton reading "Create" (ProjectAssistantTable) — critical-path and
    chat-management now use getByRole("button", { name: "Create" }).
  * The sidebar chat row's active marker is APP_SURFACE_ACTIVE_CLASS
    ("bg-app-surface-active"), not "bg-gray-200/60"; the row wrapper is now h-8,
    not h-9 (SidebarChatItem). The rename/delete tests locate the row accordingly.
  * The documents-toolbar folder button is "Folder" (TabPillButton wired to the
    root createFolderAction in ProjectDocumentsView), not "Add Subfolder"; it
    still opens the autofocused "Folder name" root input.
  * NewTRModal's footer submit and the tabular page CTA both read "Create", so
    the create-review helper scopes to the modal submit
    (button[name="modalAction"][value="create-review"]).
  * The built-in workflow detail test navigated to the flat /workflows/[id],
    which upstream does not route — only the typed /workflows/assistant/[id] and
    /workflows/tabular-review/[id] exist. builtin-cp-checklist is assistant-type,
    so it now navigates to /workflows/assistant/builtin-cp-checklist (the path
    the app itself links to via workflowDetailPath; works on the fork too).

Verified: full 27-test suite green against upstream-main + test-harness +
demo-mode(+provider-registry), backend + local Supabase (upstream schema.sql +
backend/migrations) + MinIO, demo model, e2e@mike.local.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CEguyEgXa9JjCciXCcVemC
2026-07-22 11:37:59 -07:00
.github Merge pull request #235 from amal66/olp-pr/lint-burndown 2026-07-22 16:33:52 +08:00
backend Merge pull request #237 from amal66/olp-pr/coverage-critical-libs 2026-07-21 18:16:40 +08:00
docs test: cover critical backend libs, raise coverage ratchet, add roadmap 2026-07-20 11:21:35 -07:00
e2e fix(e2e): realign selectors with the olp UI and upstream route shape 2026-07-22 11:37:59 -07:00
frontend Merge pull request #230 from amal66/olp-pr/frontend-unit-tests 2026-07-22 16:59:39 +08:00
scripts feat: refresh workflows and workflow editor UI 2026-07-20 03:04:47 +08:00
.gitignore test: Playwright e2e suite (auth, chat, projects, tabular reviews, workflows) 2026-07-22 11:37:59 -07:00
CONTRIBUTING.md docs: testing policy in CONTRIBUTING + PR template with verification checklist 2026-07-20 10:46:47 -07:00
LICENSE Add local repo contents 2026-04-29 19:49:06 +02:00
package-lock.json test: Playwright e2e suite (auth, chat, projects, tabular reviews, workflows) 2026-07-22 11:37:59 -07:00
package.json test: Playwright e2e suite (auth, chat, projects, tabular reviews, workflows) 2026-07-22 11:37:59 -07:00
playwright.config.ts test: Playwright e2e suite (auth, chat, projects, tabular reviews, workflows) 2026-07-22 11:37:59 -07:00
README.md feat: refresh workflows and workflow editor UI 2026-07-20 03:04:47 +08:00
tsconfig.json test: Playwright e2e suite (auth, chat, projects, tabular reviews, workflows) 2026-07-22 11:37:59 -07:00

Mike

Mike

Mike or MIkeOSS is a legal AI platform that is able to assist you with document review, drafting and legal research.

It has a Next.js frontend, an Express backend, Supabase Auth/Postgres, and Cloudflare R2-compatible object storage.

Website: mikeoss.com

Contents

  • frontend/ - Next.js application
  • backend/ - Express API, Supabase access, document processing, and database schema
  • backend/schema.sql - Supabase schema for fresh databases
  • backend/migrations/ - dated, incremental schema migrations; on an existing database, apply the files dated after the Mike version you deployed

System Workflows

Mike's system assistant and tabular review workflows are maintained in the Open-Legal-Products/mike-workflows repository.

Prerequisites

  • 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
  • Optional: a CourtListener API token for case law lookup and citation verification
  • LibreOffice installed locally if you need DOC/DOCX to PDF conversion

Database Setup

For a new Supabase database, open the Supabase SQL editor and run:

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

The schema file is for fresh deployments and already includes the latest database shape.

For an existing database, do not run the full schema file over production data. Instead, apply the incremental files in backend/migrations/: run the migrations dated after the version of Mike you currently have deployed, in filename order. Each file is named YYYYMMDD_<name>.sql (the date is also recorded in a comment at the top of the file) and is written to be safe to re-run, so when unsure you can re-apply the most recent migrations without harm.

Environment

Create local env files:

touch backend/.env
touch frontend/.env.local

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

# Optional: enables CourtListener case law and citation tools.
COURTLISTENER_API_TOKEN=your-courtlistener-token

# Optional: use locally imported CourtListener bulk data for faster case reads.
COURTLISTENER_BULK_DATA_ENABLED=false

Create frontend/.env.local:

NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=your-supabase-anon-key
NEXT_PUBLIC_API_BASE_URL=http://localhost:3001

Supabase values come from the project dashboard. Use the project URL for SUPABASE_URL / NEXT_PUBLIC_SUPABASE_URL, the service role key for the backend 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, legal research, and email features you plan to use. Model provider keys and the CourtListener token 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.

CourtListener Integration

Mike can use CourtListener for US case law citation verification, case fetching, targeted opinion search, and case-law panels in assistant responses.

To enable live CourtListener access, set COURTLISTENER_API_TOKEN in backend/.env and restart the backend. Users can also add their own CourtListener token from Account > Models & API Keys when the instance does not provide one globally.

Fresh databases created from backend/schema.sql already include the CourtListener support tables. Existing deployments should apply the matching dated migration in backend/migrations/ before enabling the feature.

Bulk data is optional. When COURTLISTENER_BULK_DATA_ENABLED=true, Mike first tries local Supabase/R2 data before falling back to CourtListener's API:

  • citation metadata is read from public.courtlistener_citation_index
  • case cluster metadata is read from public.courtlistener_opinion_cluster_index
  • cached opinion JSON is read from the R2 prefix courtlistener/opinions/by-cluster/{clusterId}/{opinionId}.json

If you do not import bulk data, leave COURTLISTENER_BULK_DATA_ENABLED=false; live CourtListener tools still work with a valid token, subject to CourtListener rate limits.

Install

Install each app package:

npm install --prefix backend
npm install --prefix frontend

Run Locally

Start the backend:

npm run dev --prefix backend

Start the main app:

npm run dev --prefix frontend

Open http://localhost:3000.

First Run

  1. Sign up in the app.
  2. If you did not set provider keys in backend/.env, open Account > Models & API Keys and add an Anthropic, Gemini, or OpenAI API key.
  3. To use legal research tools, add a CourtListener token in backend/.env or Account > Models & API Keys.
  4. Create or open a project and start chatting with documents.

Troubleshooting

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.

CourtListener tools say the API token is missing. Set COURTLISTENER_API_TOKEN in backend/.env, or add a CourtListener token in Account > Models & API Keys for the signed-in user. Restart the backend after changing .env.

CourtListener bulk lookup is not returning local results. Confirm COURTLISTENER_BULK_DATA_ENABLED=true, the two CourtListener tables have been populated, and opinion JSON exists in R2 under courtlistener/opinions/by-cluster/. If bulk data is unavailable, Mike falls back to the live API when a token is configured.

DOC or DOCX conversion fails. Install LibreOffice locally and restart the backend so document conversion commands are available on the process path.

Useful Checks

npm run build --prefix backend
npm run build --prefix frontend
npm run lint --prefix frontend