The original recommendation answered the wrong question.
Supabase is removed from the recommendation. Harrison needs a VPS-owned application with direct control of PostgreSQL, object storage, networking, backups, retention and model egress. The repository search must begin with the complete AI onboarding case—not isolated database, document or workflow libraries.
Why Legalise is the closest match
Legalise is matter-first and chat-led. A user creates a matter, uploads documents, asks an assistant to work against selected sources, runs governed skills, reviews the output, records a named sign-off and exports the matter with documents, source anchors, outputs, decisions and audit evidence.
- 1Matter as authority
Isolation, ownership, retrieval, model posture, skills and audit are scoped to one matter—not a conversation.
- 2Documents and source anchors
Originals, extracted bodies, versions and citations are server-known. The model cannot invent the source record.
- 3Governed AI and skills
One model gateway controls providers. Imported skills are pinned to Git SHAs, inspected and granted matter-level capabilities.
- 4Named review and sign-off
AI output stays draft. A reviewer signs, signs with observations or rejects the exact content hash.
- 5Audit and portable proof
Consequential actions enter an append-only, per-matter hash chain. Exports contain a standalone Python verifier.
Translate the legal matter into Harrison’s application case
| Legalise primitive | Provider Compliance equivalent | Required extension |
|---|---|---|
| Matter | Provider-registration application | Entity, categories, service scope, Commission lifecycle |
| Parties and facts | Applicant, responsible people, roles and backstory | Qualifications, screening, suitability and approved org structure |
| Matter documents | Client evidence, plans, policies, master-pack files and forms | Category, edition, requirement, expiry and sensitivity metadata |
| Assistant + skills | Intake, org-chart, plans, policies, form-answer and gap-analysis agents | Stage gates, typed outputs and category-scoped tools |
| Source anchors | Claim → evidence → regulatory requirement | Exact form question, authority version and applicability |
| Sign-off | Consultant review, client confirmation and authorised declaration | Separate actor roles and transition permissions |
| Matter export | Review pack, clean pack and submission evidence set | DOCX/XLSX/PDF generation, manifest and Commission receipts |
| Audit chain | Case event and approval history | Tenant boundary, external anchoring and business-event vocabulary |
Run the complete product on the VPS
The core is a normal self-hosted application, not a managed backend product. PostgreSQL owns case state, full-text search, embeddings and audit. MinIO or encrypted mounted storage owns original and generated files. Redis or Valkey handles queues. Gotenberg and LibreOffice handle deterministic conversion. FastAPI exposes the domain API. React provides separate consultant and client workspaces. A single model gateway routes to local Ollama or approved API providers and records every call.
PostgreSQL 16 + pgvector
Cases, people, claims, evidence, gaps, decisions, versions, approvals, full-text retrieval and append-only events.
MinIO or encrypted volume
Unlimited within the VPS/storage budget, with hashes, versions, malware checks and rehearsed backup.
Redis/Valkey + Python
Extraction, generation, validation, notifications and resumable bounded jobs.
Gotenberg + LibreOffice
Office/PDF conversion behind pinned jobs and output manifests.
FastAPI + React
One owned codebase for case semantics, consultant work and the client portal.
Audited model gateway
Local models first where useful; optional external models through explicit case posture and egress controls.
What Legalise does not solve
- One deployment is one workspace; there is no organisation/team multi-tenancy, SSO, SAML or SCIM.
- Matter isolation is enforced in application queries rather than PostgreSQL row-level security.
- Some role gates are dormant by default and must be made real.
- Monitoring, alerts, incident runbooks, backup/restore operations and external audit anchoring are incomplete.
- The editor, model layer and workspace remain evaluation quality.
- The domain is legal matters, so almost every business object and workflow stage needs replacement.
These limitations turn directly into the Provider Compliance fork/spike checklist: tenant isolation, team/client roles, retention, backup/restore, monitoring, authority versioning, document fixtures and real-case evaluation.
Supplementary repositories by use case
These are sidecars or worker primitives. None becomes the case database.
| Use case | Repository | Verdict |
|---|---|---|
| AI workflow and RAG authoring | Dify | Optional sidecar; expose bounded tools only |
| External integrations and notifications | n8n | Optional; never case authority |
| Mixed-document extraction | Docling | Add when narrow parsers fail fixtures |
| Scanned PDF OCR | OCRmyPDF | Fixture-triggered worker |
| DOCX/XLSX/PDF mechanics | python-docx · openpyxl · pypdf | Adopt as bounded workers |
| Office/PDF conversion | Gotenberg | Adopt service primitive |
| PII detection | Presidio | Defence-in-depth after recall tests |
| Model traces and evals | Langfuse | Add when trace volume warrants it |
| E-signing | Documenso | Add only for a proven signature flow |
| Regulatory page monitoring | changedetection.io | Observation feed; human promotes authority |
| Rules, relationship auth, SSO | OPA · OpenFGA · Keycloak | Deferred until direct controls fail |
NocoBase is an interesting self-hosted AI/no-code business-system reference, but approval and advanced AI/workflow features are commercial and client-delivery rights depend on paid editions. Directus is a strong Postgres/files/permissions substrate, but it still requires the whole domain product around it. Neither replaces the owned case system.
The first build direction
- 1Spike the God source with synthetic data
Run Legalise only to experience its matter, document, skill, sign-off, audit and export loop. Do not ingest Harrison’s live files.
- 2Write the translation map
For every Legalise object, screen and event, decide reuse, replace or remove for provider registration.
- 3Build one owned vertical slice
Adaptive intake → evidence upload → cited draft → gap route → named approval → generated pack → verifiable export.
- 4Prove two cases
One successful and one incomplete case must pass source/version, tenant, approval, document and restore checks.
- 5Add sidecars only on evidence
Dify, n8n, Docling, Langfuse, OPA and other tools enter only when the vertical slice produces a measured gap.