Commit Graph

5 Commits

Author SHA1 Message Date
jhodgkin f7f9b14771 Fix better-sqlite3 glibc/musl mismatch on Alpine (issue #6 followup)
Deploy to Dev / Deploy & Smoke Test (push) Failing after 1m29s
prebuild-install downloads a prebuilt glibc .node binary for linux-x64 which
fails on Alpine (musl) with 'fcntl64: symbol not found'. Adding an explicit
npm rebuild --build-from-source step forces compilation against musl libc
inside the container, which is correct.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 09:34:34 -06:00
jhodgkin eea64006fc Add contract e-signature step with PDF viewer and canvas pad (issue #6)
Deploy to Dev / Deploy & Smoke Test (push) Failing after 32s
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>
2026-07-08 09:31:13 -06:00
jhodgkin d7810d0258 Add package-lock.json and fix npm ci in Dockerfile
Deploy to Dev / Deploy & Smoke Test (push) Failing after 4s
Generated lockfile on dev LXC (Node 20, npm 10). Dockerfile now uses
npm ci --omit=dev which requires the lockfile and is more deterministic
than npm install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 22:54:03 -06:00
jhodgkin 4a79fe3ad2 Fix npm ci flag for npm 9+ compatibility
Deploy to Dev / Deploy & Smoke Test (push) Failing after 5s
--only=production was removed in npm 9; use --omit=dev instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 22:51:43 -06:00
jhodgkin e824be7e5d Add Node.js/Express API service for booking backend
Build and Deploy / build (push) Failing after 20s
Build and Deploy / deploy (push) Has been skipped
- 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>
2026-07-07 22:30:18 -06:00