Clearcoat Auto Spa: A PHP Booking Website for a Car Wash in Valencia City
Most car washes in our area still take bookings by text and Messenger, and Saturday mornings turn into a long line. I built Clearcoat Auto Spa, a complete nine-page booking website for a fictional car wash and detailing shop on Sayre Highway in Valencia City, to show what a small service business can get without paying monthly for a booking platform.
Customers pick their vehicle, a service, a detailer and an open time, and get a booking reference plus a calendar file. Behind it is a plain PHP slot engine that knows the shop's hours, holidays, each detailer's days and skills, and how long every job takes. It refuses to save a time that someone else just took. No framework, no database, no external requests.
Try It: Book a Slot
This is a compact slice of the real booking wizard, running the same slot rules as the site. Choose a vehicle and a service, pick a day and a time, and confirm. The grey gaps are sample bookings, so the schedule looks like a real week.
Clearcoat Auto Spa in Pictures
Real screenshots of the finished site, from the home page to the confirmation and the phone view.
Sample 1: The home page works out the next free Wash & Vacuum slot from the live schedule.
Sample 2: Booking step 3: the date strip, open start times for Ana and the running ₱1,800 summary.
Sample 3: The confirmation page in dark mode, with the booking reference, time window and price.
Sample 4: Services & Prices at phone width: switching to SUV updates every price on the page.
Build Footprint & Quality Checks
Small shops usually run on cheap shared hosting and customers book from their phones, so I kept the site light and tested it hard. These numbers are measured from the v1.0.0 build:
Technology Stack & Languages Used
PHP 7.4+, no framework
Page templates, the slot engine, booking validation, CSRF tokens, file locking and the .ics calendar file.
Vanilla JavaScript
The five-step wizard, live price switcher, mobile menu, theme toggle and a JavaScript twin of the slot engine.
CSS Custom Properties
One token set for light and dark themes, a type scale, and layouts that hold up from 360px phones to desktops.
JSON Files
Services, prices by vehicle size, staff schedules, opening hours and holidays live in three small files the owner can edit.
Key Architectural Decisions
Lock, Then Re-check
The booking is saved inside an exclusive flock(), and the slot is checked again inside that lock. Two people tapping the same time get one booking and one "just taken" message.
One Engine, Two Languages
engine.js is a line-by-line twin of inc/booking.php, and a parity test compares their output for ten real cases. That is what makes the static demo honest.
Private by Default
Confirmation links need a random token, the slots API returns only free times, and bookings are stored in .php files that start with exit, so no server can show them.
No Build, No Database
Upload the folder to any cPanel host and it runs. The same templates also render a static HTML copy for GitHub Pages with one command.
The Slot Engine, the Lock and the JavaScript Twin
These three pieces do the real work: finding open start times, saving safely, and running the same rules in the browser.
// inc/booking.php
/**
* Available start times.
*
* @param string $service_id Service id.
* @param string $staff_id Staff id or "any".
* @param string $date Y-m-d.
* @param array $bookings Saved bookings.
* @param int|null $timestamp Unix time for "now" (tests pass a fixed value).
* @return array array('ok'=>bool, 'reason'=>string, 'slots'=>[ ['start'=>int,'label'=>str,'staff'=>[ids]] ])
*/
function cc_slots($service_id, $staff_id, $date, $bookings, $timestamp = null)
{
$service = cc_service($service_id);
if (!$service) {
return array('ok' => false, 'reason' => 'Choose a service first.', 'slots' => array());
}
list($today, $now_min) = cc_now_local($timestamp);
$hours = cc_day_hours($date, $today);
if (!is_array($hours)) {
return array('ok' => false, 'reason' => $hours, 'slots' => array());
}
list($open, $close) = $hours;
$staff = cc_candidates($service_id, $staff_id, cc_weekday($date));
if (!$staff) {
return array('ok' => false, 'reason' => 'No detailer for this service on that day. Try another day or "Any detailer".', 'slots' => array());
}
$s = cc_settings();
$step = (int) $s['slot_step'];
$dur = (int) $service['minutes'];
$earliest = ($date === $today) ? $now_min + (int) $s['lead_minutes'] : 0;
$busy = array();
foreach ($staff as $id) {
$busy[$id] = cc_busy($date, $id, $bookings, $open, $close);
}
$slots = array();
for ($t = $open; $t + $dur <= $close; $t += $step) {
if ($t < $earliest) {
continue;
}
$free = array();
foreach ($staff as $id) {
$clash = false;
foreach ($busy[$id] as $iv) {
if ($t < $iv[1] && $t + $dur > $iv[0]) {
$clash = true;
break;
}
}
if (!$clash) {
$free[] = $id;
}
}
if ($free) {
$slots[] = array('start' => $t, 'label' => cc_min_label($t), 'staff' => $free);
}
}
$reason = $slots ? '' : 'Fully booked. Please pick another day.';
return array('ok' => (bool) $slots, 'reason' => $reason, 'slots' => $slots);
}
// inc/functions.php
/**
* Read a storage file under an exclusive lock, let $fn change the array, then
* write it back. Returns whatever $fn returns. This lock is what stops two
* people from saving the same slot at the same moment.
*/
function cc_with_store($name, callable $fn)
{
$dir = CC_ROOT . '/storage';
if (!is_dir($dir)) {
mkdir($dir, 0775, true);
}
$fh = fopen(cc_store_path($name), 'c+');
if (!$fh) {
return array('ok' => false, 'errors' => array('form' => 'Bookings cannot be saved right now. Please call us.'));
}
flock($fh, LOCK_EX);
$data = cc_store_decode((string) stream_get_contents($fh));
$result = $fn($data);
ftruncate($fh, 0);
rewind($fh);
fwrite($fh, CC_STORE_GUARD . json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
fflush($fh);
flock($fh, LOCK_UN);
fclose($fh);
return $result;
}
// assets/js/engine.js (the same rules for the static demo)
/** Open start times, same shape as cc_slots() in PHP. */
function slots(serviceId, staffId, date, bookings, ts) {
var svc = service(serviceId);
if (!svc) { return { ok: false, reason: 'Choose a service first.', slots: [] }; }
var now = nowLocal(ts);
var hours = dayHours(date, now.date);
if (typeof hours === 'string') { return { ok: false, reason: hours, slots: [] }; }
var open = hours[0], close = hours[1];
var ids = candidates(serviceId, staffId, weekday(date));
if (!ids.length) { return { ok: false, reason: 'No detailer for this service on that day. Try another day or "Any detailer".', slots: [] }; }
var dur = svc.minutes, step = S.slot_step;
var earliest = date === now.date ? now.min + S.lead_minutes : 0;
var busyMap = {};
ids.forEach(function (id) { busyMap[id] = busy(date, id, bookings || [], open, close); });
var out = [];
for (var t = open; t + dur <= close; t += step) {
if (t < earliest) { continue; }
var free = ids.filter(function (id) {
return !busyMap[id].some(function (iv) { return t < iv[1] && t + dur > iv[0]; });
});
if (free.length) { out.push({ start: t, label: minLabel(t), staff: free }); }
}
return { ok: out.length > 0, reason: out.length ? '' : 'Fully booked. Please pick another day.', slots: out };
}
Development Roadmap & Milestones
Version 1.0.0 is released. These are the next milestones from the project's roadmap:
v1.0.0: Full Booking Website (Released)
Nine pages, five-step booking wizard, slot engine with hours, holidays and staff skills, double-booking prevention, .ics files, contact form and light/dark themes.
Next: Owner Dashboard
A password-protected page to see today's bookings, mark cars as done, cancel bookings and export a CSV for the week.
Planned: Reminders
An SMS or Messenger reminder the day before each booking, sent by a small scheduled job or an n8n workflow.
Planned: Self-Service Changes
A "Cancel or move my booking" button on the private confirmation link, and optional SQLite storage for busy shops.
User Interface & Feature Showcase
Project Links, Code & Documentation
Live Demo
Click through all nine pages and make a demo booking. The demo is the static export, so bookings stay in your own browser.
GitHub Repository
Download the v1.0.0 release zip, browse the source or open an issue. Free and open source under the MIT license.
How It Was Built
The build log lists the languages used and every step, test and fix in plain language. Deployment steps for cPanel are in the docs.
A Booking System Without the Subscription
Online booking sounds like a platform you have to rent. For a small shop it can be a few PHP files, three JSON files and a careful lock around one write. Clearcoat Auto Spa shows the whole thing working, from the price list to the calendar file. Want one for your car wash, salon or service business?
Frequently Asked Questions
Is the Clearcoat Auto Spa website template free?
Yes. The code is free and open source under the MIT license, so you can use it for your own shop or for client projects. The business, team and testimonials are fictional sample content.
Does it work with Blogger, WordPress or my hosting?
It is a standalone PHP website, not a Blogger template or a WordPress theme. Upload it to any host with PHP 7.4 or newer, such as a cPanel shared hosting plan, and make the storage folder writable. No database, Composer or npm is needed.
How does it prevent double bookings?
Just before saving, the server checks the chosen time again inside an exclusive file lock, so two requests can never save the same slot. I tested it by sending two bookings for the same time at once: one was saved and the other was refused.
Can this website be customized for my business?
Yes. The name, phone, address, hours, holidays, services, prices and staff live in three small JSON files, and the colours are a few CSS tokens. The same booking engine also fits salons, tutorial centers, laundry pickup and photo studios.
How much does a website like this cost?
It depends on the number of pages, your content and photos, hosting and any extra features such as an admin page or SMS reminders. Message me for a quote.
Can you set this up for my business website?
Yes. I can set up a booking website like this for your business with your services, prices, staff and branding, connect it to your domain and hosting, and show you how to manage bookings. Contact me here.
Clearcoat Auto Spa, its address, phone number, team and testimonials are fictional sample data for a website template. Prices are examples in Philippine pesos.





Comments
Post a Comment