Simple password-protected admin page for managing bookings #9

Closed
opened 2026-07-07 21:39:11 -06:00 by jhodgkin · 1 comment
Owner

Goal

A minimal admin page at /admin where the photographer can see upcoming bookings and confirm Venmo payments.

Authentication

  • Single password stored as ADMIN_PASSWORD_HASH (bcrypt) in api/.env
  • POST /api/admin/login returns a signed JWT (24hr expiry)
  • All /api/admin/* routes require Authorization: Bearer <token>
  • Admin page stores JWT in sessionStorage

Admin page (src/admin.html)

Served by nginx at /admin — separate file from the main portfolio.

Bookings table showing:

  • Client name + email
  • Session date, type, length
  • Location
  • Contract signed (yes/no + download link)
  • Payment status badge (pending / pending_confirmation / confirmed)
  • Actions: "Confirm Payment" button, "Cancel Booking" button

Filters: upcoming only | all | pending payment

API endpoints

  • GET /api/admin/bookings — list all bookings (newest first)
  • PATCH /api/admin/bookings/:id — update status/payment_status
  • GET /api/admin/bookings/:id/contract — download signed PDF

Acceptance

  • Can log in with the configured password
  • Clicking "Confirm Payment" updates the record and triggers the n8n payment-confirmed webhook
  • Signed PDF is downloadable
## Goal A minimal admin page at `/admin` where the photographer can see upcoming bookings and confirm Venmo payments. ## Authentication - Single password stored as `ADMIN_PASSWORD_HASH` (bcrypt) in `api/.env` - `POST /api/admin/login` returns a signed JWT (24hr expiry) - All `/api/admin/*` routes require `Authorization: Bearer <token>` - Admin page stores JWT in sessionStorage ## Admin page (`src/admin.html`) Served by nginx at `/admin` — separate file from the main portfolio. **Bookings table showing:** - Client name + email - Session date, type, length - Location - Contract signed (yes/no + download link) - Payment status badge (pending / pending_confirmation / confirmed) - Actions: "Confirm Payment" button, "Cancel Booking" button **Filters:** upcoming only | all | pending payment ## API endpoints - `GET /api/admin/bookings` — list all bookings (newest first) - `PATCH /api/admin/bookings/:id` — update status/payment_status - `GET /api/admin/bookings/:id/contract` — download signed PDF ## Acceptance - Can log in with the configured password - Clicking "Confirm Payment" updates the record and triggers the n8n payment-confirmed webhook - Signed PDF is downloadable
Author
Owner

Superseded by #10 (Authentik OIDC) and #11 (full management dashboard). Closing.

Superseded by #10 (Authentik OIDC) and #11 (full management dashboard). Closing.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jhodgkin/lisilou-portfolio#9