Route WPT 01 PORTL · Client work · sole developer
Operations portal for a multi-branch inspection company
Lab-report drafting went from most of a working day to about 51 seconds, and the field team moved onto the portal.
row-level security, 32 tables
01Context
A multi-branch environmental inspection company ran intake, jobs, lab results, and chain-of-custody across scattered tools, with no control over who could see what.
I am the only developer. I scoped the field workflow with the owner, then built, secured, deployed, and supported the portal the company now runs every day. The client is unnamed here, and its code is private.
02Key decisions
Four levels of staff, from headquarters down to technicians, each needing a different view of the same data.
- Choice
- Enforce the role hierarchy in the database with row-level security, not only in the interface.
- Tradeoff
- More policies to write and test, but a bug in my own application code cannot leak another branch's records.
Lab reports were assembled by hand from emailed lab results, which took most of a working day.
- Choice
- Use Claude vision to extract the lab values, with a confidence score per row and a human verify step before anything is generated.
- Tradeoff
- A person still confirms every value, so the speed-up is in drafting, not in skipping review.
AI routes are easy to add and easy to get wrong.
- Choice
- Seven static CI guard tests fail the build if an AI route is ungoverned, receives a database client, or renders model output as HTML.
- Tradeoff
- New AI features take a few more minutes to wire up, on purpose.
03Evidence
- 4-tier role hierarchy enforced in 68 row-level security policies across 32 tables.
- 8 AI routes in daily use: lab-report extraction, photo-driven quick-fill, report and email drafting, and a read-only assistant.
- Photo evidence kept as evidence: HEIC conversion, capture-metadata stamps, and immutable chain-of-custody records.
- Upgraded production to Next.js 16 and React 19 while closing known-vulnerable dependencies.
- WCAG 2.1 AA pass and a human-error audit of every screen before onboarding the field staff.
04Results
- Reports that took most of a day now draft in about 51 seconds, then go through human review and signature.
- Field photo uploads grew from 4 to more than 1,100 a month over three months, tracked by an append-only event log and an Insights dashboard I built.
- Field staff run the portal from docs I wrote, without asking me for help.
- 1 Measured in the app across 147 report generations. Drafting time only. Human review adds a median of 80 minutes from draft to signed report.
- 2 Monthly uploads counted by the portal's own event log, first month versus third month.
- 3 Merged pull requests on the production repository over a 100-day window.
05Stack
Next.js 16 · React 19 · Supabase · PostgreSQL RLS · Edge Functions · Anthropic Claude · Vercel · Capacitor iOS · GitHub Actions
Want this kind of work on your product?
Email me