Dshamir rips out Mike's database plumbing and quietly adds an audit trail

A full rewrite of how the backend talks to its database, with two changes that matter to lawyers tucked inside.

infrastructurecompliance

Dshamir swapped the entire backend off one database toolkit and onto another (Prisma, a popular way for apps to read and write their data). On its own that's plumbing - invisible to anyone using the product. But the rebuild was the moment to bolt on two things a legal buyer should notice.

First, a new audit log: a running record of actions taken in the system. Second, "soft delete" - when a project, document, chat, or review is deleted, it's marked as gone rather than actually erased, so records can be recovered and are hidden from normal views automatically. Both are the kind of groundwork you want underneath anything handling client matters, where "who touched this" and "can we get it back" are real questions.

So what Anyone weighing Mike for regulated or client-facing legal work should note the foundation now being laid for audit trails and recoverable data.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

6 commits from Dshamir/AI-Legal, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
7af01ab6 [P3] chore: initialize Prisma ORM Dshamir 2026-05-23 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
872dcfc5 [P3] feat: add complete Prisma schema with enums and soft-delete Dshamir 2026-05-23 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
139c4d38 [P3] feat: add Prisma client with soft-delete extension Dshamir 2026-05-23 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7b042604 [P3] feat: add audit log utility Dshamir 2026-05-23 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
54378941 [P3] feat: add Prisma seed script Dshamir 2026-05-23 ↗ GitHub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9485e7d9 [P3] feat: migrate all routes and libs from Supabase SDK to Prisma Dshamir 2026-05-23 ↗ GitHub
commit body
Replace every supabase.from() query across 13 files with Prisma client
calls. Auth middleware (auth.ts) intentionally retained Supabase for
admin.auth.getUser(). Added audit logging on create/update/delete
operations in route handlers.

Files migrated:
- Routes: chat, projectChat, projects, documents, tabular, workflows,
  user, downloads
- Libraries: access, chatTools, documentVersions, userApiKeys,
  userSettings

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-521.md from inside the repo you want the changes in.

⬇ Download capture-thread-521.md