Blog · 2 October 2026

Building a booking tracker on VanillaSaaS Core

The first real app built on VanillaSaaS Core is a booking tracker for someone who works for themselves: a mobile hairdresser, a tutor, a personal trainer. Clients, appointments, and a dashboard with three numbers.

This is the full account of what was added, including the two things Core turned out to be missing.

The rule: don't touch Core

Core's code lives in app/lib/. The rule for anyone building on it is never to edit that folder, so that a future fix is a file replacement instead of a merge. A rule like that is only worth stating if it survives a real build, so the tracker was built under it.

It held. Nothing in app/lib/ was changed. Everything went into the files Core leaves to you:

AddedWhere
Two tablesOne migration file per database
Queries, validation, convertersapp/custom/bookings.php
Four pagespublic/clients.php, client-edit.php, appointments.php, appointment-edit.php
TemplatesFour pages and five shared partials in app/views/
Sidebar linksTwo lines in the layout

Two tables

clients and appointments. Both carry user_id with ON DELETE CASCADE, so deleting an account deletes its data, and an appointment cascades from its client the same way.

Two storage decisions are worth copying.

Prices are whole pence, not pounds. £45.50 is stored as 4550. Store money as a decimal fraction and you inherit floating-point arithmetic, where 0.1 + 0.2 is not 0.3. The form accepts "45.5", and the conversion to pence works on the text, so no float is involved at any point.

Times are stored in UTC and shown in local time. The browser's date-time field sends wall-clock time with no timezone. The app converts it to UTC on the way in and back on the way out. Skip this and every appointment shifts by an hour when the clocks change.

The one rule that matters in a multi-user app

Every query includes user_id.

function client_find(int $id, int $userId): ?array
{
    return db_one('SELECT * FROM clients WHERE id = ? AND user_id = ?', [$id, $userId]);
}

The id comes from the address bar (client-edit.php?id=12), and anyone can type a different number. With user_id in the query, 12 only ever matches a row the signed-in user owns. Somebody else's row is simply not found, and the page answers 404.

The less obvious case is the appointment form. It posts a client_id from a dropdown, and a dropdown is only a suggestion: the browser will send whatever it's told to. So before saving, the app checks that the chosen client exists and belongs to this user. Without that, a forged form could attach an appointment to a stranger's client.

The same goes for the status dropdown. The handler accepts only the three values it knows.

What Core was missing

Building on your own product is the cheapest test there is. This build found two gaps, both now fixed in Core 1.0.0.

No styles for tables, dropdowns or text areas. Core's stylesheet covered text, email and password fields, because those are all a login needs. The first real feature needed a table and a <select>, and both came out unstyled. Core now ships tables, dropdowns, text areas, date fields, status badges and small buttons.

The phone layout scrolled sideways. With two sidebar links it was fine. With four, the menu pushed the page wider than the screen, and so did any wide table. The fix was two lines of CSS, but anyone building on Core would have hit it on day one.

Neither would have shown up in a test of the login flow. They only appear when you build something.

The demo problem

A public demo anyone can use is a demo anyone can abuse. There were three risks.

Vandalism. The obvious design is one shared demo account. Then the first visitor to type something offensive greets everyone after them. Instead, each press of "Try the demo" creates a private throwaway account with its own sample data. Nobody sees anyone else's, and nothing needs locking: a visitor can change the password or delete the account and only affect themselves.

Spam. A password-reset form that emails any address typed into it can be used to pester strangers from your domain. The demo never sends email. Messages are written to a log file instead, and the reset page says so.

Clutter. Throwaway accounts pile up, and people type real names into demos. A script wipes everything nightly, and it refuses to run unless demo mode is switched on, so it can't be pointed at a real site by mistake.

The throwaway accounts use addresses ending in .invalid, a domain reserved so that it can never exist. They can't collide with a real person's address and can't receive mail.

What it adds up to

One migration, one file of functions, four pages. Turn demo mode off and what's left is a working booking tracker.

The pattern is the same for any app where each user manages their own records: a table with user_id, functions that always scope by it, a page that guards, validates, saves and redirects. The docs walk through it with the clients feature as the example.

What it isn't

It's a private diary. The owner types every appointment in, which is fine for learning the pattern and not what a business pays for. A tutor or a physio wants their customers to book themselves, and that adds problems this build never met: two people choosing the same slot in the same second, opening hours across a clock change, a cancel link for someone with no account.

Those are solved in the Bookings blueprint, which starts from this code. The tracker is the one to read. The blueprint is the one to deploy for a client.