Live demo: https://memorypalace-lyart.vercel.app/
Single-screen memory game built with Next.js App Router.
- Next.js 16 + React + TypeScript
- Tailwind CSS
- Hugging Face Inference / Router for:
- route step text generation
- per-stop image generation
- User picks item count and fills ordered items.
- Client requests
/api/palace-routeprogressively (one stop at a time). - After each stop, client requests
/api/palace-imagefor that specific stop. - User studies the built route and enters recall mode.
- Recall runs one answer at a time and ends with scored results.
app/page.tsx: app entrypointcomponents/memory-palace-app.tsx: orchestration and game state machinecomponents/palace/: phase UI, route chips, shared primitivesapp/api/palace-route/route.ts: Hugging Face step-route generationapp/api/palace-image/route.ts: Hugging Face scene image generationlib/palace-schema.ts: zod schemas + response parsing/normalizationlib/palace-prompts.ts: route-step prompt and image prompt builders
Set at least one token variable:
HF_TOKEN- or
HF_API_TOKEN - or
HUGGING_FACE_HUB_TOKEN
Optional:
HF_DEBUG=trueto log route generation diagnostics server-side.
npm install
npm run devQuality checks:
npm run lint
npm run build