Last Updated: 2026-01-31
Deploy the Worker with Wrangler after creating D1, R2, and KV in Cloudflare (Dashboard or your own automation). Locally, run and test with Docker (docker compose up, then cd apps/api && npm test); the same config (wrangler.toml + .dev.vars) is used in Docker and in production via wrangler deploy.
Terraform: Not part of the default workflow. The directory infra/terraform/ exists for future use; ignore it until explicitly introduced as a feature.
- Worker app in
apps/api/withwrangler.tomland bindings for D1, R2, KV - Wrangler CLI and Cloudflare API token (or CI with secrets)
- D1 database, R2 bucket, and KV namespace created in Cloudflare (e.g. via Dashboard)
- Create D1, R2, and KV in the Cloudflare Dashboard (or your preferred method) if not already created.
- Update
apps/api/wrangler.tomlwith the correctdatabase_id(D1), bucket name (R2), andid(KV) for your environment. - Set secrets:
wrangler secret put DISCORD_CLIENT_ID,DISCORD_CLIENT_SECRET,SESSION_SECRET(do not commit). - Apply D1 schema:
cd apps/api && npx wrangler d1 migrations apply winpodiums-dev-db --remote - Deploy:
npx wrangler deploy - Attach routes: If using a custom domain, attach the Worker to your zone/routes in the Dashboard (or your automation).
TBD – R2 bucket and optionally GitHub Releases when plugin build exists.
- Development — Local dev (Docker and wrangler dev, 1:1)
- Next Steps — Recommended order of work (test locally, then deploy)
- Phase 1 scope — MVP deliverables
- API README — Endpoint surface; Worker code in
apps/api/ - HLD — System overview