origami.now (fresh baseline)

This Val is reset to a clean backend-first architecture:

  • The backend generates and stores the latest origami artifact.
  • The frontend is a minimal React UI that renders that artifact.
  • A cron job writes a new artifact each hour.

Structure

backend/ auth.ts index.http.ts origami.ts storage.ts frontend/ index.html app.js jobs/ generate-origami.cron.ts shared/ types.ts

Routes

  • GET /

    • Serves the React page.
    • Injects window.__INITIAL_DATA__ from backend storage/generation.
    • Supports ?force=1 for unprotected manual regeneration.
  • GET /api/origami/latest

    • Returns the latest artifact JSON.
    • Supports ?force=1 for unprotected manual regeneration.
  • POST /api/origami/generate

    • Token-protected by x-origami-token.
    • Optional JSON body: { "force": true }.

Generation model (current reset)

  • Uses Rabbit Ear as the source of square geometry.
  • Applies exactly two arbitrary crease+fold steps.
  • Black linework only.
  • Front/back paper colors are regenerated from the seed.
  • Stores latest-only at blob key origami_latest_v1.

Scheduling

  • Cron file: jobs/generate-origami.cron.ts
  • Intended schedule: once per hour.

Env vars

  • ORIGAMI_GENERATE_TOKEN for POST /api/origami/generate