Commit Graph

26 Commits

Author SHA1 Message Date
jhodgkin 4aa534d1f7 Add Playwright test suite (51 tests, all passing)
Deploy to Dev / Deploy & Smoke Test (push) Successful in 23s
- tests/api.spec.js: 17 tests covering public booking API and admin CRUD
  (health, POST bookings, auth rejection, stats, filters, PATCH, CSV export)
- tests/booking.spec.js: 12 tests covering the 7-step booking wizard
  (open/close, date validation, step progression, contract scroll+signature,
  payment checkbox, full end-to-end booking flow)
- tests/dashboard.spec.js: 15 tests covering the admin dashboard
  (login, wrong passphrase, Enter key, sign out, overview stats, calendar
  month nav, bookings table, search filter, row expand, CSV download)
- tests/portfolio.spec.js: 7 tests covering the portfolio site
  (nav, book button, portfolio section, config, health, theme color)
- playwright.config.js: Chromium headless, BASE_URL + ADMIN_SECRET via env
- Fix dangling client-email input outside step-panel (was visible, making
  the booking modal taller and hiding the Next button in headless mode)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 22:57:49 -06:00
jhodgkin 643e5afdc8 Add admin dashboard (issue #11) + admin API routes
Deploy to Dev / Deploy & Smoke Test (push) Successful in 24s
- New src/dashboard.html: vanilla JS SPA with login (bearer token),
  Overview stats, Calendar month view with color-coded dots,
  Bookings table with expandable payment block and confirm action,
  Payments panel with revenue summary and CSV export
- api/server.js: admin routes behind requireAdmin middleware:
  GET /api/admin/stats, GET /api/admin/bookings, PATCH /api/admin/bookings/:id,
  GET /api/admin/payments/export; PATCH fires payment_confirmed n8n event
- nginx.conf: /dashboard location serves dashboard.html
- api/.env.example: add ADMIN_SECRET placeholder

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 22:17:26 -06:00
jhodgkin bda916915c Add smoke test for signed contract download endpoint
Deploy to Dev / Deploy & Smoke Test (push) Successful in 23s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 21:48:07 -06:00
jhodgkin 0e18f2b5b3 Add n8n webhook notifications for all booking events
Deploy to Dev / Deploy & Smoke Test (push) Successful in 24s
- 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>
2026-07-08 21:43:25 -06:00
jhodgkin 5a333b5bf1 Switch theme to dusty rose/blush pink palette
Deploy to Dev / Deploy & Smoke Test (push) Successful in 24s
primaryColor: #B06A7A (dusty rose)
accentColor:  #E8C4CC (soft blush)
backgroundColor: #FEF9FA (warm white with pink undertone)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 21:12:31 -06:00
jhodgkin f58f5534c6 Add Venmo payment step with QR code and configurable username (issue #7)
Deploy to Dev / Deploy & Smoke Test (push) Successful in 27s
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>&note=<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>
2026-07-08 12:58:49 -06:00
jhodgkin 73403a0ddb Switch API base image from Alpine to node:20-slim (Debian)
Deploy to Dev / Deploy & Smoke Test (push) Successful in 1m14s
better-sqlite3's prebuild-install downloads prebuilt glibc binaries for
linux-x64, which fail on Alpine's musl libc with 'fcntl64: symbol not found'.
npm_config_build_from_source was not being honoured. Switching to a
glibc-based image sidesteps the issue entirely; homelab image size is fine.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 10:41:24 -06:00
jhodgkin 3412595d79 Fix better-sqlite3 Alpine build: force source compilation via env var
Deploy to Dev / Deploy & Smoke Test (push) Failing after 1m27s
npm_config_build_from_source=true tells prebuild-install to skip the prebuilt
glibc binary download and compile against the container's musl libc instead.
The previous attempt (npm rebuild --build-from-source) ran after the glibc
binary was already installed and didn't override it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 09:37:17 -06:00
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 865ed4d001 Update CLAUDE.md to reflect current booking system architecture
Deploy to Dev / Deploy & Smoke Test (push) Successful in 17s
Documents the two-service Docker Compose setup, booking wizard step status,
all JS functions, location photo workflow, CI/CD pattern, and pending issues
so the project can be resumed from any machine that clones the repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 23:11:07 -06:00
jhodgkin 497ee38696 Add config-driven location picker with photo guide (issue #5)
Deploy to Dev / Deploy & Smoke Test (push) Successful in 17s
- site.json: add locations array (River Bottoms, City Park, Downtown, Studio)
  with heroImage, galleryImages, tags, and description per location
- public/images/locations/: directory skeleton with .gitkeep; photographer
  drops hero.jpg + numbered gallery images here without any rebuild
- Step 4: location-grid renders cards from config, each with hero image,
  location name, and tag pills; missing images fall back to a styled placeholder
- Clicking a card selects it (shows checkmark overlay) and opens an inline
  detail panel below the grid showing gallery images + full description + tags;
  clicking the same card again collapses the detail panel
- populateSummary and submitBooking now resolve the location name from config
  rather than storing the raw ID

Closes #5

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 23:05:33 -06:00
jhodgkin 07224ba1e7 Implement config-driven session type and length steps (issue #4)
Deploy to Dev / Deploy & Smoke Test (push) Successful in 18s
- site.json: add booking section with sessionTypes, pricing, venmoUsername
- Step 2: session type cards rendered from siteConfig.booking.sessionTypes;
  "Other" option reveals a free-text field; validated before advancing
- Step 3: two large length cards with duration badge + price from config;
  falls back to $75/$150 defaults if config missing
- selectOption shows/hides "Other" field; stores sessionTypeOther in state
- populateSummary uses config labels and shows price in length summary row
- submitBooking sends "other: <description>" for custom session types

Closes #4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 23:00:39 -06:00
jhodgkin f5a2b1ab4f Use git reset --hard in deploy to handle working tree drift
Deploy to Dev / Deploy & Smoke Test (push) Successful in 32s
git pull fails if untracked files would be overwritten. Switching to
git fetch + reset --hard keeps the dev LXC in sync unconditionally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 22:55:03 -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 9209fbdcfc Add trunk-based dev deployment with smoke tests
Deploy to Dev / Deploy & Smoke Test (push) Failing after 17s
- Gitea Action: push to main → SSH deploy to CT114 (lisilou-dev, 192.168.1.192)
  git pull → docker compose build → up -d → health wait → smoke tests
- scripts/smoke-test.sh: 6 curl assertions covering site load, nginx health,
  API health, config serving, booking POST, and nginx routing sanity
- Replaces the non-functional registry-based deploy workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 22:50:30 -06:00
jhodgkin 28d60fca04 Add multi-step booking form modal shell
Build and Deploy / build (push) Failing after 20s
Build and Deploy / deploy (push) Has been skipped
- 7-step booking flow modal: Date → Session → Length → Location →
  Contract → Payment → Confirm
- Step indicator bar with completed/active states and connector lines
- Per-step validation with inline error messages
- Option card selection pattern for steps 2, 3, 4
- Summary panel on step 7 with client contact fields
- POSTs to POST /api/bookings on final submit with success screen
- Book a Session button added to nav, hero CTA, and mobile nav
- Pricing pulled from siteConfig.booking.pricing when available
- Steps 3-6 have stub UI with comments marking which issue fills them

Closes #2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 22:36: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
root 4122e2d128 Add GitHub Actions auto-deployment workflow
Build and Deploy / build (push) Failing after 5m27s
Build and Deploy / deploy (push) Has been skipped
- Created self-hosted runner workflow for automatic deployment
- Deploys on push to main branch
- Builds and restarts Docker containers
- Includes health check verification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-20 05:10:07 +00:00
root 4bfe9c18b8 Update portfolio albums and category names
- Updated Immich base URL to immich.jerodrigged.com
- Senior Portraits: use all-seniors album
- Changed Engagements to Couples, use all-couples album
- Changed Families to Family or Friends, use families-or-friends album

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-20 04:25:22 +00:00
jhodgkin 68fda8be49 Simplify template detection - check local first
Directly check pveam list local for existing Debian 12 template
before attempting download.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 12:07:57 -07:00
jhodgkin 7a5a4a3499 Improve Proxmox template detection
- Check for existing local templates first
- Show available templates for debugging
- Allow manual template entry as fallback
- Fix template path handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 12:03:42 -07:00
jhodgkin ee97d35bfe Fix Proxmox script to find template dynamically
Instead of hardcoding the template name, now searches for the
latest available Debian 12 template.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 12:02:01 -07:00
jhodgkin 6aa43a0215 Add Proxmox LXC helper script for deployment
Creates a Debian 12 LXC container with Docker and deploys
the portfolio automatically.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 10:41:46 -07:00
jhodgkin 4420dd51ac Initial commit: LisiLou Photography Portfolio
Features:
- Immich integration with automatic album image carousel
- Dynamic configuration via JSON files
- Nginx proxy for Immich API access
- Docker deployment ready
- Gitea Actions CI/CD workflow

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 10:35:55 -07:00