Real Use Case

Use Case #6: Mock to Production Database

How Claude replaced all mock data with a real Supabase backend, complete with RLS policies, seed data, and Edge Functions.

W

William Welsh

Author

Jan 15, 2026
8 min read

Use Case #6: Mock to Production Database

We had a beautiful frontend. Every component polished. Every interaction smooth.

One problem: it was all fake. Mock data everywhere. MOCK_PATIENTS, MOCK_CLAIMS, MOCK_APPOINTMENTS. Demo-ready, production-useless.

The Challenge

This was a medical practice management app. Moving to production meant: real patient records (with HIPAA considerations), insurance claim processing, appointment scheduling, AI-powered SOAP notes, and treatment cost estimation.

All of that was mocked. Every. Single. Feature.

The Session

"Replace all mock data with real Supabase backend. Create tables, RLS policies, seed data, and wire up the services."

What Claude Built

Database Schema (20+ tables) - Core tables: patients, providers, appointments, encounters. Clinical tables: soap_notes, diagnoses, procedures, medications. Insurance tables: claims, claim_items, insurance_plans, authorizations. Scheduling: appointment_slots, availability_rules, waitlist.

Row Level Security - Every table got proper RLS. Patients only visible to their provider. Claims require authentication. Proper security throughout.

Seed Data - Realistic test data: 50 patients with varied demographics, 200 historical appointments, insurance plans from major carriers, procedure codes with accurate pricing.

Edge Functions - AI-powered features needed serverless functions: generate-soap-note (AI clinical documentation), estimate-treatment (cost prediction), scrub-claim (pre-submission claim validation).

Service Layer - Every mock was replaced with real API calls using Supabase client.

The TypeScript Marathon

After the backend was ready, the build failed. 15+ files with type errors. The mock data used different conventions: PascalCase vs camelCase, numeric IDs vs UUIDs, inline objects vs references.

Claude fixed every mismatch. Renamed properties, updated type definitions, created mapper functions where needed.

Time Comparison

TaskEstimateActual
Schema design8 hours45 min
RLS policies4 hours20 min
Seed data2 hours15 min
Edge functions6 hours35 min
Service layer8 hours40 min
Type fixes4 hours30 min
Total32 hours3 hours

Try It Yourself

Copy this to convert your mock data to a real database:

I need to replace mock data with a real database backend. Let me describe the current state:

**Current Setup:**
1. What framework is your frontend? (React / Next.js / Vue / other)
2. Where are mock files located? (path pattern like "src/mocks/*" or "I'll find them")
3. What database do you want? (Supabase / PostgreSQL / MySQL / other)

**Requirements:**
4. Do you need Row Level Security? (yes / no / not sure)
5. Should I generate seed data for testing? (yes / no)
6. Any serverless functions needed? (describe or "none")

I will:
- Find all mock data in your codebase
- Design appropriate database schema
- Create tables with proper relationships
- Add RLS policies if using Supabase
- Generate realistic seed data
- Replace mock imports with real API calls
- Fix any type mismatches
- Test the full data flow

Ready? Answer above or point me to your mock files.

The EDF-Pro app backend migration, January 2, 2026.

W

William Welsh

Building AI-powered systems and sharing what I learn along the way. Founder at Tech Integration Labs.

View Profile
Share this article:

Related Articles

View all →