Demo 2 · Capacity engine
A spin studio, a padel club and a project office on one engine.
Two primitives cover all three: interval claims (one bike or court, exclusively, for a time range) and quantity claims (hours from a person per week). Postgres refuses a double booking with 23P01 and an over-allocation with P0001.
Owner and staff
Staff calendar
Week views per business, themed with each business’s palette.
- Spin Mitte: bikes × classes, floor plan per class
- Padel Ost: courts × time, 90 minutes in 30-minute steps
- Nordwerk: people × weeks with an allocate form
- Try “Book anyway” on a taken bike and allocate 20 backend hours twice
Booking page
Only free slots. Pick a day, a class or start time, then a bike or court on the floor plan, and hold it while paying.
- Hold with a countdown (15 minutes at Spin Mitte, 10 at Padel Ost)
- “Continue to payment” hands the claim to the Checkout demo
- Open the staff calendar in a second tab: the hold shows up there
Jump to a business
Spin Mitte · staff
Padel Ost · staff
Nordwerk Projektbüro · staff
Spin Mitte · booking
Padel Ost · booking
How it runs
| Mode | Reads | Writes |
|---|---|---|
| Live (runtime + Supabase) | /api/capacity/… → capacity RPCs | RPCs with the secret key, server side |
| Runtime without Supabase | Seed businesses + seeded claims, computed with engine.js | API answers 503; the page keeps claims in this browser |
| Static files | engine.js in the page with the seeds | Claims in this browser (localStorage, synced between tabs) |