Business & shops

Build an appointment booking app with AI

Reserve one service slot, reject competing requests, and keep customer bookings separate from staff availability.

Apirex TeamUpdated AndroidiOS
On this page
  1. Screens
  2. Data model
  3. Native features
  4. Android notes (Kotlin and Jetpack Compose)
  5. iPhone notes (Swift and SwiftUI)
  6. Copy-paste prompt
  7. Acceptance test
  8. Frequently asked questions
5screens
4data tables
144word prompt
2platforms: Android, iOS

An appointment booking app is useful when customers need to reserve a real piece of someone’s working day. The central promise is not a colorful calendar: it is one authoritative reservation for an available slot. Scope the first build around one business location, a small service catalog and staff-controlled availability, then prove that two simultaneous customers cannot both receive confirmation.

Screens

  • Services: show owner-supplied descriptions, durations and booking eligibility before selecting availability.
  • Pick a slot: display only server-reported availability with the business time zone visible.
  • Confirm: summarize the selected service, appointment time and cancellation terms before submission.
  • My bookings: show only the signed-in customer’s upcoming and cancelled reservations.
  • Staff calendar: let authorized staff inspect reservations and manage future availability without exposing customer details publicly.

Data model

Appointment Booking storage contract
TableKey fieldsPurpose
servicesid (uuid), name (text), duration_minutes (int), active (bool)Business-owned services and their fixed appointment durations.
slotsid (uuid), resource_id (uuid), service_id (uuid), opens_at (timestamptz), closes_at (timestamptz), capacity (int), state (text)Canonical availability for a reservable staff member or resource.
bookingsid (uuid), slot_id (uuid), customer_id (uuid), state (text), request_key (uuid)Customer reservations with a deduplication key for retries.
staff_membersuser_id (uuid), resource_id (uuid), role (text)Explicit authority to manage a resource calendar.

Customers can read their own booking rows, not a list of other people occupying the calendar. Staff permissions must be enforced in backend row-level security, with a server function handling reservation creation. For fixed non-overlapping slots, use a unique active booking constraint on slot_id; if resources can have variable durations, use a transaction with an overlap constraint or appropriate locking. Availability shown on the phone is advisory until that transaction succeeds. Cancellation must release capacity atomically, not by two unrelated client requests.

Decide whether staff may move an existing reservation and how the customer is notified before exposing drag-to-reschedule controls. A moved appointment must reserve the new interval and release the old one in one transaction, preserving an audit trail of who changed it and which policy authorized the change.

Native features

Calendar export and a reminder before the reserved service are the useful phone integrations here. Neither should create a reservation: offer them only after the booking transaction returns a confirmed identifier. Android can open a calendar insert intent; an iPhone can present an EventKit event editor. Include service duration and the business time zone, but let customers decline export. When staff reschedule, explain that a previously exported calendar copy may need updating. Keep the booking detail authoritative rather than promising that a separate calendar will always reflect later changes.

Android notes (Kotlin and Jetpack Compose)

Build the service selector with Material 3 cards and the available appointments with a LazyColumn keyed by slot ID. A ModalBottomSheet can summarize the chosen staff member, price if supplied, and cancellation cutoff before submission. Keep the service ID in saved state, while a ViewModel refreshes availability after rotation or a conflict. Use rememberLauncherForActivityResult for the calendar handoff and handle cancellation without changing the booking. On a physical Android phone, select a late-evening appointment, rotate during confirmation, and reserve its last slot from another account. The first phone must show a conflict instead of a second success.

iPhone notes (Swift and SwiftUI)

Use a NavigationStack from service to availability to confirmed booking, with routes carrying identifiers instead of formatted dates. A SwiftUI List should mark the selected slot in text as well as color. Present the EventKit editor in a sheet after confirmation and ask UserNotifications permission only when the customer chooses a reminder. Schedule against the confirmed instant, not the phone's current hour label. On an iPhone, reserve while the device uses a different time zone from the business; inspect the exported start and end in Calendar, cancel the appointment, and verify the app removes its own pending reminder.

Copy-paste prompt

Build this yourself 142 words · Android
Build an appointment booking app for Android using Services, Pick a slot, Confirm, My bookings and Staff calendar. Ask for opening hours, resource ownership, service durations, business time zone, holidays and cancellation deadlines before implementing availability. Use services, canonical slots, customer-owned bookings and staff assignments in the backend. Enforce a unique active booking per fixed slot on the server, or transactional overlap protection when durations vary. Never treat a disabled button as conflict protection. Include loading availability, no slots, expired selection, network failure and denied reminder or calendar access. Show the owner’s cancellation rules before confirmation and apply those rules again on the server. Give retried submissions a stable request key. Acceptance means two customer accounts compete for the same opening and exactly one succeeds; after reopening, the winner sees one booking and the other sees a conflict rather than another confirmation.

Opens Apirex with this prompt in the box. Pick the Android · Kotlin tab before you send.

Acceptance test

  1. As staff, create a 30-minute service and two openings on a specified date in the owner’s business time zone; inspect the customer-facing labels.
  2. Sign in as two customers on separate devices and submit the same slot nearly simultaneously; require exactly one confirmed reservation.
  3. Reopen the winning customer’s app and check My bookings against the staff calendar, including the same start and end instants.
  4. Attempt to fetch that reservation from the losing account using its identifier and verify the server denies private booking details.
  5. Cancel within the supplied policy window and verify the slot becomes available once; retry cancellation outside the allowed window and expect a clear server rejection.

Frequently asked questions

Who decides the cancellation deadline?

The business owner supplies the cutoff, its business time zone and any exceptions before implementation. Store enough policy context to explain a rejection, and do not invent refund or rescheduling rights.

Is hiding an occupied time enough to prevent conflicts?

No: a second device may have loaded availability before the first customer reserved it. The backend must enforce the capacity rule with a unique constraint or a transaction that cannot admit overlapping reservations.

Can this start without online accounts?

A personal appointment notebook can be local, but it cannot safely offer shared customer reservations. This brief uses a backend because customer ownership and a single authoritative staff schedule are part of the acceptance journey.

Build this blueprint

The blueprint prompt, ready for your platform. Edit anything before you send it.

AndroidKotlin · Jetpack ComposeReal source on your computer

Opens Apirex with this prompt. Pick the Android · Kotlin tab before you send. The Free plan includes 5 Rex Credits a day.