Commit Graph

12 Commits

Author SHA1 Message Date
jhodgkin 53677c9f6c Request Immich preview-size images instead of tiny default thumbnails
Deploy to Dev / Deploy & Smoke Test (push) Successful in 23s
The default /thumbnail endpoint serves a 250x374 WebP, which is
visibly blurry on portfolio cards meant to show off real work.
size=preview returns a ~1440px-wide JPEG at a reasonable file size,
confirmed directly against the live Immich instance.

Fixes #25.
2026-07-20 04:23:09 +00:00
jhodgkin 9dcc73ecfe Design pass: fix dead site config, add hero image support, polish cards
Deploy to Dev / Deploy & Smoke Test (push) Successful in 21s
- Fix applyConfig self-recursion (const _origApply captured the hoisted
  wrapper itself): site.json config — theme, portfolio, socials, bio —
  was never applied; site silently fell back to hardcoded brown defaults
- Strengthen theme test to assert the configured primary color exactly
- Portfolio covers: styled placeholder on missing image (like locations),
  restore img when Immich carousel kicks in; overlay always visible on touch
- Optional hero photo via site.heroImage with soft scrim (activates only
  when the image loads); site.json points at /images/hero.jpg
- Option cards: equal height, centered content
- /#book deep link also works via hashchange

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 00:39:36 -06:00
jhodgkin 84fdfdfdb8 Add Authentik OIDC auth (issue #10) + client portal /my-bookings (issue #13)
- 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>
2026-07-16 00:24:57 -06:00
jhodgkin bfe374206c Add Google Calendar availability date picker (issue #3)
Deploy to Dev / Deploy & Smoke Test (push) Successful in 24s
- 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>
2026-07-10 00:10:31 -06:00
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 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 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 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 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 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