βŒ‚ back 2 the blessings πŸ™ steal the code on github

πŸ“œ the whitepage

~ a technical guide 2 building ur own daily inspirational quotes machine on wasmer edge ~

what even is this

A fully autonomous (de)motivational meme website. Once per day, an AI agent finds or invents a new trash-animal blessing, renders it in early-2000s glitter WordArt, and publishes it β€” with zero redeploys and zero humans involved. Visitors and per-blessing adoration are counted in a real Postgres database. The whole thing is one npm project on Wasmer Edge.

the architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” cron 0 0 * * * β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ cron job β”‚ ────── api key ──▢ β”‚ POST /api/trigger β”‚ β”‚ (API-sourced)β”‚ β”‚ express (node.js) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ in-process β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ openai agents sdk β”‚ β”‚ scout: web search β”‚ β”‚ gpt-image-1 render β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ png + manifest β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ browser β”‚ ◀─── serves live ── β”‚ volume /data/… β”‚ β”‚ (sparkles) β”‚ β”‚ s3-backed, mounted β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ /api/visit /api/seen/:id /api/fame β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ postgres β”‚ visits + blessing_views β”‚ (managed) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

step 1: one npm project, no dockerfile

Wasmer Edge auto-detects Node projects. A plain package.json with a start script that binds process.env.PORT is the entire contract:

{
  "type": "module",
  "scripts": { "start": "node server/index.js" },
  "dependencies": { "express": "^5", "pg": "^8", "@openai/agents": "^0.1" }
}

Connect the GitHub repo to the app once, and from then on git push is the deploy β€” Wasmer builds remotely on every push. (A manual wasmer deploy --build-remote works too, for the impatient.)

step 2: app.yaml β€” database & volume

Two platform capabilities carry the design (the cron job is deliberately not in here β€” see step 5):

kind: wasmer.io/App.v0
name: ur-blessing-machine
package: .

capabilities:
  database:
    engine: postgres    # managed pg, creds injected as DB_* env vars

volumes:
  - name: blessings
    mount: /data/blessings   # s3-backed, survives deploys, shared rw

The volume is the trick: the agent writes images + a JSON manifest there, the server serves it statically, and the frontend merges it with the seed manifest β€” so new content appears without redeploying.

step 3: postgres (mind the TLS!)

The managed database injects DB_HOST, DB_PORT, DB_NAME, DB_USERNAME, DB_PASSWORD. One gotcha that will eat ur afternoon: the server requires TLS, and node-postgres doesn't enable it by default:

new pg.Pool({ ..., ssl: { rejectUnauthorized: false } })

Migrate from ur laptop by revealing the creds (wasmer app secret reveal DB_HOST …) and running psql with PGSSLMODE=require. This site's counter is two tiny tables: visits(day, total) and blessing_views(id, views), upserted with ON CONFLICT … DO UPDATE.

step 4: the agent

An OpenAI Agents SDK scout with a web-search tool hunts for an existing meme; if the internet disappoints, it invents a caption ("sincere, slightly unhinged, lowercase") and gpt-image-1 renders it with the text baked in, glitter and all. Structured output via a zod schema keeps the result machine-usable:

const scout = new Agent({
  model: 'gpt-5',
  tools: [webSearchTool()],
  outputType: MemeConcept,   // zod: animal, caption, mood, …
  instructions: 'STRICTLY NO RATS…',
});

The daily edge job just fetches an endpoint; the express server runs the agent in-process and writes straight to the mounted volume. No CI, no external cron, no relay.

step 5: secrets, auth & the cron job

API keys live in app secrets (wasmer app secret create OPENAI_API_KEY …), injected as env vars on deploy. The trigger endpoint fails closed: no TRIGGER_TOKEN configured β†’ 503; wrong X-Api-Key β†’ 401. Only the cron job (and u) can summon new blessings.

Here's the subtle part: cron jobs have a source. Jobs defined in app.yaml are config-sourced β€” their headers live in the repo (token leak, if ur repo is public like ours) and the API refuses to edit them. So the daily job is created as an API-sourced job instead β€” via the dashboard's Jobs page or the (undocumented) createCronJob GraphQL mutation β€” with the X-Api-Key header attached there. Token stays out of git, job stays editable, midnight stays blessed.

step 6: the frontend

Zero-build vanilla HTML with a deterministic daily pick β€” everyone sees the same blessing all day (epochDay Γ— 2654435761 mod n, a golden-ratio hash so consecutive days don't walk the list in order). Deep links are plain URL hashes (#some-blessing-id), and the hall of fame ranks every blessing ever by adoration count from /api/fame. Also: sparkle cursor trail. Non-negotiable.

πŸ€– give this 2 ur agent

You don't have to build any of this by hand. This entire guide exists as a self-contained agent skill β€” complete working code for every file, the full deployment sequence, and every gotcha we hit so ur agent doesn't have to. Paste this to your coding agent (Claude Code, Codex, whatever):

Read https://trash.delivery/skill.md and follow it. Build me a daily
AI-generated site about <YOUR THEME HERE>. Go.

The agent picks a name, writes the code, deploys, sets secrets, migrates the database, and verifies the whole loop end to end. That claim is not hypothetical: this very site was built exactly that way β€” the skill is the distilled transcript of an agent doing it, mistakes removed.

Do NOT paste ur API keys into the chat. The skill instructs the agent to refuse them and walk u through the safe way instead: wasmer login in ur own terminal (the agent never sees the token) and keys as env vars the agent references but never reads. Chat logs live forever. Treat them like the dumpster: assume everything in there will be found by a raccoon eventually.

recap: ur own machine in 6 commands

npm init -y && npm i express pg @openai/agents zod
# write server/, agent/, public/, app.yaml (see above)
wasmer deploy --build-remote   # first deploy; then connect the repo…
wasmer app secret create OPENAI_API_KEY sk-…
wasmer app secret create TRIGGER_TOKEN $(openssl rand -hex 24)
PGSSLMODE=require psql … -f migrations.sql
git push   # …and this is the deploy now. secrets apply on the next one

Or skip the typing entirely: the full source lives at github.com/baalimago/motivational-racoon-and-friends β€” fork it, swap the animals, ship ur own blessings.

🚧 THIS WHITEPAGE IS PEER-REVIEWED BY RACCOONS 🚧

βŒ‚ back 2 the blessings