No. 13SaaS8 min read2,048 words
How to build a booking and scheduling app: that works
How to build a booking or scheduling app: preventing double bookings, time zones, availability rules, payments, reminders, calendar sync and build vs buy.
- Written by
- Lazy Devs
- Published
- Updated
- Sources
- Cited inline

Key takeaways · 05
The short version
- 01A booking app is a rules engine wearing a calendar costume. The availability rules, concurrency, time zones and money handling are most of the work; the calendar UI is the small part.
- 02Prevent double bookings in the database, not the UI. In Postgres, an exclusion constraint on resource and time range makes overlapping bookings impossible even under simultaneous requests.
- 03Store moments in UTC, but store recurring appointments as a local time plus an IANA time zone name, so a weekly 9am appointment stays at 9am local time across daylight saving changes.
- 04Decide cancellation, refund, deposit and no-show policies before development starts. They shape the data model and payment flow, not just a settings screen.
- 05If you only need clients to pick a slot and pay, use an off-the-shelf scheduling tool. Build custom when scheduling is your product or a real differentiator.
On this page · 12
To build a booking and scheduling app, start with the rules rather than the calendar: define availability (hours, breaks, buffers, lead times, staff and resources), enforce "no double bookings" in the database, store times in UTC with proper time zone handling, and settle your cancellation and payment policies before writing code. Reminders and calendar sync are real infrastructure, so scope them as separate features.
A booking app looks like a calendar with a button on it. Then you start building and discover it is mostly a machine for stopping two people grabbing the same slot, in two time zones, while one of them is halfway through paying. The calendar is a small part of the work. The rest is what nobody demos.
This guide is for founders and product owners scoping a booking or scheduling product. It covers where the time and money actually go, so you can ask better questions before you sign anything.
Build or buy a booking system?
Before commissioning anything custom, be honest about whether you need it. Calendly, Cal.com, Acuity and similar tools already solve the generic case well.
| Your situation | Recommendation |
|---|---|
| Clients pick a time with one person, maybe pay a fixed price | Off-the-shelf tool |
| A small team with shared availability and simple services | Off-the-shelf tool, possibly embedded on your site |
| A marketplace matching customers with many independent providers | Custom |
| Scheduling across rooms, equipment and staff at once | Custom |
| Pricing that changes by time, demand or customer type | Custom |
| Booking must live natively inside a larger product you are building | Custom, or an open-source scheduling core |
Go custom when the booking logic is your actual product or a real differentiator, as in marketplaces matching customers to providers, crew and equipment scheduling in field service and construction, or appointment-heavy healthtech products. If your needs are "let clients pick a 30-minute slot and pay", start with a tool and revisit later. The good kind of lazy is not rebuilding Calendly for fun. Restaurants face the same decision with tables, which we cover in restaurant ordering and reservations.
Why "just a calendar" is never just a calendar
The visible part is a grid of available times. The invisible part is the set of rules deciding which times are available, and what happens when someone clicks one. Ask any agency to walk you through the next two sections. If they wave them off, walk away.
Preventing double bookings is a database problem
Two people load the same available slot and both click "Book". If your backend checks availability and then writes the booking in two separate steps, there is a gap between the check and the write where both requests pass. Now you have one slot, two confirmations and an angry customer.
The fix is not a spinner. It is a database-level guarantee, so the second write fails cleanly and that person sees "just taken, pick another". Postgres has a feature built for exactly this: an exclusion constraint on a range type, which rejects any booking whose time range overlaps another for the same resource.
-- btree_gist lets one constraint combine equality (resource) and overlap (time range)
create extension if not exists btree_gist;
create table bookings (
id uuid primary key default gen_random_uuid(),
resource_id uuid not null references resources(id), -- a person, room or piece of equipment
customer_id uuid not null references customers(id),
during tstzrange not null, -- start and end, stored as absolute moments
status text not null default 'held', -- held | confirmed | cancelled
hold_expires_at timestamptz,
created_at timestamptz not null default now(),
exclude using gist (resource_id with =, during with &&)
where (status in ('held', 'confirmed'))
);A few details make this work in practice:
- Ranges are half-open by default, so a booking ending at 10:00 and another starting at 10:00 do not conflict.
- Cancelled bookings are excluded by the
whereclause, so cancelling frees the slot. - Buffers (cleaning, travel, notes) can be included by storing the blocked range, start minus buffer to end plus buffer, in the constrained column.
- Holds let you reserve a slot while the customer pays. A background job cancels holds past
hold_expires_at, and availability queries ignore expired holds. The constraint still sees an expired hold until its status changes, so the booking transaction should also cancel any expired holds on that resource before inserting, or a stale hold will block a real booking. - The
btree_gistextension is what allows theresource_id with =part.
When two requests race, one insert succeeds and the other gets a constraint violation your API turns into a friendly "that slot was just taken". This is a solved problem, but only if someone solves it on purpose. It is the kind of guarantee we build into every API and backend project that handles bookings, stock or money.
Time zones will ruin your week
The rule everyone knows: store moments in UTC and display them in the viewer's time zone. The edge cases are where people still get it wrong.
Recurring appointments and daylight saving. If a weekly 9am appointment was created in winter and the clocks change, does it stay at 9am local time or keep the same absolute moment? A barber wants 9am local forever. A live webinar across time zones wants the absolute moment preserved. Both are valid, and your app must know which it is doing.
The practical approach:
- Store one-off bookings as absolute moments (
timestamptzin Postgres). - Store recurring rules as a local time plus an IANA time zone name, such as
Europe/London, never a fixed offset like+01:00. Offsets change with daylight saving; zone names carry the rules, maintained in the IANA time zone database. - Expand recurrences into concrete occurrences with a well-tested library, ideally one that understands the recurrence rules defined in iCalendar (RFC 5545), which is also what calendar invites use.
- Show the time zone on every booking confirmation, especially for remote appointments.
- Test the transition days. Some local times do not exist when clocks go forward, and some happen twice when they go back.
Get this wrong and you get the worst kind of bug: one that appears twice a year and makes customers miss appointments.
Availability rules are the heart of the product
"Available" is rarely a flat schedule. Realistically you need:
- Working hours, breaks, holidays and one-off exceptions.
- Buffer time between appointments.
- Maximum bookings per day or per slot.
- Lead time (no bookings within a few hours of now) and a booking horizon (no further than a set number of days ahead).
- Different durations per service.
- Multiple staff or resources, each with their own calendar, and services that need several at once (a therapist and a room).
Each is a small feature. Together they are an availability engine, and that engine is the product. Spend money here, and be clear about your rules up front, because retrofitting them is painful.
A useful mental model: availability is a calculation, not a table of pre-made slots. Start with working hours, subtract existing bookings, holds, external calendar events and buffers, apply lead time and horizon, and cut what is left into slots of the requested duration. Precomputing slots for months ahead seems simpler but goes stale every time a rule changes.
If availability needs to update live as other people book, the patterns in how to build a real-time app apply. For most booking apps, re-checking when the customer picks a slot, backed by the database constraint, is enough.
Payments, deposits and cancellations
Taking money at booking time is straightforward on day one and gets interesting at the edges: refunds, partial refunds, deposits, no-show fees and cancellation windows. Each policy is logic plus a fresh batch of "what happens if" questions.
| Policy | How it typically works with Stripe | Watch out for |
|---|---|---|
| Pay in full at booking | Charge at checkout, refund per your policy | Partial refunds and who pays the processing fee |
| Deposit | Charge part now, the rest later or in person | Tracking balances and reconciling in-person payments |
| Hold, then charge | Authorise now, capture later | Authorisations expire after a limited period |
| Card on file for no-shows | Save the card at booking, charge only if needed | Clear consent and terms shown at booking |
Decide cancellation and refund rules before development starts, because they shape the data model, not just a settings screen. Payment confirmation should come from webhooks, with the booking moving from "held" to "confirmed" when the payment succeeds. Our Stripe integration work covers this end to end.
Reminders and notifications
Emails and text messages reduce no-shows. Sending them is easy. Scheduling them reliably is the part people underestimate: "24 hours before" and "1 hour before" must fire even if the server restarts, and must not fire for an appointment that was rescheduled or cancelled an hour ago.
That means a proper job queue and worker, not a timer inside a request handler. A pattern that works: when a reminder job runs, it re-reads the booking and checks it is still confirmed and still at the same time before sending. Include a one-click link to reschedule or cancel. Making it easy to cancel early is often better than a no-show, because the slot can be rebooked. For text messages, collect consent and honour opt-outs, which carrier and local rules require.
Calendar sync
"Can it sync with my Google Calendar?" is one of the first feature requests most booking products get, and it is heavier than it sounds. Two-way sync means your app writes bookings to the provider's calendar and reads their busy times, so outside events block availability.
That involves OAuth, token refresh, push notifications for calendar changes (which expire and must be renewed), free/busy queries, and reconciliation when things drift. Microsoft 365 calendars need the same work again through a different API. It is worth it for many businesses, but price it as its own feature, not a freebie. A lighter start is sending calendar invites (.ics files) with each confirmation, which works with every calendar app.
What drives the cost
We do not quote booking systems we have not scoped. These are the factors that move effort the most:
| Factor | Simpler | More involved |
|---|---|---|
| Resources | One person or room | Many staff, rooms and equipment combined per service |
| Availability rules | Fixed weekly hours | Buffers, exceptions, lead times, per-service rules |
| Payments | Pay in full, simple refunds | Deposits, holds, no-show fees, payouts to providers |
| Recurrence | One-off bookings only | Recurring series with exceptions and edits |
| Calendars | Calendar invites by email | Two-way sync with Google and Microsoft |
| Notifications | Email confirmation | Email and SMS reminders, reschedule links |
| Sides | Business takes bookings | Marketplace with provider onboarding and reviews |
The biggest cost driver is not the calendar UI. It is the number of "what happens if" cases you choose to handle properly. Handling fewer of them is a legitimate way to save money, as long as you choose which ones deliberately instead of finding out from a customer.
Questions to ask before you hire anyone
- How will double booking be prevented? The answer should mention the database, not the frontend.
- Where and how are times stored? Listen for UTC plus IANA time zone names.
- How do recurring appointments behave across daylight saving changes?
- What happens if payment fails or a hold expires?
- How are reminders scheduled, and what happens if a booking changes?
- Is calendar sync priced as a separate feature?
Booking is at the heart of many industries we work with, from clinics to gyms. Our post on web apps for fitness and wellness businesses shows how these pieces come together for classes, memberships and trainers.
Where to start
- Write down your availability rules, services and resources in plain language.
- Decide cancellation, refund, deposit and no-show policies.
- Build the data model with database-enforced overlap protection and correct time handling.
- Build the availability calculation and booking flow, with holds during payment.
- Add reminders, then calendar sync, as separately scoped features.
A booking app is a rules engine wearing a calendar costume. Spend your scoping energy on the rules (availability, concurrency, time zones and money) and the rest follows. If you want a second opinion on whether to build or buy for your case, talk to us and we will give you a straight answer.
FAQ · 05 questions
Frequently asked questions
Should I build a custom booking system or use Calendly or Cal.com?
Use an off-the-shelf tool if clients simply pick a time with one person and maybe pay. Build custom when scheduling is core to your product, such as a marketplace matching customers with providers, multi-resource scheduling across rooms, staff and equipment, dynamic pricing, or a booking flow that must live inside a larger app.
How do booking systems prevent double bookings?
Reliable systems enforce it in the database. Either a constraint makes overlapping bookings for the same resource impossible, or the booking is written inside a transaction that locks the relevant rows, so when two people try to book the same slot at the same moment, one succeeds and the other is told the slot was just taken.
How should a booking app handle time zones?
Store each booking's start and end as an absolute moment in UTC, keep each business's and user's IANA time zone name, and convert for display. For recurring appointments, store the local time and time zone and calculate each occurrence, so daylight saving changes do not shift appointments by an hour.
How do I reduce no-shows in a booking app?
Send reminders at sensible intervals before the appointment with an easy link to reschedule or cancel, and consider a deposit, a card on file with a clear no-show fee, or a cancellation window. Making it easy to cancel early often reduces no-shows, because the slot can be rebooked.
Can a booking app sync with Google Calendar?
Yes. Two-way sync reads a provider's busy times so outside events block availability, and writes bookings into their calendar. It requires OAuth access to the calendar, change notifications or regular polling, and reconciliation logic, so it is a meaningful feature to scope and price on its own.