How I made sure two customers can never book the same slot
While building BookEase, an online booking app for salons, clinics and tuition centres, the hardest part wasn't the design. It was answering one question correctly: "Is 4:30 actually free?"
A time is only free if:
• It's within opening hours, and not in the lunch break
• The whole appointment fits before closing. A 2-hour hair colour can't start at 7:30 if you close at 8
• There's clean-up time around the bookings next to it
• Fewer people are booked than the business can serve at once. A salon with 2 chairs can take two 4:30 bookings; a dentist only one
• It isn't a holiday, and it isn't too soon for the business to get ready
The page checks all of this in the browser, so customers only ever see times they can really book.
But two people can still tap the same last slot at the same second. So when a booking is saved, the database checks again. It handles bookings for the same day one at a time, so the second person gets "Someone just booked that time. Please pick another one." instead of a double booking.
Privacy mattered too. The public booking page only learns which times are taken, never anyone's name or phone number. Only the owner's account can see the bookings.
Try it yourself with a salon, a dental clinic or a tuition centre (owner dashboard PIN: 1234):
https://victorravindra.github.io/bookease-demo/
Run an appointment-based business? Message me and I'll show you how it would look for yours.