Deploying
Run the whole service on your own Cloudflare account.
wrangler d1 create botbar # put the id in apps/api and apps/dashboard wrangler.jsonc
wrangler r2 bucket create botbar-puzzles
pnpm --filter @botbar/api exec wrangler d1 migrations apply botbar --remote
# secrets for the API
wrangler secret put SEAL_KEYS # {"k1":"<32 random bytes, base64url>"}
wrangler secret put IP_SALT
wrangler secret put ADMIN_TOKEN
wrangler secret put PREVIEW_SECRET
pnpm --filter @botbar/api deploy
pnpm --filter @botbar/dashboard deploy
API_ORIGIN=https://api.example.com ADMIN_TOKEN=... pnpm --filter @botbar/puzzle-gen generate --target 2000Set SEAL_ACTIVE_KID to the key id in use. To rotate, add a new key to SEAL_KEYS, switch SEAL_ACTIVE_KID, and drop the old key five minutes later.
The dashboard needs BETTER_AUTH_SECRET, PREVIEW_SECRET (the API's), and optionally GitHub, Google, Resend, and CF_ACCOUNT_ID with CF_ANALYTICS_TOKEN (an API token with Account Analytics read) for analytics.
The puzzles GitHub workflow keeps the puzzle pools topped up every hour.