Skip to content

docs: two new tutorials — first outbox app + Kafka relay#58

Merged
lesnik512 merged 9 commits into
mainfrom
docs/tutorials
Jun 12, 2026
Merged

docs: two new tutorials — first outbox app + Kafka relay#58
lesnik512 merged 9 commits into
mainfrom
docs/tutorials

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

  • Adds docs/tutorials/first-outbox-app.md — a ~10-minute walkthrough that takes a reader from uv init to a live outbox handler printing got order 1, with all terminal output captured from a clean execution.
  • Adds docs/tutorials/add-kafka-relay.md — extends Tutorial 1 to forward each outbox row to a Kafka topic via a stacked @kafka_publisher decorator, with literal output from a Confluent cp-kafka:7.6.0 single-broker KRaft setup.
  • Wires both tutorials into the Getting started: nav section (after Installation and Basic usage) and adds a relay-page pointer + landing-page decision-tree cross-link.
  • Source spec: planning/active/2026-06-12-docs-tutorials-design.md.
  • Both tutorials were executed end-to-end against clean environments (/tmp/outbox-tutorial-1 and /tmp/outbox-tutorial-2) and the literal terminal output is captured in-page — no hand-edited output.

Task 3 Step 6 note (kill-Kafka demo)

The spec proposed a live "kill Kafka, watch the outbox retry" step. During authoring against cp-kafka:7.6.0, aiokafka's client-side reconnect absorbed the short outage (~10s and ~20s windows) before the outbox subscriber could surface a retry log line. The spec authorized this fallback; the tutorial replaces the live step with an "At-least-once delivery" callout that explains the contract and links to the retry-strategies reference. The callout includes a maintainer note (HTML comment) documenting the attempted approach for a future contributor who wants to reintroduce a live demo.

Reviewer ask

Re-walk both tutorials on a clean machine — install from scratch, spin the containers, run the app — and confirm every "you should see" block matches. That is the single highest-leverage check.

Test plan

  • `just docs-build` passes clean (no new warnings beyond the pre-existing `checklist.md` INFO).
  • `just lint` passes clean.
  • Follow Tutorial 1 on a clean machine; confirm `got order 1` fires and all captured output blocks match.
  • Follow Tutorial 2 on the Tutorial 1 end-state; confirm row reaches `kafka-console-consumer` and captured blocks match.
  • Sidebar shows the four Getting-started entries in order.
  • `relay.md` top-of-page pointer to Tutorial 2 renders.
  • `index.md` decision-tree row points at Tutorial 1.

🤖 Generated with Claude Code

lesnik512 and others added 9 commits June 12, 2026 07:54
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds docs/tutorials/first-outbox-app.md, the 10-minute walk-through
deferred from #56. Output blocks in the page were captured from an
end-to-end run against a clean Postgres 17 container; no hand-edited
expected output.

Also adds the nav entry under "Getting started" (originally scheduled
for Task 4) — without it, mkdocs --strict aborts on the orphan-page
warning, and the spec is firm that --strict is load-bearing.

The forward link to add-kafka-relay.md lands as plain text for now
(target file does not exist yet); Task 3 will retarget it once that
tutorial lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Caught during Task 2 execution. `faststream run app:app` ImportErrors
without the CLI extra, so the tutorial's install line includes it; the
spec outline now matches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per the plan's Task 3 Step 7, the kill-Kafka fallback needs a disclosure
that the live demo was attempted and dropped, either at the page top or
folded into the callout. An HTML comment in the callout meets that bar
without injecting "scar tissue" prose into the reader-facing narrative —
future maintainers see the rationale, readers don't.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Caught by code-quality review:
- create_schema.py redeclares MetaData/outbox_table; flag the
  footgun for readers who copy both files and later edit app.py.
- The Step 1 uv add output shows whatever Python uv resolves;
  disclaim 3.13 vs 3.14 explicitly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lesnik512 lesnik512 merged commit eb6c6a5 into main Jun 12, 2026
3 checks passed
@lesnik512 lesnik512 deleted the docs/tutorials branch June 12, 2026 06:50
lesnik512 added a commit that referenced this pull request Jun 12, 2026
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