Fitness

Class passes and bookings for a yoga studio

A yoga studio sells class passes of five or ten classes. Students book a spot in a class from their phone, a pass is deducted when they attend, and the teacher sees who is coming. Passes expire after three months and students can see how many they have left.

Automatically generated draft

Written by machine against our own engineering playbook. The company is invented; the decisions are the ones we would make on a real build. A reviewed blueprint goes further — nine sections, agreed line by line, and it is what the build is tested against.

Section 01 · What has to work

The system's core function is enabling a student to reliably book a class spot using a pre-purchased pass.

Section 03 · Screens

Every screen, and what it is for.

  • ›Class Schedule — Student views upcoming classes and books a spot. Available spots must update instantly.
  • ›My Passes — Student views their pass balance and expiration date. The balance must be exact.
  • ›Class Roster — Teacher views the list of students booked for their class. The list must be live.
  • ›Check-in — Teacher marks a student as attended, deducting a pass. The deduction must be instant.

Anything not on this list is not in version one. That is what keeps a fixed price fixed.

Section 04 · The data model

What it stores, and who can read a row.

User

id uuid, email text, name text, role enum('student', 'teacher', 'admin')

Access · A user can read their own row; admins can read all.

ClassPass

id uuid, user_id uuid, initial_credits int, remaining_credits int, purchase_timestamptz timestamptz, expiry_date date

Access · The owning student can read their passes.

Class

id uuid, teacher_id uuid, start_time timestamptz, duration_minutes int, capacity int

Access · Any authenticated user can read class details.

Booking

id uuid, class_id uuid, user_id uuid, class_pass_id uuid, status enum('booked', 'attended', 'cancelled', 'no_show')

Access · The student and the class teacher can read the row.

Those access rules belong in the database, not in the screens. Someone who edits the address bar still cannot read a row that is not theirs — and the test that proves it blocks delivery if it fails.

Section 05 · States

booked → attended | cancelled | no_show

Most scope arguments three weeks into a build are really arguments about a state nobody named at the start.

Section 06 · Where this breaks

What bites products like this one.

Two students book the last spot simultaneously, overbooking the class.

Use database transactions with row-level locking to ensure atomic updates to class attendance counts.

Teacher has poor connectivity in the studio and will not be able to load the class roster.

The roster screen will cache the student list and show a 'last updated' timestamp.

A student in a different time zone sees the wrong class time.

Store all times as timestamptz (UTC) and display them with the studio's local timezone identifier.

Section 08 · Deliberately left out

What version one does not do.

  • ×Automatic waitlists for full classes. It adds complex notification and state logic. Add when classes are consistently full.
  • ×Automated cancellation policies and credit refunds. V1 can use manual cancellation. Add when support load for this becomes high.

This is the section that protects the date, and the only place in the document where somebody says no. It is also why clients trust the rest of it.

Still open

What we would ask before quoting.

  • How will students pay for class passes? Does this system need to integrate directly with a payment processor?
  • What is the business rule for a student cancelling a booking? Is the pass credit returned, and under what conditions?
  • Do all passes work for all classes and teachers, or are there restrictions that would affect booking?

Half of this already exists

Renewal Engine

The billing half of this is a solved problem: recurring charges, a retry ladder on failed cards, access cut and restored automatically.

It is one of our pre-built products: the code is handed over to you, adapted to your own wording and rules, and the rest of the specification above is built on top of it rather than from scratch.

Your product, not this one

Get this written for what you are actually building.

Describe it in a sentence and the generator returns the same sections for your own product. Free, no email, nothing saved to a list.

Next step

Find out if your idea fits in 10 working days.

Tell us what you want to build. We reply the same day with a straight yes, no, or here is what we would cut.

NDA available on request