Behind the scenes

How the site works (plain English)

A quick tour of the architecture so families and collaborators know what keeps Games inc. Jr running smoothly.

  1. Built with Next.js so most screens render on the server for instant loads.
  2. Game metadata lives in a tiny JSON file and a helper reads it across the app.
  3. Playable demos are static HTML/JS bundles inside /public, embedded with sandboxed iframes.
  4. Community posts go through a simple API backed by Upstash Redis (with an in-memory fallback for local dev).
  5. Magic AI Friends: per‑user sessions via a simple username cookie; chat logs saved to Vercel Blob (filesystem fallback in dev).
  6. Magic AI Friends: streaming NDJSON responses from the API; the client displays tokens live and prepends the last 20 Q&A pairs as context.
  7. Magic AI Friends: centralised character prompts; short replies by default with optional longer Story:/Fact: sections.
  8. Security headers and iframe sandboxing keep previews contained.
  9. Italian and English copy live side by side so localisation is easy to expand.
  10. Deployments run on Vercel—push to main and the site updates automatically.
How the site works • Games Inc Jr