The challenge
Immigration firms handle regulated client data, run multi-stage case workflows, and coordinate across vendors and resellers. Each tenant needs full isolation, five distinct roles need different views, and any leak of another tenant's data is a compliance incident — not a bug.
The approach
Next.js frontend on Vercel, FastAPI backend on Railway, Supabase PostgreSQL with row-level security tied to JWT claims. Tenant identity is enforced at the database layer, so every query is scoped whether the caller is a UI, API, or admin script. Diagnostics endpoints expose connectivity and auth state without leaking data — critical for shipping and debugging in production.