- JavaScript 75.5%
- CSS 14.6%
- Shell 5.9%
- HTML 3.5%
- Dockerfile 0.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Justified with hyphens, so a phone-width measure doesn't open rivers. docs/deploy.md is the step-by-step: push, ssh puff, ssc app update ladle, what to check, how to roll back, and how to change env without editing the host. |
||
| deploy | ||
| docs | ||
| public | ||
| src | ||
| test | ||
| .dockerignore | ||
| .env.local.example | ||
| .gitignore | ||
| docker-compose.local.yml | ||
| docker-compose.yml | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
Ladle
A wish-pot for the Stone Soup Cluster's How Hybrids Bond exhibition at Angel's Gate (21 Nov 2026 – 23 Jan 2027).
A visitor scans a QR code, gets one question about what an archive should be, and answers on their phone. Their answer appears on a screen inside a soup pot. When nobody has submitted for three minutes, the pot starts surfacing old wishes, one every 45 seconds, until someone new arrives.
Three faces on one host:
| Path | Who | What |
|---|---|---|
/ |
phones | a welcome, one question, one field, one button |
/soup |
the pot's display | fullscreen viewer, no chrome, no cursor |
/admin |
the operator | submissions and questions, password-gated |
Run it
npm install
cp deploy/.env.example deploy/.env # set PUBLIC_URL at minimum
npm start # http://localhost:3000
Or with Docker (the root compose is the production shape; the local override adds the published port, the env file and the data bind mount):
cp deploy/.env.example deploy/.env
docker compose -f docker-compose.yml -f docker-compose.local.yml up --build
Data lives in one SQLite file at $DATA_DIR/ladle.db (default ./data). Back it up by copying that file, or with sqlite3 ladle.db ".backup backup.db".
Try it locally, fast
The real timings — a 3-minute dwell, then an old wish every 45 seconds — are too slow to sit through while building. npm run demo shrinks the clock to 15 s dwell / 5 s rotation and turns off the per-IP submission throttle:
npm ci
cp .env.local.example .env # real timings; edit freely
npm start # http://localhost:3000 — the show's clock
npm run demo # the fast clock, for watching the rotation
Both read .env from the repo root (node --env-file-if-exists), and a variable set on the command line still wins over the file. npm run demo only supplies the fast values when you don't, so IDLE_SECONDS=45 npm run demo gives you the real rotation with the submission throttle off.
demo is a viewing aid, not the show's timing: 5 seconds is not what the gallery runs.
Then, in three terminals or three tabs:
- open
/on a phone or in a browser, submit an answer — it should appear at/soupwithin a second; - open
/soupfullscreen (F11) and submit again — the answer cross-fades in; - wait 15 s with no submissions — the pot starts showing old wishes every 5 s;
curl -s localhost:3000/api/stateshows exactly what the server thinks the screen is showing;rm -rf dataresets every answer and re-seeds the questions.
To test from a phone on the same wifi, set PUBLIC_URL to this machine's LAN address so the QR code in /q.png points somewhere the phone can reach:
PUBLIC_URL=http://192.168.1.50:3000 npm run demo
# phone: http://192.168.1.50:3000/ · QR: http://192.168.1.50:3000/q.png
The floors are deliberate: dwell can't go below 10 s and the idle gap can't go below 1 s (src/server.js), so a mistyped env var can't make the screen flicker.
Environment
| Variable | Default | Meaning |
|---|---|---|
PUBLIC_URL |
http://localhost:3000 |
The address the QR code points at |
PORT |
3000 |
Listen port |
DATA_DIR |
./data |
Where ladle.db lives |
DWELL_MINUTES |
3 |
How long a new answer holds the screen |
IDLE_SECONDS |
45 |
Gap between old wishes once the pot goes quiet |
SUBMIT_WINDOW_MS |
10000 |
Per-IP submission cooldown |
TRUST_PROXY |
true |
Believe X-Forwarded-For (behind Caddy/nginx) |
ADMIN_PASSWORD |
— | Admin login password |
LADLE_SECRET |
— | Stable signing key for the admin cookie |
CLUSTER_URL |
https://cluster.secretserver.club |
Where the footer's cluster name links |
SSC_SERVER |
— (empty) | This node's name in the footer (celery → "hosted on Celery"); empty drops the node |
Tests
npm test
Deploy
Deploys run from Puff, the cluster gateway: push, ssh puff, sudo ssc app update ladle. The step-by-step, including the checks and the rollback, is docs/deploy.md.
Moderate
/admin is a phone-sized moderation page behind ADMIN_PASSWORD. It lists visible submissions newest-first with a one-tap hide (a soft delete — the export keeps the row), lets you add a question or retire one without deleting it, edits the welcome above the form (heading, blurb, or blank to hide each line), and downloads /admin/export.json with hidden rows intact. The signed admin cookie lasts 12 hours; LADLE_SECRET is what keeps it valid across redeploys.
How it works
The server owns the clock. src/state.js decides what is on the screen, when it changes, and which old wish comes back; /api/stream (SSE) pushes each change and /api/state gives the same payload on demand, so the viewer is a dumb renderer that recovers from any restart by re-syncing once. /soup and the Pi guide live in deploy/ and docs/.
The kiosk setup lands in deploy/ and docs/kiosk.md in unit 04.