feat: online booking portal (closes groombook/groombook#3) (#27)

Add customer-facing booking flow with three public API endpoints
(/api/book/services, /api/book/availability, /api/book/appointments)
and a four-step React wizard (service → date/time → contact info → confirm).

Availability is computed from real groomer schedules with slot-level
conflict detection. Booking auto-creates or matches clients by email
and uses a transaction to guard against race conditions.

Co-authored-by: Groom Book CTO <cto@groombook.app>
Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit was merged in pull request #27.
This commit is contained in:
groombook-paperclip[bot]
2026-03-17 20:16:12 +00:00
committed by GitHub
parent b767a00b5f
commit e524099214
4 changed files with 853 additions and 0 deletions
+4
View File
@@ -8,6 +8,7 @@ import { servicesRouter } from "./routes/services.js";
import { appointmentsRouter } from "./routes/appointments.js";
import { staffRouter } from "./routes/staff.js";
import { invoicesRouter } from "./routes/invoices.js";
import { bookRouter } from "./routes/book.js";
import { authMiddleware } from "./middleware/auth.js";
const app = new Hono();
@@ -25,6 +26,9 @@ app.use(
// Health check (no auth required)
app.get("/health", (c) => c.json({ status: "ok" }));
// Public booking routes — no auth required, must be registered before auth middleware
app.route("/api/book", bookRouter);
// Protected API routes
const api = app.basePath("/api");
api.use("*", authMiddleware);