Primo AI StudioInsights← Back to homeClient: Torque Performance (baseball training academy, El Paso TX) Goal: Replace manual admin with a self-serve member platform for parents and players Stack: React + Vite + Supabase + Clerk + Stripe + Vercel Timeline: ~3 months
Torque Performance is a baseball training academy serving youth athletes. Like most local academies, they ran on:
The result: admin work was consuming significant founder time, and scaling past the current family base meant either hiring office staff or rebuilding the entire operational backend.
They chose to rebuild the backend.
Branded login with Clerk authentication. Each family sees their own kids, sessions remaining, and upcoming bookings. Real-time updates when sessions are deducted via check-in. Mobile-responsive — most parents check from their phones.
Four packages × four billing intervals = 16 Stripe Price IDs, all mapped automatically:
client_reference_id encoding pattern: userId__kidName__priceId — the webhook knows exactly who and what to creditplayer_memberships table in Supabase tracks every active membership. Webhook fires on checkout.session.completed, decodes the reference ID, creates or updates the membership. Includes failure handling, retry logic, and idempotency keys. Refunds and cancellations automatically sync membership status.
Admin-only interface, separated by RLS policies. Coach taps player name → confirms session → balance decrements in real-time. Full audit log of every session deducted — disputes resolved by reviewing the log, not memory.
Parent must accept the waiver before Stripe checkout opens. Modal intercepts the checkout button. Acceptance logged with timestamp and IP for legal protection. Re-accepts on contract updates.
Solved a Supabase RLS edge case using ::text cast for ID type mismatches — admins can edit any record, parents can only edit their own. All auth scenarios tested. Documented in-repo so future maintainers don't rediscover the issue.
Complete redesign across all major components. Most parents sign up and check balances from their phones — the experience is built around that reality.
Technical infrastructure:
Operational impact:
Scalability:
Stripe webhooks need a debug layer. The client_reference_id encoding pattern is clean until you need to trace which membership got credited for a parent with three kids. We built admin tooling to inspect and replay webhook events alongside the integration. Lesson: always build the debug UI with the feature.
Supabase RLS is powerful but precise. The ::text cast for ID type mismatches is the kind of detail that costs hours without prior knowledge. Every RLS policy is documented in the repo so future maintainers have context.
Mobile-first isn't optional for local services. Almost every parent signed up from their phone. Building desktop-first and adapting would have failed the core user.
| Tool | Purpose |
|---|---|
| React + Vite | Frontend |
| Clerk | Authentication |
| Supabase (Postgres + RLS) | Database + permissions |
| Stripe Checkout + Webhooks | Payments + reconciliation |
| Vercel | Hosting + edge functions for webhooks |
WANT RESULTS LIKE THESE?
Start with a free 20-min AI Opportunity Scorecard. We'll show you where the biggest ROI is before you spend a dollar.
Book a free call →MORE CASE STUDIES