Skip to content
← All client work/Home services · Payments
LiveHome services · Payments

Booking and payments system case studyInstant quotes, online booking and card payments for a home-cleaning business, taken live within three weeks as the sole developer.

A family-run cleaning business wanted customers to get a price, pick a time and pay online without a phone call — and wanted its own back office to run the day.

ClientBrunex Cleaning
ProjectBooking & Payments System for a Cleaning Business
My roleTechnical partner, end to end
StatusLive
Discuss a similar build
Brunex Cleaning landing page with the headline "Get your time back", an address field and a "See instant quote" button beside a photo of a cleaner making a bed.

The live public landing page. The other screens use demo data; no customer data is shown.

< 3 wksFrom first commit to production, as sole developer
1,110Automated API tests at the go-live build, plus 154 on the web app
28Written architecture decisions, so any future developer can see why it works the way it does
3 rolesCustomer, cleaner and admin — each sees only what it should
In short

A home-cleaning business needed customers to get a price and book online, cleaners to see their jobs on a phone, and the owner to run bookings and payments from one screen. I built the whole system: a rules-based quote engine, booking by arrival window, card-on-file payments, a cleaner app and an admin back office — with the rules that cost money if broken (double-booking, double charges, over-refunds, duplicate webhooks) enforced by the database itself, not by hope.

01 · The situation

Quotes by phone, schedules by memory.

A family-run home-cleaning business took enquiries by phone, priced each job by hand and kept the schedule in people’s heads. They wanted customers to see a price and book online, cleaners to know where to be, and one place to manage bookings, payments and refunds.

02 · The challenge

A booking is a promise about money and time.

Two things cannot go wrong: a cleaner cannot be booked twice, and a card cannot be charged twice. Both had to hold when two customers pick the same slot in the same second, when a payment request is retried, and when a webhook arrives twice — and the price a customer sees had to be the price they pay.

03 · What I built

One web app for three kinds of user.

A two-minute quote form that shows the price live and sends unusual homes to the owner for review, booking by arrival window with a card kept on file, recurring visits, a phone-first cleaner app, and an admin back office for the schedule, payments, refunds, pricing and the questions the quote form asks.

Customer

From address to booked visit

— Instant quote from a pricing engine, edge cases sent to review— Arrival-window booking with live availability— Deposit and balance by card, no account needed— Weekly, two-weekly or four-weekly visits
Business

Running the day

— Today view, schedule and assignment— Payments, refunds and price changes to approve— Cleaner app: on my way, check in, check out— Editable prices, service area and quote questions

Screens from the real product, captured with demo data. No client or customer data is shown.

04 · How it works

From an address to a paid, scheduled visit

  1. 01Quote formHome, service, conditionAdmin-editable
  2. 02Pricing rulesOne function, one price
  3. 03Book a windowSlot held by a database constraintCard on file
  4. 04Schedule & assignAdmin back office
  5. 05Cleaner appOn my way · check in · check out
Most customers never wait for a call back. The price comes from rules, the slot is held by the database, and every message and charge is recorded with the change that caused it.
05 · The hard engineering

Rules the database enforces.

01

No double-booking, by constraint

A database exclusion constraint makes two overlapping jobs for one cleaner impossible to store. Availability checks sit in front of it, but the constraint is what guarantees it.

02

Charges that cannot repeat

Every payment is written as a record before the payment provider is called, and that record is the idempotency key — so a retry can never create a second charge.

03

One pricing function

Prices come from a single pure function, never from the browser. During review, an invariant sweep of 120,960 input combinations confirmed every quote’s lines add up to its total, with no negative line and no discount larger than the base.

04

Side effects as records

Emails, charges and reminders are written as rows in the same transaction as the change that caused them, then sent by background workers — so nothing is sent for a change that did not happen.

05

AI that only advises

OpenAI gpt-4.1-mini reads each quote request after it is submitted: a summary, a risk score and flags for the owner, and a short brief for the assigned cleaner. It can never change a price or block a booking.

06

Separate doors for admins and cleaners

Different sign-in, different permissions and different screens. A cleaner’s view of a job contains no payment details at all.

06 · Key decisions

The calls that shaped the build

Why let the database prevent double-booking?

Application checks can race: two customers can pass the same check in the same instant. A database constraint cannot be raced, so an overlapping booking simply cannot be stored.

Why write the payment record before calling the payment provider?

Networks fail mid-request. With the record written first and used as the idempotency key, a retry finds the existing payment instead of charging the card again.

Why is the AI only advisory?

A price or a booking must be explainable and repeatable. The AI helps the owner read a quote request faster; it never decides a price or gates a booking.

07 · The outcome

A complete booking business in one system.

✓ Quote, booking, payment, scheduling and refunds in one place✓ Built end to end as sole developer; live within three weeks✓ 1,110 API tests and 154 web tests at the go-live build✓ 28 written architecture decisions the owner can hand to any future developer
08 · Stack
Next.jsFastAPIPostgreSQLCelery/RedisStripeResendTwilioOpenAIMapboxTurnstileSentry
Is this like your product?

Any service business that sells time slots and takes payment online.

Home servicesquotes, scheduling and crews in the field
Appointment businessescapacity that must never be double-booked
Marketplacesdeposits, balances and refunds done safely