Case study

SpiralClass

Booking, class packages, payments and video for independent teachers. Built and run solo.

I build and run it with coding agents, working with a teacher on what she and her students need. Most of the code is agent-written; I review it, test it and run it.

Role
Everything, solo, with coding agents under review
Status
Live Used by a teacher and her students, taking real payments
Stack
TypeScript, Next.js, Postgres and Prisma, Stripe Connect, Wise, LiveKit video, Claude, Deepgram, Google translation
Links
spiralclass.com · demo · source · decision records · architecture

Payments that skip the platform

The first design collected money on the platform and passed it on. That broke payouts in the launch market and put the platform in the middle of disputes.

Now Stripe charges on the teacher's own account and pays her locally. Wise covers teachers outside Stripe.

  1. 1 · Student
    Picks a packageOn the teacher's booking page. A pending payment and a unique reference are written before any money moves.
  2. 2 · One of two rails
    Stripe CheckoutThe charge is created on the teacher's own Stripe account. Her country decides the methods: cards, OXXO, SPEI.
    or
    WiseA transfer to her Wise account quoting the reference. Her own API credentials reconcile it.
  3. 3 · SpiralClass
    Marks it paidA webhook or a poll confirms the payment and activates the package in one transaction. Then Inngest books the chosen slot and sends the confirmation.
  4. 4 · Teacher
    Has the moneyStripe pays her out locally. Wise money was hers from the start. The platform never holds it, so there is nothing to forward, withhold or reverse.
How a payment moves since 30 August 2026. Before that the platform collected and forwarded, which a UK entity cannot do to most of the world. D-143 records the reversal and what two earlier records got wrong.
Three phone screens showing a student choosing a class package, picking a time and paying, and seeing confirmation.
The student's side: choose a package, pick a first class, pay the teacher directly. Demo data.

One catch: a live checkout showed cards only, though the account said local methods were on. It had inherited a dashboard setting. Correcting it made OXXO and SPEI appear in a real checkout. A green flag isn't proof. The longer version is in my notes.

The teacher owns the method

One teacher had her own lesson structure; the AI lesson writer ignored it. Now teachers save templates, and the AI fills the chosen one for each student's level and goals. Optional, and it works for any subject.

Captions and learning notes

The teacher turns on live captions and each side sees the other's words as they are spoken, then the translation when the phrase ends. The browser does the recognising and, where it can, the translating. Deepgram covers a phone; Google covers the translation when the browser can't. Recognition runs in the browser, so no server of mine handles the audio, and it costs almost nothing to run. D-185 says why the earlier server-side design went.

With the student's consent the same text is kept as the class transcript. After class, Claude turns it into findings in five areas, each tied to the line that showed it. The teacher confirms or dismisses each one before it counts. The confirmed ones build the student's profile and a short brief before the next class.

Rules where they matter

  • A cancelled class restores or forfeits the right credit. classify.ts
  • Each payment reconciles to the right student and package. reconcile-paid.ts, wise-reconcile.ts
  • Students see only their own teacher's content. SECURITY.md says a missing teacher scope is a vulnerability, not a style nit.

The rules are pure functions; the handlers apply them. This one decides what a student's cancellation does:

// Decides what a student-initiated cancel does, given the package's
// schedule-change budget. Pure — the handler applies the mutations.
export function decideStudentCancel(input: {
  now: Date;
  scheduledStart: Date;
  scheduleChangesUsed: number;
  scheduleChangesAllowed: number;
}): StudentCancelDecision {
  const c = classifyStudentCancel({
    now: input.now,
    scheduledStart: input.scheduledStart,
  });
  if (c.deductsClass) {
    // <24h: forfeit (the penalty). Always allowed, never a schedule change.
    return {
      timing: c.timing,
      refundsClass: false,
      chargesScheduleChange: false,
      blockedExhausted: false,
    };
  }
  // ≥24h: a refundable cancel is a schedule change — gate it on the budget.
  const exhausted = input.scheduleChangesUsed >= input.scheduleChangesAllowed;
  return {
    timing: c.timing,
    refundsClass: !exhausted,
    chargesScheduleChange: !exhausted,
    blockedExhausted: exhausted,
  };
}
classify.ts, lines 98 to 127, with its tests. The budget exists because a per-booking cap could be dodged by cancelling and rebooking; the scheduling rules explain the policy.

Automated unit, integration and browser checks run before changes are merged, including domain tests against a real database. Documented engineering decisions say why things are the way they are, reversals included.

A month calendar of a teacher's classes with a newly booked 4:00 PM class on 13 October.
The teacher's month, with the class just booked on the 13th. Demo data.

What's proven

A running product used by a teacher and her students, taking real payments, with captions used in her classes. It's a small product; there is no claim of scale or measured checkout conversion gains.

He listens carefully, understands my needs, and responds to feedback with impressive speed and precision. He also brings a great deal of creativity and initiative to the table, often suggesting features I would never have thought of myself, like the subtitles, which have made a real difference to my experience as an online Spanish teacher.

A Spanish teacher on SpiralClass