How tsttyy/hanabi-booking works
Hanabi Booking is a B2B appointment-booking platform: customers browse active businesses, services and staff, check available slots, book and manage appointments; business admins manage booking resources and appointments, while system owners provision and enable businesses. The React frontend communicates with an Express API, whose routes dispatch to controllers and domain services backed by PostgreSQL through Prisma. The README documents the frontend/API boundary and booking flow; some domain services and frontend internals were not sampled, so their detailed connections are omitted.
Main entry points: routes Admin routes · prisma.ts PostgreSQL · customer.controller.ts Customer handlers · auth.ts Auth checks
Components 21
Booking client
- Booking interface
frontend/src/main.tsx
API entry
- Express API
src/app.ts - Customer routes
src/routes/customer.routes.ts - Public routes
src/routes/public.routes.ts - Admin routes
src/routes - Customer handlers
src/controllers/customer.controller.ts - Public handlers
src/controllers/public.controller.ts - Appointment handlers
src/controllers/appointment.controller.ts
Identity
- Auth checks
src/middleware/auth.ts - User authentication
src/services/auth.service.ts - Customer accounts
src/services/customer.service.ts
Business catalog
- Business management
src/services/business.service.ts - Service management
src/services/service.service.ts - Staff management
src/services/staff.service.ts - Availability rules
src/services/availability.service.ts - Public directory
src/services/public.service.ts
Appointments
- Slot and booking logic
src/services/booking.service.ts - Appointment management
src/services/appointment.service.ts - Customer appointments
src/services/customer-appointment.service.ts
Other components
- Customer
- PostgreSQL
src/lib/prisma.ts
Connections 27
- Customer → Booking interface: uses
README.md - Booking interface → Express API: requests
README.md - Express API → Customer routes: mounts
src/app.ts - Express API → Public routes: mounts
src/app.ts - Customer routes → Customer handlers: dispatches
src/routes/customer.routes.ts - Customer routes → Auth checks: guards
src/routes/customer.routes.ts - Public routes → Public handlers: dispatches
src/routes/public.routes.ts - Customer handlers → Customer accounts: manages accounts
src/controllers/customer.controller.ts - Customer handlers → Customer appointments: manages bookings
src/controllers/customer.controller.ts - Customer handlers → Auth checks: sets customer identity
- Public handlers → Public directory: loads directory
src/controllers/public.controller.ts - Public handlers → Slot and booking logic: checks slots
src/controllers/public.controller.ts - Appointment handlers → Slot and booking logic: creates booking
src/controllers/appointment.controller.ts - Appointment handlers → Appointment management: manages appointments
src/controllers/appointment.controller.ts - User authentication → Auth checks: signs tokens
src/services/auth.service.ts - Customer accounts → Auth checks: issues customer token
src/services/customer.service.ts - Business management → PostgreSQL: reads and writes
src/services/business.service.ts - Service management → PostgreSQL: reads and writes
src/services/service.service.ts - Appointment management → PostgreSQL: reads and writes
src/services/appointment.service.ts - Customer appointments → PostgreSQL: reads and writes
src/services/customer-appointment.service.ts - Public directory → PostgreSQL: reads
src/services/public.service.ts - Slot and booking logic → PostgreSQL: checks and writes
src/services/booking.service.ts - Admin routes → Appointment handlers: dispatches
src/routes/appointment.routes.ts - Admin routes → Business management: dispatches
- Admin routes → Service management: dispatches
- Admin routes → Staff management: dispatches
- Admin routes → Availability rules: dispatches