Skip to content

Build a Booking System for a Coaching Studio

Davor Minchorov•Intermediate•7 to 8 weekends•October 29, 2026

A six-coach studio sells the same hour twice, moves coaches' sessions by an hour when the clocks change, and locks out members who have paid, because its booking page trusts whatever reaches it first. You will build the replacement, from a coach's weekly hours through a monthly plan to a booking that spends a credit, and prove it over a simulated week in which Europe changes its clocks and New York is still a week away from changing its own.

The brief

The client

I run a coaching studio with six coaches and about 140 members, a dozen of them in New York, all on a monthly plan with two or four sessions. Members book through a page that checks the coach's calendar and then saves the booking, so when one coach opened her Saturday mornings, two members were booked into the same 10:00 hour because both pages saw it free before either saved.

After Europe changed its clocks, her Wednesday 09:00 sessions showed as 08:00 on her own calendar, and our New York members saw their own shift a week later. A member who fixed her card after a failed renewal stayed locked out for two days, because the failure notice from our payment provider reached us after the notice that her retry had gone through. A coach's private notes once appeared on a member's page.

I need an hour that is sold once, a plan that decides what a member may book, and a way to prove both before the next coach opens a month.

The problem

Two members who ask for the same hour at the same moment both get it. A failure between recording a booking and taking its credit leaves a spent credit with no booking, or a booking nobody paid for.

A coach's weekly hours drift by an hour when her region changes its clocks. The United States and Europe change on different weekends, so a member in New York sees a different gap to Amsterdam for a week (in autumn 2027, from 31 Oct to 7 Nov 2027).

The payment provider reports renewals by notice. Notices arrive twice, late, out of order or not at all, and the studio acts on each as it arrives, so a failure notice that reaches it after the payment that fixed the problem locks out a member who has paid. A coach's private notes about a member appear on a page that lists "notes" for her. The studio pays for each of these in refunds, apologies and members who leave.

The client's name and figures are invented for this brief; the rules and the failures are ones that real businesses of this kind work with.

The spec

Requirements

  • Let a coach publish weekly hours in her own time zone, with buffers between sessions, a minimum notice and holidays.
  • Let a member see open slots in her own time zone and book one, with at most one booking able to hold any coach's time.
  • Let a member subscribe to a monthly plan that grants session credits, and let the subscription's state decide whether she can book.
  • Spend one credit for each booking, taking the credit that expires first, and never leave a booking without its credit or a credit without its booking.
  • Let a member or a coach cancel. Keep the credit when the member cancels at least 24 elapsed hours before the start or the coach cancels at any time, and forfeit it otherwise.
  • Keep access right when a renewal notice arrives twice, arrives late or out of order, or never arrives, so that access follows what the payment provider says now.
  • Expire a credit 90 days after it was granted, and refuse to spend one that has expired.
  • Let a coach keep private notes about a member and share homework with her, and keep the private notes away from the member and from everyone but their writer.
  • Give a person a copy of her data, or erase it, on request.
  • Give an operator one check that reports overlapping bookings, balances that differ from their credit history and confirmed bookings without exactly one spent credit.

Deliverables

  • Your repository starts the whole studio with one command and seeds 6 coaches and 140 members, 12 of them in New York.
  • A README that takes a reviewer from a fresh clone to a booked session with a spent credit, and a passing consistency check, in 15 minutes, and lists the command for each test.
  • A way to play the studio's week faster than real time: move the studio's clock, run a simulator that plays the members, the coaches and the payment provider, and make the provider do each bad thing this brief names (answer slowly, send a notice twice, send a failure after a later payment, send nothing, decline a card that needs its owner, stop).
  • Documentation of the studio's interface that a studio's front-end developer could use for availability, slots, subscriptions, bookings, notes, copies of a person's data and erasure.
  • A test suite that covers clock changes in two regions, late, repeated and missing payment notices, requests sent at the same moment and not one after another, the studio's process stopped in the middle of work, and a sweep for private note text, plus the results of the simulated run committed to your repository.
  • An operations note that says how an operator runs the consistency check, settles subscriptions by hand against the provider, runs credit expiry by hand, moves the studio's clock, and sees why an erasure is blocked.

Out of scope

  • One part of the studio being stopped while the rest keeps working. That belongs to Build a Coaching Platform.
  • A video provider, a join log and no-show detection. A session is a time the coach and member agree on, and the coach sends her own link. Creating meetings and treating a vendor outage as normal is the larger brief's subject.
  • Messaging between sessions, reminders and booking emails. A reminder in the recipient's zone repeats the clock-change lesson from Phase 2.
  • Coach payouts, commission, refund reversals and card disputes. The studio pays each coach a fixed fee per session by hand.
  • Moving a booking in one action, the emergency pass, group sessions and recurring bookings. A member cancels and books again.
  • Coach discovery, search, reviews and syncing with a coach's outside calendar. An outside event that arrives after a member booked the hour would take it away from her.
  • Employer-paid engagements. They add a third party to the confidentiality rules; this brief stays with a coach and a member.
  • A real payment provider. You build a stand-in so that your tests control when it fails.
  • Checking that a payment notice really came from the provider. The brief tests order, repeats and absence, not forgery.
  • A login. Each request says who is acting, however you choose to carry that. Do not put this application on the internet.
  • A web or mobile app. A documented interface and the simulator stand in for them.
  • Tax and VAT, refunds of subscription fees, and the right to withdraw from a contract. The studio refunds by hand in the provider's dashboard, and the brief fixes no tax rule.
  • Purging old records. Dutch rules oblige the studio to keep its business records for 7 years (Belastingdienst), so the brief builds no purge and erasure keeps those records, identified by an ID.

Architectural constraints

  • Amounts are whole cents in one currency, the euro, and exact to the cent.
  • No card number is ever stored. The studio keeps only a label for a card.
  • A coach never has two bookings at the same time, and the buffer after a session counts as part of the booking.
  • A booking and its credit are never apart: a booking without a spent credit, or a spent credit without a booking, never survives a failure.
  • A credit balance is never below zero and always equals the history of grants, spends, restores and expiries behind it. A correction adds a line to that history and never changes one.
  • A coach's weekly hours mean the same clock time on her own calendar all year. The 24-hour cancellation cutoff counts elapsed hours, not the same clock time on the day before.
  • A member who has paid is never locked out by a notice that is old, repeated or wrong. Access follows what the payment provider reports now.
  • A private note is never visible to the member it describes, to any other coach, or in any log.
  • A person's personal fields are erased on request, while credit history and booking records stay, identified by an ID.

Prerequisites

You have built one application with a database, in any stack. You have never built anything that two people can book at the same moment, and you do not need to know time zones beyond "they exist". You do not need to know how a coaching studio sells and runs its sessions; the first Phase explains the business and the words the brief uses. Having once chased a bug caused by two requests arriving at the same moment will make Phase 4 familiar. If you want a gentler start in the same domain, Build a Session Pack Tracker comes first. When you finish, Build a Coaching Platform takes the same problems further.

Create a free accountSign in

Free to start. An account is what keeps track of the checkpoints you finish.

Phase 1

Work out the studio's rules by hand

Produces two documents worked by hand: a table of every way a booking can end and what its credit does, and the studio's sessions across Europe's and the United States' clock changes. No code yet.

Research

Research

Architectural walkthrough

How a coaching studio sells and runs its sessions

The studio has six coaches and about 140 members. A member pays a monthly plan with two or four sessions and books each one on the studio's page, with the coach she chooses. A dozen of the members live in New York.

Each coach sets her own weekly hours in her own time zone, with a gap between sessions, a minimum notice before a booking and days off. A session is a time the coach and the member agree on, and the coach sends her own link. The studio takes the card payment through a payment provider, which sends the studio a notice each month when a plan renews or fails to renew. A coach also keeps private notes about a member and shares homework with her. The studio pays each coach a fixed fee per session by hand.

In a normal month a member books the two or four sessions her plan grants and sometimes cancels one. Twice a year Europe changes its clocks, and the United States changes on a different weekend. In autumn 2027 the two are a week apart, from 31 Oct to 7 Nov 2027.

The words this brief uses:

  • Session credit: the right to one session. A plan grants credits each month, and a credit expires 90 days after it was granted.

  • Monthly plan: the subscription a member pays for, with two or four sessions a month.

  • Subscription state: whether the plan is paid up, which decides whether a member may book.

  • Renewal notice: the payment provider's message that a renewal went through or failed. It can arrive twice, late, out of order or not at all.

  • Buffer: the gap a coach keeps after a session. It counts as part of the booking.

  • Minimum notice: how far ahead a booking must be made.

  • Clock change: the weekend a region moves its clocks an hour, in spring or autumn.

  • Elapsed hours: real hours between two moments, which differ from the same clock time on another day in a week when the clocks change.

  • Private note: a coach's note about a member that only its writer may see.

  • Erasure: removing a person's personal details on request. The studio still keeps its business records.

Why the rules are worked out by hand

This Phase builds nothing a member will see. Two parts of this brief are easy to get wrong by one hour, and a wrong hour is invisible in the code until a member complains.

A member who cancels a Sunday session 24 hours ahead, in the week the clocks change overnight, keeps or loses her credit depending on whether "a day before" means 24 elapsed hours or the same clock time on the previous day. Those two readings differ by an hour that week. A coach's Wednesday 09:00 sits a different distance from a New York member's morning in the week when one region has changed its clocks and the other has not. Built from a guess, both mistakes surface as a refused credit or a session at the wrong hour.

A booking also has moments where two things must be true together: the hour and the credit, the payment and the access. Writing those moments down before any code exists shows where the old page left a gap, and it gives the later Checkpoints answers that the product did not produce itself.

Phase 2

Publish coach time

Produces people with their time zones, coaches' weekly hours and the open slots each member sees in her own zone, ending in a test that stands on both sides of two regions' clock changes. Nothing can be booked yet.

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

This Phase builds the first half of the calendar: who the people are, when each coach works, and which slots a member can see. The failure it must survive is a coach's week drifting by an hour when her region changes its clocks.

In the old system, after Europe changed its clocks, a coach's Wednesday session read 08:00 on her own calendar, and a week later New York members saw their own hour shift because the United States changes on a different weekend. A member then arrives an hour early or an hour late, and a coach waits for someone who is not coming. A coach who says "Wednesday 09:00" means 09:00 where she is, in both seasons, without touching her settings.

A member who opens the calendar after the change and sees the old hours has the same problem. This Phase ends with a test that stands on both sides of each clock change with expected values you worked out by hand, because a clock-change fault appears twice a year and never in a test that runs on an ordinary Tuesday.

Phase 3

Sell plans and decide access

Produces a payment provider stand-in that misbehaves on demand, monthly plans, credits and the decision on who may book. No session spends a credit yet.

Implementation

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

This Phase builds what a member pays for, how many sessions it entitles her to, and whether she may book right now. The failure it must survive is the payment provider telling the studio the wrong thing at the wrong time.

Providers send a notice at least once, in no guaranteed order, and sometimes not at all. The studio's old system acted on each notice as it arrived, so a failure notice that reached it after the success notice for the retry locked out a member who had paid, for two days. A notice that never comes leaves a member who has paid without her credits until she writes in. A process that dies between learning of a payment and adding its credits gives her nothing, or gives her double when the work is repeated. The first costs a member and a refund, the second costs the studio sessions it was not paid for.

The stand-in for the provider comes first because you cannot test a rule against a provider that behaves. After it, the Phase turns payments into credits, and the studio's decision on who may book follows from what the provider says.

Phase 4

Book with a credit

Produces booking with a credit, one member per coach's hour, cancellation that restores or forfeits the credit, credit expiry and the first consistency check. No notes and no erasure yet.

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

This Phase finishes the booking side. A member books a coach's hour, the booking spends one credit, a cancellation restores or forfeits that credit, unused credits expire, and one check tells an operator whether the result follows the studio's own rules. The failure it must survive is two things happening at once.

Two members who opened the same Saturday hour on the old booking page were both told they were booked, and the coach had two sessions at 10:00. One of them was turned away at the door or refunded.

Other pairs have the same shape. A coach and a member cancelling one booking in the same second must restore one credit, not two. A booking and an expiry racing for a member's last credit must not both take it. A process that dies between recording a booking and finishing the rest of the work must not leave a half-done booking behind.

Phase 5

Keep notes, honour erasure and prove the run

Produces private notes, a copy of a person's data, erasure, a sweep that fails when a private note escapes, and a simulated run that proves the whole studio. Nothing is added after it.

Implementation

Implementation

Implementation

Testing

Testing

Architectural walkthrough

This Phase adds the last feature and then proves everything together. A coach keeps private notes about a member and shares homework with her, a person can ask for a copy of her data or for erasure, and a simulated run plays eight days of the studio against everything built so far.

The old system kept notes and homework in one place, so a page that listed "notes" showed a member what her coach had written about her. A note meant for the coach alone, shown to the member it describes, is the failure the studio has already lived once. A leak needs one forgotten line, which is why the test looks at everything that leaves the studio and not only at the code.

Erasure has its own failure: a person told she is erased while some of her data remains has been told something false.

The Phase ends on a simulated run that puts the clock changes, the races, the late notices, the stopped processes and the erasures into one week. Its output is committed so a reviewer sees the result without running it.

Architectural walkthrough

Two people ask for the last hour

A coach opens her Saturday mornings and two members book the same 10:00 hour, because both pages saw it free before either saved. Both are told they are booked. One reaches a coach who already has someone else, and the studio apologises and refunds her. The credit has the same weakness: if the process dies between recording a booking and taking its credit, the studio either gives away a session or keeps a credit for a session that does not exist. Neither shows up until a member phones.

The clock changes under a coach's week

A coach's Wednesday 09:00 reads 08:00 on her own calendar after Europe changes its clocks, and a week later New York members see their own hour shift because the United States changes on a different weekend. Members arrive an hour early or late. The cancellation cutoff has the same trap: in the week the clocks change, "24 hours before" and "the same time yesterday" differ by an hour, and the wrong reading forfeits a credit the member was entitled to keep.

A late notice locks out a member who paid

The payment provider sends notices at least once, in no guaranteed order, and sometimes not at all. A failure notice that reaches the studio after the notice that her retry went through locks out a member who has paid, and she stays locked out until she writes in. A notice that never comes leaves her without the credits she paid for. A process that dies between learning of a payment and adding its credits gives her nothing, or gives her double when the work is repeated.

Two requests at the same moment

Other pairs have the same shape. A coach and a member who cancel one booking in the same second must restore one credit. A booking and the expiry of a member's last credit that arrive together must not both take it. A test that sends these requests one after another passes whether or not the product handles them, so the check to run on your own build is whether the requests were really sent at the same moment.

What a leaked note or a half-erased person costs

A private note shown to the member it describes costs the studio her trust in every note a coach writes afterwards. A person told she has been erased while a card label or a note about her remains has been told something false, and a process that dies halfway leaves her partly erased unless the studio can tell. Check, in your own build, what a sweep of every response, every log line and everything an operator can inspect finds, and what an erasure interrupted at each step leaves behind.

Where it shows if you cut a corner

Four symptoms show a cut corner. Two members arrive for the same 10:00 hour and one is refunded, or a credit is missing for a session that was booked. A coach's Wednesday 09:00 reads 08:00 after Europe changes its clocks, or a member loses a credit she was entitled to keep in the week of the change. A member who paid stays locked out until she writes in, or holds double the credits she paid for. A sweep of the responses and logs finds a private note shown to the member it describes, or a card label for a person who was told she had been erased.