Complete, production-ready booking flow for medical clinics
✓ Doctor selection with specialty display
✓ Interactive calendar (30-day range)
✓ Real-time availability checking
✓ Patient information form
✓ Identity verification (phone + DOB)
✓ Visit reason collection
✓ Confirmation review
✓ Success confirmation with booking ID
✓ Responsive design (mobile-first)
✓ Bilingual support (EN/ZH)
✓ Real-time slot availability
✓ Appointment cancellation with token
✓ Form validation & error handling
✓ Timezone-aware scheduling
✓ Schedule & blockout integration
✓ No login required
Fetch clinic info and associated practitioners
Get available time slots considering schedules, blockouts, and existing appointments
Create new appointment with guest information
Cancel appointment using secure token
src/app/book/
├── [clinicID]/
│ ├── page.tsx # Server-rendered booking page
│ └── confirm/page.tsx # (Optional) Success confirmation page
├── cancel/page.tsx # Appointment cancellation page
├── demo/page.tsx # This page
├── booking-form.tsx # Multi-step form (Client)
├── actions.ts # Server actions for business logic
├── i18n.ts # Translations (EN/ZH)
└── components/
├── DoctorSelector.tsx # Step 1 component
├── DateSelector.tsx # Step 2 component
├── TimeSlotSelector.tsx # Step 3 component
└── PatientForm.tsx # Step 4-6 component
src/app/api/book/
└── cancel/route.ts # Cancel API endpoint
src/app/zh/book/
└── [clinicID]/page.tsx # Chinese booking page
English booking page:
/book/clinic123Chinese booking page:
/zh/book/clinic123Language parameter (alternative):
/book/clinic123?lang=zhThe system uses existing Prisma models:
Clinic - Clinic informationPractitioner - Doctors/practitionersPractitionerSchedule - Weekly schedulesPractitionerBlockout - Blocked time periodsAppointment - Appointment bookings• Email notifications should be queued from createOnlineBooking() in production
• Cancel link should be included in appointment confirmation email
• Phone number validation is basic (10+ digits); customize as needed
• All times are displayed in user's local timezone
• Schedule availability is gap-based (uses slot duration, not appointment duration)