Skip to content

feat: draft a tutorial, an event-sourced backend on Cloudflare Durable Objects - #29

Draft
benatespina wants to merge 2 commits into
mainfrom
claude/post-cloudflare-tutorial-175834
Draft

benatespina wants to merge 2 commits into
mainfrom
claude/post-cloudflare-tutorial-175834

Conversation

@benatespina

@benatespina benatespina commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Summary

  • A kind: tutorial post, draft: true and with no publication date decided (the front matter carries 2026-11-07 as a placeholder; set the real one when it goes out).
  • From npm create bounda@latest my-app -- --runtime cloudflare (or the Deploy to Cloudflare button of bounda-cloudflare-template) to npm run deploy: a walk through the generated files, a real domain step (payOrder, expireOrder and a policy that schedules the expiry 30 minutes after OrderPlaced, plus a status column in the read model), tests in workerd, deployment and the missing authentication of createWorker.
  • A short "How it runs" (one Durable Object per tenant, the command updates the read models before answering, policies and timers in the object's alarm), "What it costs" and "When it is the wrong design".
  • Try it points to the demo's expire scene (?scene=expire).
  • Translations in es, ja and pt-br; code blocks are copied verbatim from the English post.

Reuses the numbers, the cost test and the sources of the discarded draft in #27.

How it was verified (2026-11-07)

  • Scaffolded with create-bounda 0.3.0 in a temp directory (wrangler 4.158.0, @cloudflare/vitest-plugin 1.6.0, Vitest 5.1.0). Every ts block that names a file was compared byte for byte with the file that compiled and passed in that project (src/worker.ts is shown without its doc comments).
  • npm test: 7 tests on the template, 10 after step 5, all in workerd. The orders.test.ts failure the post warns about was hit for real.
  • npm run typecheck and npm run check (which runs wrangler deploy --dry-run) pass. Nothing was deployed to a real account.
  • npm run dev + the curl calls: the JSON answers in the post are the real ones.
  • The 25-line cost test asserts 8 rows written on the untouched template, and still passes after step 4. For the tutorial app the post says "roughly twice the template's rows, and a second request, per order placed": the same harness as feat: draft the second post, event sourcing whole inside a Durable Object #27 gave about 17, but it cannot pin down how many times the alarm is armed, so the post does not quote the number.
  • Orders placed before step 4 come back without status: Bounda adds the column at start-up and leaves old rows empty. Reproduced with wrangler dev --persist-to across the change; connect(stub).rebuildReadModel("orders") answered {"events":3,"position":3,"done":true} and the rows came back with their status. The post now says so after step 4.
  • Cloudflare prices re-checked on 2026-11-07: Durable Objects pricing (last updated 2026-10-18), Workers pricing (2026-10-02) and limits (2026-11-07: 10 GB per object on Paid, soft limit 1,000 req/s). Unchanged from feat: draft the second post, event sourcing whole inside a Durable Object #27.
  • pnpm build and pnpm check pass; all four versions reviewed in pnpm dev, desktop and mobile width.

…e Objects

From npm create bounda to npm run deploy in one sitting: the files the
template writes, a pay-or-expire step with a second command and a delayed
policy, tests in workerd, how it runs, what a command costs (8 rows for the
template's placeOrder, measured on Bounda 0.3.0) and when one object per
tenant is the wrong design. Kept as draft: true until a date is chosen.
Translated into es, ja and pt-br; code untranslated.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
bounda-website 20abd66 Nov 08 2026, 10:04 AM

…nd soften the policy's cost

Rows placed before the view gained status come back without one until the read
model is rebuilt; rebuildReadModel("orders") through connect was run against a
store with old rows and fills them. The tutorial app's cost is now stated as
roughly twice the template's rows and a second request, since the harness that
gave about 17 cannot pin down how many times the alarm is armed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant