NT-Connections/build.md
Aidan Dona b2f8e879ab Add puzzle hints and per-word descriptions with sources
Hint is revealed on demand below the board while playing. After the game
ends, each word's description and source link are listed below the
puzzle, and hovering a solved word highlights its entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 16:44:07 -05:00

2.3 KiB
Raw Blame History

Instructions

  • Design: Use design-taste-frontend skill

Build

  • Create a NYT Connections like game
  • Give me a page to create, store set games

Decisions

  • Stack: Node + Express + SQLite (one DB file), vanilla HTML/JS frontend. Runs with npm start.
  • Deploy: own VPS, behind nginx (reverse proxy to the Node port). DB file lives outside the web root and must be backed up.
  • Storage: server-side SQLite, shared for all players.
  • Editor access: admin only. Single password from env var ADMIN_PASSWORD; login sets a signed session cookie. All write endpoints require it.

Game rules (player page)

  • 16 words, 4 hidden groups of 4. Groups have a difficulty color: yellow, green, blue, purple.
  • Select up to 4 words, submit a guess. Correct group locks in at the top with its name.
  • 4 mistakes allowed, then the game ends and reveals remaining groups.
  • Shuffle button reorders the remaining words.
  • "One away..." message when a guess has 3 of 4 from one group.
  • Repeat guesses are not counted as mistakes.
  • Share results: copy an emoji grid (🟨🟩🟦🟪 per guess) to clipboard.
  • Hint: optional per-puzzle hint; a "Show hint" button below the board reveals it while playing.
  • About the words: after the game ends, each word's description and source link are listed below the puzzle. Hovering a word in a solved row highlights its description.

Pages

  • / — Puzzle of the day: the game whose assigned date is today; if none, the most recent past-dated game.
  • /puzzles — list of all published games (title, date) to pick and play.
  • /play/:id — play a specific game.
  • /admin — login, then create / edit / delete games.

Editor (admin page)

  • Fields: title, date (optional, unique), hint (optional), 4 groups × (name, color, 4 words, each with optional description and source URL).
  • Validation: exactly 16 words, no duplicates (case-insensitive), every field filled, each color used once.

Data model

  • games(id, title, date UNIQUE NULL, hint, groups_json, created_at, updated_at); each group in groups_json has details: [{ description, source }] parallel to words.
  • Answers are never sent to the browser before solved: the client posts guesses to /api/games/:id/guess and the server returns correct / one-away / wrong.

Out of scope (for now)

  • User accounts, stats/streaks, multiple admins.