ReservationEngine
A multi-tenant booking engine: providers publish services and schedules, consumers book them.
- Stack
- NestJS
- Prisma
- PostgreSQL
- Next.js
Related:Eduka Plus
01 — Context
ReservationEngine is a multi-tenant reservation engine. Providers publish services and a weekly schedule, and consumers book them. Tenant and Provider are the same thing: every tenant-owned row carries its provider id. Background: to be written.
02 — What I built
- A NestJS modular monolith with bounded contexts: accounts, providers and reservations.
- Prisma and PostgreSQL, with Row Level Security isolating each Provider's data in the database.
- A reservation state machine (pending, confirmed, completed, cancelled, expired, no-show) kept in a pure domain layer.
- Better Auth for authentication, and zod validation on the API.
- A Next.js frontend with shadcn/ui, Zustand, TanStack Query and react-hook-form.
- A test pyramid: unit tests, SQL tests against the database, API end-to-end tests, and Playwright browser tests, all run in GitHub Actions CI.
03 — Decisions
Tenant isolation in the database
Chose Postgres Row Level Security per Provider
The repo's RLS doc describes the mechanism: the tenant is set per transaction through a Postgres setting, and policies fail closed, so a missing setting returns no rows. The app connects as a role that is subject to RLS.
Layering and structure
Chose A modular monolith with a domain layer only for reservations
The repo's rules keep the pure state machine and slot math in the reservations domain, and use plain controller, service and Prisma elsewhere.
Testing strategy
Chose A test pyramid: unit, SQL, e2e, Playwright
Prompt: what did each layer catch that the others could not?
04 — Outcome
05 — Gallery
Screens are coming.