From bdd2e5968f3ef03bb76b8f58f498cb7d1367817a Mon Sep 17 00:00:00 2001 From: TopherMayor Date: Thu, 30 Apr 2026 19:58:22 -0700 Subject: [PATCH] Add guest auth for Cabo voters --- README.md | 2 + public/index.html | 276 ++++++++++++++++++++++++++++++++++++---------- seed-data.js | 21 +++- server.js | 196 ++++++++++++++++++++++++++++---- 4 files changed, 410 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index 902282a..cba237c 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ node server.js - **Source-selectable price tracking** — switch each option between Apple, Costco, KAYAK, and other tracked sources - **Package vs standalone labels** — bundled flight+hotel quotes stay distinct from room-only, flight-only, tee-time, table, charter, and excursion prices - **Decision detail cards** — automation-enriched pricing, features, amenities, and tradeoffs appear on each option +- **Guest authentication** — bachelor-party voters sign in with their name and the last 4 digits of their phone number - **Add suggestions** — anyone can propose new venues - **Admin approval** — pending options require approval before going live - **Responsive** — works on desktop and mobile @@ -30,6 +31,7 @@ Votes are stored in `data/votes.json` (created on first run). Edit directly or u System seed data auto-refreshes researched options while preserving existing votes and user-added options. Price-watch automation runs append time-series snapshots in `price-watch/history.jsonl`, which the app turns into per-option trend lines and decision detail cards. Automation output should cover hotels, flights, golf, nightlife, and excursions, with `bookingType` and `priceBasis` separating package quotes from standalone booking prices. When a run includes calculated `budgetScenarios` or `derivedItineraries`, the app uses those fresh automation calculations instead of the static seed budget scenarios. +Guest access is rostered in `seed-data.js` and `data/votes.json`; Jon is marked as groom and Toph as best man. For hosted deployments, set `DATA_DIR` or `DATA_FILE` so mutable vote data lives outside the Git checkout. When price-watch automation updates tracked data files in the repository, commit/push those changes and refresh the Ubuntu deployment so the hosted app picks up the latest option details, price history, itinerary calculations, and budget scenarios. diff --git a/public/index.html b/public/index.html index e09bae9..0d233d6 100644 --- a/public/index.html +++ b/public/index.html @@ -399,6 +399,16 @@ font-size: 0.75rem; color: var(--accent); } + .voter-badge .role-tag { + font-size: 0.62rem; + letter-spacing: 0.04em; + text-transform: uppercase; + background: rgba(52,211,153,0.12); + color: var(--green); + border: 1px solid rgba(52,211,153,0.22); + border-radius: 999px; + padding: 2px 8px; + } .voter-badge button { background: none; border: none; @@ -437,7 +447,8 @@ } .modal h2 { font-size: 1.3rem; margin-bottom: 6px; color: var(--accent); } .modal p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 20px; } - .modal input { + .modal input, + .modal select { width: 100%; padding: 10px 14px; background: var(--surface2); @@ -449,7 +460,26 @@ margin-bottom: 12px; transition: border-color 0.2s; } - .modal input:focus { border-color: var(--accent); } + .modal input:focus, + .modal select:focus { border-color: var(--accent); } + .modal select { + appearance: none; + cursor: pointer; + } + .auth-help { + margin-top: -6px; + margin-bottom: 14px; + color: var(--text-muted); + font-size: 0.72rem; + line-height: 1.4; + } + .auth-status { + min-height: 18px; + margin: -6px 0 12px; + font-size: 0.75rem; + color: var(--red); + text-align: left; + } .modal button { width: 100%; padding: 10px; @@ -1322,14 +1352,17 @@ - -