03Case Studies

Engineering
Case Studies

Six systems taken apart: the constraint that shaped each one, the architecture decisions behind it, and the technical wins that made it hold up in production.

Browse all 44 AI projects
CASE 01Healthcare · Medicaid intake

Hayaat Intake AI

Voice and SMS intake for Medicaid home-help

A Next.js 16 App Router application for a Michigan Medicaid home-help agency. Vapi voice intake, Twilio SMS with OpenAI tool-calling, and Supabase (Postgres, Auth, Storage) power public intake plus a staff admin console gated by middleware and SSR sessions.

Next.js 16SupabaseVapiTwilioOpenAI gpt-4oTypeScript
Hayaat Intake AI

The Challenge

Intake was manual and fragmented: phone-heavy triage, inconsistent capture of client versus caregiver context, and slow handoff into applications and staff workflows. Every channel produced its own island of data.

Engineering Architecture

  • App Router with server componentsAuth-sensitive reads stay on the server, while interactive widgets — the Vapi call button, chat widget, and Kanban board — are isolated as client components.
  • Middleware scoped to /admin/*Public intake and landing pages stay frictionless; only staff surfaces pay the cost of session refresh and redirect.
  • Service-role Supabase inside webhooksTwilio and Vapi hit server-only routes where the service role bypasses RLS for trusted writes. The tradeoff is deliberate: correctness lives in application code, not client queries.
  • Recursive payload parsing for VapiVapi end-of-call payloads vary in shape. Deep key lookup makes the integration resilient to schema drift without redeploying the assistant.
  • Signed-URL document routeA private storage bucket with short-lived redirects avoids exposing raw paths and supports compliance-minded access to PHI documents.

Technical Wins

  • Resilient Vapi to CRM and SMS handoffThe webhook ignores non-terminal events, extracts caller metadata from nested JSON, upserts clients or caregivers by phone, fires a non-blocking application-link SMS, and writes intake logs — returning fast while downstream work continues.
  • Retroactive message linkingWhen the model invokes create_lead, the server upserts the client and then backfills earlier message rows that matched the session or phone number but had no client attached, repairing anonymous threads once identity is disclosed.
  • Middleware session hygieneInvalid refresh tokens are cleared before redirecting to login, which cuts stuck sessions and the support churn they generate for staff.
Voice and SMS intake unifiedSingle CRM with traceable historySigned URLs for PHI documentsStaff console with audit trail
CASE 02Salon & booking SaaS

COOARD

Multi-tenant salon and barber booking platform

Website development on Next.js 16 plus iOS and Android delivery through Capacitor, built as a multi-tenant salon platform with Stripe billing, RLS-first Postgres policies, and AI-assisted catalog automation.

Next.js 16Supabase RLSStripeCapacitorWhatsApp Cloud APITypeScript
COOARD

The Challenge

Salons needed one system for bookings, staff permissions, customer experience, and recurring revenue without leaking data across tenants — while supporting subscriptions plus prepaid WhatsApp credits and clean owner/staff/customer role separation.

Engineering Architecture

  • Route groups by business contextPublic, auth, protected, portal, and admin segments each carry their own layout and access assumptions.
  • Role resolution in middlewareUser, profile role, route intent, and subscription status are all resolved before a protected page renders.
  • RLS as the default security boundaryTenant and role rules live in SQL policies. Service-role clients are reserved for privileged flows — webhooks, system notifications, controlled updates.
  • Shared Supabase SSR cookie handlingOne cookie adapter keeps auth continuity intact across redirects, including the return path from Stripe Checkout.
  • Idempotent Stripe webhooksBilling state changes are replay-safe, so a duplicated webhook cannot double-credit an account.

Technical Wins

  • Tenant isolation that survives feature growthBecause isolation is enforced in SQL rather than in query builders, new surfaces inherit the boundary automatically instead of re-implementing it.
  • Two monetization models in one ledgerRecurring subscriptions and prepaid WhatsApp credits coexist, with top-ups and plan changes resolving against the same balance.
  • Omnichannel notification fan-outWhatsApp Cloud API, Resend email, and Firebase push share one dispatch layer, so a booking change notifies every channel a tenant has enabled.
Multi-tenant RBACSubscriptions plus prepaid top-upsiOS and Android from one codebaseAgentic catalog automation
CASE 03Marketplace · Creative economy

Twinsting

Role-aware talent marketplace with escrow

A multi-role marketplace on Next.js 15 with a TypeScript Express API. Its differentiator is artist-context middleware for assistants acting on behalf of talent, combined with Stripe Checkout and Connect payouts, escrow auto-release jobs, and Socket.IO chat.

Next.js 15ExpressSocket.IOStripe ConnectMongoDBRedux Toolkit
Twinsting

The Challenge

One platform had to serve artists, personal assistants, companies, and admins — where an assistant can legitimately act on an artist’s behalf without breaking security boundaries. Meanwhile payments move through checkout, commission split, escrow hold, timed release, and payout.

Engineering Architecture

  • Split frontend and APIA Next.js App Router frontend handles route segmentation and rich client state; an Express API owns auth, payments, role checks, wallets, and websockets.
  • Sensitive logic centralized server-sideAuthorization, commission, escrow, and payouts live where transaction boundaries can actually be enforced.
  • Socket.IO for chat, API as source of truthLow-latency events flow over websockets while REST endpoints remain authoritative for persistence.
  • Payment lifecycle isolated into services and jobsControllers stay thin; escrow release runs as a scheduled job rather than a request-path side effect.

Technical Wins

  • Contextual RBAC for assistants acting as artistsBeyond simple role checks, the API requires an active artist context header, validates the assistant-to-artist link, then sets an effective user context for the request.
  • Transaction-based fund movementCheckout, commission, escrow, and payout each move money inside explicit transaction boundaries, so a partial failure cannot strand funds mid-flow.
  • Scheduled escrow releaseTimed releases run as idempotent jobs, making the hold period a first-class part of the model instead of a manual admin task.
Multi-role payouts via Stripe ConnectRealtime order chatScheduled escrow releasesVerified profiles and reviews
CASE 04Enterprise procurement

CPMS

Comprehensive procurement management system

Enterprise procurement on Next.js 15 with Prisma and Auth.js RBAC — department-scoped workflows, presigned S3 uploads, and audit-friendly approval surfaces.

Next.js 15PrismaAuth.jsPostgreSQLS3TypeScript
CPMS

The Challenge

Procurement spans departments with different authority levels and a hard audit requirement. Requests, approvals, and supporting documents all needed to be traceable without forcing every action through a single admin bottleneck.

Engineering Architecture

  • Department-scoped RBACAuth.js sessions carry department and role, so approval authority is derived rather than hardcoded per route.
  • Prisma as the schema contractMigrations and generated types keep the procurement model consistent between API handlers and UI.
  • Presigned S3 uploadsDocuments move directly from browser to bucket, keeping large files off the application server while preserving access control.
  • Append-oriented workflow recordsStatus transitions are recorded rather than overwritten, so the approval chain reconstructs cleanly during an audit.

Technical Wins

  • Approval chains that survive reorganizationBecause authority derives from department and role at evaluation time, moving a person between departments does not orphan in-flight requests.
  • Upload path that scales with document sizePresigned URLs mean a large tender document never occupies application memory.
  • Audit reconstruction from first principlesEvery state change is queryable in order, so the answer to “who approved this and when” is a single query rather than a log hunt.
Department-level RBACPresigned document uploadsAudit-friendly workflowsReduced approval turnaround
CASE 05AI media SaaS

Tuttle

AI localization and video dubbing platform

An AI video dubbing SaaS built on React and Next.js, wiring HeyGen and DeepL into a metered localization pipeline with webhook-first Stripe billing and a secured admin surface.

Next.jsReactHeyGenDeepLStripeApp Router
Tuttle

The Challenge

AI localization is expensive per unit of work, so billing has to track real consumption rather than seats. The platform needed metered dubbing that stays accurate even when jobs fail midway or webhooks arrive out of order.

Engineering Architecture

  • Webhook-first billingStripe webhooks are the source of truth for entitlement, so the UI never grants capacity the billing system has not confirmed.
  • Metered dubbing pipelineUsage accrues per job against the customer’s balance, with failed jobs reconciled rather than silently charged.
  • Third-party isolationHeyGen and DeepL sit behind internal service boundaries, so a provider change does not ripple into product code.
  • Secured admin surfaceOperational tooling is separated from customer routes and gated independently.

Technical Wins

  • Billing that matches consumptionMetering at the job level keeps revenue aligned with actual AI spend instead of a seat proxy.
  • Out-of-order webhook toleranceEntitlement state converges correctly regardless of the order Stripe events arrive in.
  • Provider abstractionDubbing and translation vendors are swappable without touching the localization workflow.
Metered AI dubbingWebhook-first billingSecure admin surfaceMulti-language delivery
CASE 06Professional networking · Consulting

ConsultChat

Moderated professional networking and consulting

A Next.js social platform pairing moderated user-generated content with realtime messaging and Stripe-backed consultation workflows, delivered on web and iOS.

Next.jsTypeScriptMongoDBSocket.IOStripe
ConsultChat

The Challenge

A consulting marketplace carries two risks at once: unmoderated user content, and payments that must clear reliably before expert time is committed. Both had to be solved without making the product feel heavy.

Engineering Architecture

  • Moderation in the posting pathUser-generated content passes safety checks before it becomes visible, rather than being retracted after the fact.
  • Socket.IO for message deliveryRealtime transport keeps consultation threads responsive, with MongoDB as the durable record.
  • Stripe-backed consultation bookingPayment confirmation gates the consultation workflow, so expert time is only committed against cleared funds.
  • Shared web and iOS surfaceOne platform serves the browser and the App Store build.

Technical Wins

  • UGC safety without latency costSafety checks run in the posting path but off the render path, so feeds stay fast.
  • Faster message deliveryWebsocket transport measurably cut delivery time against the previous polling approach.
  • Payment reliabilityBooking state derives from Stripe confirmation, removing the class of bugs where a session exists without a cleared payment.
Moderated UGCFaster message deliveryReliable consultation paymentsWeb plus iOS delivery

// Get Started

Build Something
Intelligent.

Every system above started as a conversation about a constraint. Tell us yours.

Start a Project