- api/auth.js: zero-dep OIDC authorization-code flow with PKCE against
Authentik; HMAC-signed HttpOnly session cookies (SESSION_SECRET)
- requireAdmin now accepts an OIDC session in the admin group; legacy
ADMIN_SECRET bearer kept for n8n and scripts
- New client endpoints: GET /api/my-bookings, owner-gated contract download
- Bookings created while signed in are bound to the client's OIDC sub
- Dashboard: "Sign in with SSO" alongside passphrase fallback
- New /my-bookings portal page (nginx route + themed page)
- Fix booking modal: content area now scrolls; nav no longer overlaps the
calendar on short viewports (was swallowing clicks on date cells)
- 10 new Playwright tests; suite green at 67
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- api/google-calendar.js: service account JWT auth + freebusy query
using only Node.js built-in crypto (no new npm deps). In-memory cache:
5-min busy dates, 1-hr OAuth token. Gracefully returns empty busy list
when GOOGLE_CALENDAR_ID / GOOGLE_SERVICE_ACCOUNT_JSON not configured.
- api/server.js: GET /api/availability?year=YYYY&month=MM endpoint
with 5-min Cache-Control; errors return { busy:[], configured:false }
so the UI always works even if Calendar is unavailable.
- src/index.html: replace plain <input type="date"> in step 1 with a
custom month-grid calendar (dpInit/dpRender/dpNav/dpSelectDate).
Hidden #session-date input carries the value for the rest of the wizard.
Past dates and busy dates are visually blocked; month nav pre-fetches.
- tests/booking.spec.js: 4 new calendar UI tests + updated openAndPickDate
helper to click a rendered day cell.
- tests/api.spec.js: 2 new availability endpoint tests.
Setup: set GOOGLE_CALENDAR_ID and GOOGLE_SERVICE_ACCOUNT_JSON in api/.env.
See api/google-calendar.js header for step-by-step instructions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract notify() helper (fire-and-forget, never blocks flow)
- Fire booking_created after INSERT in POST /api/bookings
- Fire contract_signed after PDF stamp in POST /api/bookings/:id/sign
- Add GET /api/bookings/:id/contract to serve signed PDFs
- New env vars: N8N_WEBHOOK_URL, PHOTOGRAPHER_EMAIL, SITE_URL
n8n workflow (LisiLou Booking Notifications, ID c2oyyQyuzMuo1kLw):
Webhook → Code (routes by event, builds email items) → Send Email (SMTP)
Handles: booking_created (2 emails), contract_signed, payment_confirmed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Step reorder (still 7 steps): Info (5) → Contract (6) → Payment (7)
- Client info moved to step 5 so it's available for the contract signature
name and the personalised Venmo note before the payment step
- Contract is now step 6 (initContractStep triggered on step 6 entry)
- Step 7 is the full payment step — no separate confirm step needed
Payment step (step 7):
- Compact summary table: date, session type, length, location
- Large price display from siteConfig.booking.pricing
- "Pay on Venmo" button linking to:
https://venmo.com/<username>?txn=pay&amount=<price>¬e=<encoded-note>
Note format: "LisiLou Booking - [SessionType] on [Date]"
- QR code rendered from GET /api/venmo-qr?url=<encoded> (server-side SVG
via qrcode package, site colours applied)
- "I've sent payment" checkbox gates the Submit button
- Clicking Submit creates booking with payment_status='pending_confirmation',
then signs the contract — success screen shown immediately
Configuration: venmoUsername lives in config/site.json under
booking.venmoUsername — change it there to point at any Venmo account with
no code change and no rebuild.
API additions:
- GET /api/venmo-qr?url= — validates url starts with venmo.com, returns SVG
- POST /api/bookings now accepts payment_status field
Closes#7
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Frontend (step 5):
- PDF.js 3.11.174 from CDN renders the contract inline in a scrollable viewer
- Next button logic stays unlocked; signature pad is visually locked (greyed +
pointer-events:none) until user scrolls to the bottom of the contract
- HTML5 canvas signature pad with mouse and touch support; Clear button resets
- Typed full name field required to confirm identity
- Fallback agreement text renders if /api/contracts/template returns 404,
auto-marks as scrolled — photographer adds PDF later with no code change
Backend:
- GET /api/contracts/template — serves api/contracts/model-release.pdf
- POST /api/bookings/:id/sign — stamps signature image + name/date/booking ID
onto the PDF via pdf-lib, saves to api/signed-contracts/<id>.pdf, updates
contract_signed_at and contract_pdf_path in the bookings table, fires n8n
webhook; gracefully skips PDF stamping if template is missing
- submitBooking() now calls POST /api/bookings then POST /api/bookings/:id/sign
sequentially before showing the success screen
Closes#6
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New api/ service: Express + better-sqlite3, health check at GET /api/health,
POST /api/bookings stores sessions with all required fields
- Dockerfile with Alpine build deps for native sqlite3 module
- docker-compose.yml: api service with volume mounts for data, signed-contracts, contracts
- nginx.conf: proxy /api/ to api:3001; Immich regex locations remain higher priority
- .gitignore: exclude SQLite db file and signed PDFs from version control
Closes#1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>