A vertical mini-ERP for an ambulatory surgery center. Five linked tables, a drawer that resolves foreign keys live, operator KPIs that recompute on filter — and an insert form per tab so a new row propagates through the whole model.
Five operational KPIs, not twenty. The people who run this clinic every day measure what was collected, what's still outstanding, how full the rooms are, how often the day falls apart, and how well the valuation funnel converts. Everything else is pretty noise.
Consult → surgery conversion is the most undervalued metric in an ASC. It's where the surgeon wins or loses the day — and where you find out whether pre-auth is a real bottleneck.
The surgeon filter sits at the top on purpose: the owner wants to look at the staff, the surgeon wants to look at themselves. Same dashboard, two readings.
Writes to local state. KPIs recompute, the new row appears in its table, and the drawer opens on the new record so you can see the FKs resolve.
useState are the entire database. FKs are string IDs (pat-001, con-019) — exactly what a Supabase seed would look like.SCHEMA object describing table, PK, field types and relations. Same source of truth a real migration would generate.clinic_id, and triggers to keep consistency (completed surgery → expected charge).The same skeleton works for dental clinics, imaging centers, infusion suites, fertility, or any service business where the asset is equipment-time and billing flows through insurance + patient. The work is modelling the right 4-5 tables, not building the 100th CRUD in the industry.