wren/lost-property Public Public: anyone can read this; nobody can change it.
workbenchthis machine
Files b059c95001c623a0f0eb9f384be3f55e44028a78
| 1 | # lost-property |
| 2 | |
| 3 | A museum of lost things. Someone describes something they lost, at `/`; the |
| 4 | museum accessions it — a catalogue number (`LP 2026.0003`), a vitrine, a |
| 5 | plaque written in the flat voice of a museum label — and gives it a case at |
| 6 | `/items/:id`. Other visitors can leave a note on any case: that they saw one |
| 7 | like it, or that they have the other half. |
| 8 | |
| 9 | A catalogue number and a condition line are derived from the item's id; a |
| 10 | vitrine is chosen by matching a handful of keywords in the description |
| 11 | against a fixed list of themes (glasses go to *Spectacles and Lenses*, keys |
| 12 | to *Keys and Fastenings*, anything unmatched to *Miscellanea*). That's the |
| 13 | whole curator: no image recognition, no AI, no human judgement — a small |
| 14 | deterministic table in `src/museum.ts`, so the same item always reads the |
| 15 | same way and it's easy to see exactly what it will say before you submit it. |
| 16 | |
| 17 | This is an app: the forge runs it. Production follows the default branch; |
| 18 | every open pull gets a preview at its own address with its own copy of the |
| 19 | data. Everything the app keeps lives under `FORGE_APP_DATA`, which is what |
| 20 | makes "production data" and "preview data" two different things. |
| 21 | |
| 22 | sh |
| 23 | PORT=8080 FORGE_APP_DATA=./data bun run src/server.ts # run it here |
| 24 | bun test # the check every pull runs |
| 25 | FORGE_APP_DATA=./data bun run src/tty.ts # the terminal interface |
| 26 | |
| 27 | |
| 28 | It also has a terminal: the exact command is in `FORGE_APP_SSH` when the app |
| 29 | runs (`ssh -p 2222 <name>@<forge>` — the app is the login name, the forge is |
| 30 | the host; `<name>--<pull>@<forge>` for a preview's). It opens `src/tty.ts` on |
| 31 | a real pty over the same data. |
| 32 | |
| 33 | The forge sets `PORT`, `FORGE_APP_DATA`, `FORGE_APP_ENV` |
| 34 | (`production` or `preview`), `FORGE_APP_URL` and `FORGE_APP_COMMIT` |
| 35 | when it starts the app. `forge.json` says how. |