|
|
||
|---|---|---|
| .github/workflows | ||
| .w4c | ||
| app | ||
| docker | ||
| prisma | ||
| public | ||
| server | ||
| shared | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| eslint.config.mjs | ||
| nuxt.config.ts | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
Booking / Appointments — Nuxt 3 (templates2)
A ready-to-run appointments app for a service business: browse services, reserve a slot, get a
confirmation email + .ics invite, manage your own bookings, and run the day from an admin
calendar. It is a fork of templates2.Base.Nuxt and inherits the whole core — auth, roles, Prisma,
mock payments/email, an admin shell, SEO, i18n, observability, CI and a Docker image.
Quickstart
npm ci
cp .env.example .env # SQLite + mock providers by default — no keys needed
npm run db:setup # prisma db push + seed
npm run dev # http://localhost:3000
Demo accounts (seeded): admin@example.com (admin) and user@example.com (customer) — password
password.
What works out of the box
- Services — list + detail with duration and price; managed in the admin panel.
- Availability & slots — slots are generated server-side from each specialist's working hours in the site timezone; past slots and slots that would double-book a specialist are excluded.
- Booking flow — service → specialist (optional) → date → slot → details → confirmation, with a
mock/log confirmation email and an
.icscalendar link (/api/bookings/<id>/ics). - Customer account —
/account/bookingslists upcoming/past appointments and lets a signed-in customer cancel their own. - Admin calendar —
/admin/bookingshas day/week views, filters, manual booking creation and status transitions (pending → confirmed → completed / cancelled / no-show). - Auth & roles — email + password, httpOnly sessions; page guards in
server/middleware/guard.tsand API authorization (requireUser,requireAdmin,requireStaff). - SEO — per-page metadata, JSON-LD
LocalBusiness/Service,sitemap.xml(services included) androbots.txt. - Delivery — multi-stage Dockerfile with a healthcheck; CI runs lint + typecheck + unit + build + e2e smoke.
Timezones
Instants are stored in UTC. NUXT_PUBLIC_SITE_TIMEZONE (default UTC) is the IANA zone the
business operates in; slots are generated and displayed there. All date/time math uses
Intl/Date — no external date library.
Scripts
| Script | What it does |
|---|---|
npm run dev |
Dev server with HMR |
npm run build / npm start |
Production build / serve .output |
npm run lint / npm run typecheck |
ESLint / nuxt typecheck |
npm test |
Unit tests (Vitest) — slot generation & overlap |
npm run test:e2e |
HTTP end-to-end smoke (server must be running) |
npm run db:setup |
prisma db push + seed |
Data model
prisma/schema.prisma: the core (User, Session, Subscription, AuditLog) plus Service,
Staff, StaffService, WorkingHour and Booking. SQLite in dev, Postgres in production.
Deployment
docker compose -f docker/docker-compose.yml up --build
Quality
node templates2/qa.mjs Booking.Nuxt
See ../CONTRACT.md for the Definition of Done.