Appearance
Build a shop
In ten parts you build a small shop on kernable: customers register and place orders, a service confirms every order by email, customers may only touch their own data, and a customer can have their personal data erased. Part 8 runs it as it would in production; part 9 adds accounts, sign-in and an HTTP API with kernable's kit, and part 10 a business process that ships paid orders and cancels unpaid ones.
Every part shows the code in TypeScript, Python and Rust; pick one with the tabs, or mix them: part 5 is about exactly that.
| Part | You add | You learn |
|---|---|---|
| 1. Run a kernel | the kernel, the SDK | what the kernel does and what your processes do |
| 2. Aggregates and commands | customer, order, the worker | commands, events, rejections, idempotency |
| 3. Read models and queries | customers, orders | queries through the kernel, reading your own writes |
| 4. A reactor | confirmations | listener order, follow-up commands |
| 5. A second language | nothing new | mixing languages in one application |
| 6. Authorization | guard | grants and middleware, the request context |
| 7. Personal data | vault declarations, erasure | the vault, secrets, erasing a person |
| 8. Operate | a production setup | a key per service, an offline root key, rotation and revocation, mutual TLS, metrics, persistent read models, deploys |
| 9. Accounts and sign-in | api, the kit, a rule of the shop | accounts and sessions, tenants, groups, invitation links, a query's target, Explain, rules on data next to the kit |
| 10. A business process | fulfilment | processes run by the kernel: cases, waits with a timeout, incidents, the UI's diagram and statistics |
From part 2 on, the snippets show what a part adds to a file, without its imports. The complete files, as they are at the end, are in the repository under docs/examples/shop/ts, docs/examples/shop/py and docs/examples/shop/rs; kernable's tests run them for every part, in every language.
You need Node.js ≥ 22.18 for TypeScript, Python ≥ 3.10 for Python or Rust (stable) for Rust, and about an hour.
