Four tables, not forty.
Most service businesses need four or five linked tables, not forty generic SaaS objects. The data model is the transferable part.
- Healthtech · ASC operations
- 5 tables · 90+ linked rows
- Supabase-flavored schema
- Client-only · no API
- All values in USD
Why this dashboard and no other
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.
The workflow, and how much of it is built here.
Solid steps run in this sandbox. Dashed steps are what a real implementation adds. Select any step to read what it does.
- 01Schema
- 02Operate
- 03Derive
- 04Production
Five linked tables
Built in this demoAn ambulatory surgery clinic modeled as five linked tables: patients, valuation consults, surgeries, operating rooms and payments. Foreign keys are string IDs, as a database seed would have them.
In detail
- →Models an ambulatory surgery clinic as a mini-ERP of 5 linked tables: patients, valuation consults, surgeries, operating rooms and payments.
- →Each table is an Airtable-style view with a Supabase-flavored "schema strip", field-type badges and an RLS hint — selling the data model, not just the UI.
- →Click any row to open a drawer that resolves FKs live: see the patient with their consults, surgeries and payments — or the surgery with its origin consult and associated payments.
- →Dashboard with operator KPIs (OR utilization, consult → surgery conversion, AR outstanding, payer mix, cancellation rate) that recompute when you filter by surgeon.
- →Insert form per tab: add a patient, consult, surgery or payment and watch the KPIs, related rows and drawer reflect it instantly.
- →Five typed TypeScript arrays in
useStateare the entire database. FKs are string IDs (pat-001,con-019) — exactly what a Supabase seed would look like. - →The "schema strip" reads from a
SCHEMAobject describing table, PK, field types and relations. Same source of truth a real migration would generate. - →KPIs are pure functions over the filtered arrays — they group, aggregate and derive ratios on the fly. No table library, no global state.
- →Inserts append to the array and auto-open the drawer on the new record so you see the FKs resolve. A reset button rolls everything back to the seed.
- →No backend, no real Supabase, no Airtable, no API. Fully client-side and deterministic.
- →Real Supabase with versioned migrations, RLS by
clinic_id, and triggers to keep consistency (completed surgery → expected charge). - →Full CRUD with validation, undo, audit log and a permissions model (front desk, biller, admin, surgeon) — different verbs per role.
- →Integrations where it hurts: 837/835 clearinghouse to reconcile payments, Stripe Terminal for POS, and a bridge with the scheduling system to avoid a double source of truth.
- →HIPAA: BAAs with every vendor, column-level encryption for PII, retention policy, breach-notification and access logs surfaced in the dashboard.
- →Assisted onboarding: import patients from CSV/EHR, map referring MDs to a canonical table, and a "demo mode" so the operator can play with the tool before committing.
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.