Skip to content

Features

Detailed features of the Booking Platform organized by module and workspace. The platform has 188 features across 10 workspaces with 295 route files in the website alone.

Website Modules (18 top-level modules)

The main web app (apps/website) contains 18 top-level feature modules under src/modules/, totaling 126 features across 20 sub-modules:

ModulePathDescription
Adminsrc/modules/admin/Admin panel — users, providers, disputes, promotions, reports
Authpackages/auth/src/Authentication via Supabase — 5 roles, 30+ permissions
Billingsrc/modules/billing/Billing and subscription management
Configpackages/config/src/App configuration and feature flags
Databasepackages/database/src/Drizzle ORM schema, migrations, and queries
Devtoolssrc/modules/devtools/Developer tools and debugging utilities
Feature Flagspackages/feature-flags/src/Feature flag management and toggles
Infrastructurepackages/infrastructure/src/Server infrastructure, middleware, and oRPC setup
Layoutsrc/modules/layout/App layout — header, footer, navigation, sidebar
Bookingssrc/modules/bookings/Customer booking management and history
Nativesrc/modules/native/Capacitor native bridge — biometric, haptics, camera
Providersrc/modules/provider/Provider dashboard — bookings, staff, services, settings (30+ sub-modules)
Public Pagessrc/modules/public-pages/Public-facing pages with custom domains and templates
Searchsrc/modules/search/Provider and service search with filters
Settingssrc/modules/settings/User and provider settings — profile, security, payments
Sharedsrc/modules/shared/Shared utilities and common components
Supportsrc/modules/support/Support tickets, SLA, and AI assistant
Usersrc/modules/user/User profile, verification, and badges

Provider Sub-modules (30+ modules)

The provider module is the largest, containing 30+ sub-modules under src/modules/provider/:

Sub-moduleDescription
analyticsProvider analytics dashboard and reporting
availabilityAvailability and time slot management
bookingsBooking management and operations
calendarCalendar view and scheduling
chatReal-time chat between customers and providers
communicationEmail, SMS, and push notification templates
customersCustomer management
dashboardProvider dashboard with overview stats
integrationsThird-party integrations
loyaltyLoyalty program management
notificationsSmart notification system with preferences
onboardingProvider onboarding wizard and business setup
pagesProvider-specific pages
promotionsPromotions, campaigns, and referral programs
realtimeReal-time updates
recurring-bookingsRecurring booking support
reviewsReview management
servicesService management
social-sharingSocial sharing features
staffStaff management and scheduling
subdomainCustom subdomain configuration
video-consultationsVideo call integration for virtual consultations

Booking Cart & Checkout

The booking cart system includes pre-checkout slot validation to prevent double-booking.

Checkout Flow

1. Fetch cart items for user
2. For each item: validate slot availability (provider availability + capacity + overlap check)
3. If any slot invalid → throw ConflictError with reason
4. Convert cart items to bookings via repo.checkoutBookingCart
5. For each booking: insert audit log + send booking confirmation notification

Slot Validation (validateBookingSlotAvailability)

Three checks performed per cart item:

CheckDescription
Provider availabilityChecks if provider works on the requested day
Capacity availabilityVerifies sufficient capacity at the requested slot
Overlap checkQueries confirmed bookings that overlap with the requested time

Cancellation Policy

ScenarioRefundFee
Default (no policy)50% of priceRemaining balance
Late cancellation (< hoursBeforeBooking)0lateCancellationFee or 0
Normal cancellation (>= hoursBeforeBooking)priceCents * refundPercentage / 100priceCents - refundCents

Policy supports allowProviderOverride for late cancellations.

Loyalty Program

Loyalty points with duplicate prevention, tier system, and streak tracking.

FeatureDescription
Earn pointsearnLoyaltyPointsForBooking with hasLoyaltyEarnedForBooking duplicate check
Redeem pointsredeemUserLoyaltyPoints with optional description
Tiersbronze, silver, gold, platinum with automatic upgrade checks
StreaksCurrent streak, longest streak, and streak history
BadgesUser badges with rarity and earned date
Point expiryExpiring points within a timeframe

Payments

Payment Methods

MethodValidationDescription
StripeZod + Stripe SDKPayment intents with deposit/full payment, gift cards, session passes
LINE PayHMAC-SHA256 + Zod response schemas7 currencies (THB, USD, EUR, JPY, SGD, MYR, TWD), 30s timeout

Payment Intent Flow

1. Build payment breakdown (deposit or full amount)
2. Fetch customer ID from payment gateway
3. Validate amount is positive
4. Create Stripe payment intent with metadata (bookingId, type, depositPercentage)
5. Generate invoice with tax and discount calculations
6. Create deposit payment record if deposit > 0
7. Create ledger entry
8. Insert audit log for financial change
9. Apply gift card transaction if applicable
10. Use session pass if applicable

LINE Pay Response Validation

All LINE Pay API responses are validated with Zod schemas:

  • Payment response: returnCode, returnMessage, info.paymentUrl.web, info.paymentUrl.app, info.transactionId
  • Refund response: returnCode, returnMessage, info.refundTransactionId
  • Success determined by returnCode === "0000"

Security & Infrastructure

Production Environment Validation

Strict env validation via Zod superRefine — in production mode, requires:

VariableRequired In
STRIPE_SECRET_KEYProduction
STRIPE_WEBHOOK_SECRETProduction
DATABASE_URLProduction

Fail-Closed Authorization

Authorization errors (FORBIDDEN) are handled separately from service errors. Non-authorization errors (database timeout, service unavailable) are re-thrown rather than silently ignored.

FCM Token Cleanup

After sendEachForMulticast(), invalid registration tokens are automatically deleted via deleteDeviceToken() when Firebase returns messaging/invalid-registration-token error code.

Redis Cache Error Logging

All Redis cache methods (get, set, mget) catch errors and log via secureError with [Redis Cache] prefix. Cache failures return default values (undefined or empty array) instead of throwing.

Webhook Payload Redaction

Webhook payloads are sanitized via redactValue() before logging to prevent sensitive data leaks.

Deployment Typecheck Enforcement

GitHub Actions deploy workflow runs typecheck as a gate before deployment for both apps/website and apps/admin.

Authentication System

The platform supports three authentication methods with server-side session management and RBAC enforcement.

Auth Methods

MethodImplementationDescription
Email/Passwordapps/website/src/server/auth/session.tsSupabase auth with rate limiting (5 attempts/email, 20/IP per minute)
OAuth Social Loginpackages/auth/src/adapters/supabase/oauth-adapter.tsGoogle, LINE, Facebook with redirect path whitelist
Passkey/WebAuthnapps/website/src/server/user/security/passkey.ts@simplewebauthn/server with 5-minute challenge TTL in Redis

Password Requirements

  • Sign in: Minimum 8 characters
  • Sign up: Minimum 12 characters, must contain lowercase, uppercase, number, and special character

Server-Side Sessions

Cookie-based sessions with automatic refresh:

CookiePurposeHttpOnlySecure
sb-access-tokenPublic session dataNoProduction
sb-refresh-tokenRefresh tokenYesProduction
sb-auth-tokenLegacy auth token

Session functions: getSession, refreshSession, signInWithEmailPassword, signUpWithEmailPassword, signOut.

Passkey/WebAuthn Flow

Registration: registrationBegin → cache challenge (5 min TTL) → browser WebAuthn API → registrationFinish → store in biometric_credentials
Authentication: authenticationBegin → cache challenge → browser WebAuthn API → authenticationFinish → Supabase magic link OTP → session

Credential storage includes: credentialId, publicKey, signCount, transports, deviceType, backup status. Counter tracking prevents replay attacks.

MFA (TOTP)

EndpointDescription
enrollGenerate TOTP secret and OTPAuth URI for QR code
verifyVerify TOTP token, enable MFA, generate 10 backup codes
disableDisable MFA after TOTP verification
regenerateBackupCodesRegenerate backup codes
statusReturn MFA enrollment status

MFA enforcement via requireMFA() guard — throws FORBIDDEN if MFA not enabled for sensitive operations.

RBAC

5 roles with 54 total permissions:

RolePermissionsKey Access
CUSTOMER8Book services, view/cancel own bookings, write reviews
PROVIDER16Manage services, bookings, staff, customers, promotions, earnings
PARTNER5Partner dashboard, referrals, sellers, earnings
STAFF6View assigned bookings, manage own bookings, availability
ADMIN54All permissions including users, providers, system settings, security, compliance

Authorization guards: requireAuth, requireMFA, requireVerifiedEmail, requirePermission, requireRole, requireOwnership, requireProviderOwnership (with circuit breaker).

Key Routes (295 route files)

Public Routes

RoutePurpose
/Home page
/aboutAbout page
/pricingPricing plans
/faqsFAQ page
/whyWhy choose us
/featuresFeatures overview
/developersDeveloper page
/blogBlog listing
/changelogChangelog page
/contactContact page
/resourcesResources page
/search/:querySearch providers and services
/provider/:idProvider public page
/provider/:id/servicesProvider services list
/provider/:id/reviewsProvider reviews
/provider/:id/availabilityProvider availability
/provider/:id/contactContact provider
/provider/createCreate new provider account
/for-businessFor business landing
/productsProducts page
/policies/*Policy pages (terms, privacy, etc.)
/template/*Template pages

Auth Routes

RoutePurpose
/auth/signinSign in
/auth/signupSign up
/auth/reset-passwordReset password
/oauth/*OAuth callback handling

Provider Dashboard Routes

RoutePurpose
/provider/:id/dashboardDashboard overview
/provider/:id/dashboard/bookingsManage bookings
/provider/:id/dashboard/calendarCalendar view
/provider/:id/dashboard/customersCustomer management
/provider/:id/dashboard/staffStaff management
/provider/:id/dashboard/servicesService management
/provider/:id/dashboard/earningsEarnings reports
/provider/:id/dashboard/reviewsReview management
/provider/:id/dashboard/promotionsPromotion management
/provider/:id/dashboard/chatChat conversations
/provider/:id/dashboard/settingsProvider settings
/provider/:id/dashboard/notificationsNotifications
/provider/:id/dashboard/disputesDispute management
/provider/:id/dashboard/realtimeReal-time updates

Admin Routes

RoutePurpose
/admin/overviewAdmin overview
/admin/usersUser management
/admin/providersProvider management
/admin/provider/:idProvider detail
/admin/bookingsAll bookings
/admin/paymentsPayment management
/admin/subscriptionsSubscription management
/admin/disputesDispute resolution
/admin/promotionsPromotion management
/admin/referralsReferral management
/admin/seller-leadsSeller leads
/admin/reviewsReview moderation
/admin/reportsPlatform reports
/admin/settingsSystem settings
/admin/verificationsProvider verifications
/admin/certificationsCertification management
/admin/audit-logAudit log
/admin/securitySecurity settings
/admin/feature-flagsFeature flag management
/admin/communicationsCommunication management
/admin/complianceCompliance settings
/admin/domainsDomain management
/admin/integrationsIntegration management
/admin/marketingMarketing campaigns
/admin/notificationsNotification management
/admin/partnersPartner management
/admin/privacyPrivacy settings
/admin/supportSupport management

User Routes

RoutePurpose
/settingsUser settings
/settings/profileProfile settings
/settings/securitySecurity settings
/settings/notificationsNotification preferences
/settings/paymentsPayment methods
/settings/api-keysAPI key management
/settings/loyaltyLoyalty program
/settings/accountAccount settings
/settings/planPlan management
/settings/providerProvider settings
/settings/smart-notificationsSmart notification settings
/checkoutCheckout and payment
/onboardingProvider onboarding wizard
/nps-surveyNPS customer satisfaction survey
/[user]/bookings/:idBooking details
/[user]/my-bookings/:idMy booking history
/[user]/chat/:conversationIdChat conversation
/[user]/notifications/:notificationIdNotification details
/[user]/badgesAchievement badges
/[user]/checkin-qrCheck-in QR codes
/[user]/depositsDeposit payments
/[user]/group-bookingsGroup bookings
/[user]/loyalty-levelLoyalty level
/[user]/recurring-bookingsRecurring bookings
/[user]/streaksBooking streaks
/[user]/video-consultationsVideo consultations
/[user]/waitlistWaitlist
/[user]/settings/device-tokensDevice token management
/[user]/settings/notification-batchingNotification batching
/[user]/settings/notification-preferencesNotification preferences
/[user]/settings/preferencesUser preferences
/[user]/settings/securitySecurity settings

Partner Routes

RoutePurpose
/partnerPartner dashboard
/partner/referralReferral overview
/partner/referral/overviewReferral overview
/partner/referral/linksReferral links
/partner/referral/earningsReferral earnings
/partner/referral/referralsReferred accounts
/partner/referral/leaderboardLeaderboard
/partner/referral/resourcesPartner resources
/partner/referral/settingsPartner settings
/partner/sellerSeller overview
/partner/seller/overviewSeller overview
/partner/seller/leadsSeller leads
/partner/seller/dealsDeal management
/partner/seller/earningsSeller earnings
/partner/seller/leaderboardSeller leaderboard
/partner/seller/materialsSeller materials
/partner/seller/settingsSeller settings

API Routes

RoutePurpose
/api/rpc/$oRPC API endpoints
/api/rest/$REST API fallback
/api/docsAPI documentation page
/api/template/:templateId/contact-send-messageTemplate contact form

Additional Routes

RoutePurpose
/search/:querySearch results
/search/semanticSemantic search
/redirect/:codeShort URL redirect
/portalPortal access
/productsProducts page
/policies/*Policy pages (terms, privacy, cookies, etc.)
/resourcesResources overview
/resources/providers-guideProvider guide
/resources/user-guideUser guide

Server Handlers (21 handler groups)

Server-side oRPC handlers under src/server/ with 780+ files:

Handler GroupPathDescription
Adminsrc/server/admin/Admin operations — users, providers, disputes, promotions
AIsrc/server/ai/AI-powered features and OpenAI integration
Billingsrc/server/billing/Billing and subscription operations
Blogsrc/server/blog/Blog content management
Chatsrc/server/chat/Real-time chat operations
Checkoutsrc/server/checkout/Payment checkout and Stripe integration
Communicationsrc/server/communication/Email, SMS, and notification dispatch
Feature Flagssrc/server/feature-flags/Feature flag management and evaluation
Integrationssrc/server/integrations/Third-party integrations
Loyalty Programsrc/server/loyalty-program/Loyalty points and rewards management
Notificationssrc/server/notifications/Notification management
Partnerssrc/server/partners/Partner referral and seller operations
Paymentssrc/server/payments/Payment processing and Stripe Connect operations
Providersrc/server/provider/Provider operations — bookings, services, staff, reviews
Realtimesrc/server/realtime/Real-time update handlers
Reviewssrc/server/reviews/Review and rating operations
Searchsrc/server/search/Search and filtering operations
Social Sharingsrc/server/social-sharing/Social sharing link generation
Supportsrc/server/support/Support ticket operations
Usersrc/server/user/User profile and settings operations
Videosrc/server/video/Video consultation operations

Integration Workspaces

Apple Business Connect (integrations/apple-business-connect)

Server-side API client for Apple Business Connect, enabling booking actions and business data sync.

FeatureDescription
Booking ActionsCreate book, reserve, and waitlist actions
Business Connect ClientAPI client for Apple Business Connect
Server-side OnlyNever imported into client-side code
Zod ValidationAll API inputs validated with Zod

Google Maps Booking (integrations/google-maps-booking)

Server-side API client for Google Maps Booking (Google Business Profile), enabling merchant/service feed management, booking server callbacks, waitlist, and channel orders.

FeatureDescription
OAuth2 AuthGoogle service account JWT signing via jose
FeedsCreate merchants, services, and availability slots
Booking ServerRouter for Google Booking Server callbacks (9 endpoints)
WaitlistJoin, get info, and leave waitlist via /v3/JoinWaitlist, /v3/GetWaitlistInfo, /v3/LeaveWaitlist
Channel OrdersCreate and update orders via /v3/CreateOrder, /v3/UpdateOrder with channel_orders and channel_order_items tables
Webhook SecurityHMAC-SHA256 signature verification with constant-time comparison, 5-minute replay window, idempotency via event ID
Platform AdapterMaps Google entities to platform via channel_connections and channel_listings with status mapping
Sandbox ModeConfigurable via GOOGLE_MAPS_BOOKING_SANDBOX env var
Server-side OnlyNever imported into client-side code

Channel Orders (New)

Channel orders use migration 0040-channel-orders.ts with two tables: channel_orders (status: pending/confirmed/cancelled/fulfilled) and channel_order_items (links to inventory_items). External order ID format: gmo-{connection_id}-{service_id}-{timestamp}.

Claude App (integrations/claude-app)

MCP server for Claude AI integration using Claude Agent SDK.

FeatureDescription
MCP ProtocolStandard MCP server over stdio
Booking ToolsQuery bookings, create bookings, manage availability
Customer ToolsSearch customers, update customer info
Provider ToolsGet provider info, manage services
AuthAPI key based authentication

ChatGPT App (integrations/chatgpt-app)

MCP server for ChatGPT integration using Codex Plugin format.

FeatureDescription
Codex PluginChatGPT-compatible plugin format
MCP ProtocolStandard MCP server
Shared ToolsUses @booking/integrations-shared for tool definitions

LINE LIFF (integrations/line-liff)

LINE LIFF web app running inside LINE in-app browser.

FeatureDescription
LIFF SDK@line/liff for LINE integration
ProfileGet LINE profile and login
MessagesSend messages via LIFF
ShareShare content via LINE

Integrations Shared (integrations/shared)

Shared utilities for all integration workspaces.

ExportDescription
src/index.tsCommon types and utilities
src/tools.tsMCP tool definitions
src/client.tsClient utilities for API communication

Mobile App (apps/mobile)

Capacitor-based mobile app with native features:

FeaturePluginDescription
App Lifecycle@capacitor/appApp lifecycle management
Camera@capacitor/cameraCamera access for photos
Geolocation@capacitor/geolocationLocation services
Haptics@capacitor/hapticsHaptic feedback
Local Notifications@capacitor/local-notificationsLocal push notifications
Preferences@capacitor/preferencesLocal data persistence
Push Notifications@capacitor/push-notificationsRemote push notifications
Share@capacitor/shareNative share sheet
Biometric Auth@capgo/capacitor-native-biometricFingerprint/face authentication

Documentation Site (apps/docs)

VitePress documentation with dynamic data:

ComponentData SourceDescription
ProjectOverviewproject.jsonProject info, version, branch, last commit
FeaturesTablefeatures.jsonAll routes and modules from codebase scan
TestResultstest-results.jsonTest status across workspaces
ReleaseTimelinereleases.jsonGit tags and release history
CommitHistoryreleases.jsonRecent commits with conventional commit types

Health CLI (tools/health)

Project health analysis CLI (@booking/tools-health) with 60+ category analyzers across 5 domains:

DomainCategoriesDescription
User-Facing9Accessibility, responsive design, i18n, UX/UI, PWA
Security & Compliance8Auth, RBAC, secrets, input sanitization, data leak
Backend & Data16API, database, caching, queue, webhooks, migrations
Infrastructure10Deployment, CI/CD, monitoring, caching, cost
Code & Architecture17Code quality, types, naming, testing, dependencies


previous: Project Overviewnext: Workspaces

Released under the MIT License.