The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | # cloudflare-domain |
| 2 | |
| 3 | A bank built with `@alchemy.run/domain`: customers, accounts and transfers modelled as aggregates, commands, events, views, policies, a saga, projections and streams; hosted on Cloudflare Durable Objects; driven from a foldkit app; traced end to end into Axiom. |
| 4 | |
| 5 | The docs at [alchemy.run/domain](https://alchemy.run/domain) are written around this project, and quote its files. |
| 6 | |
| 7 | ## Layout |
| 8 | |
| 9 | ```text |
| 10 | packages/ |
| 11 | domain/ @bank/domain the model: one <Noun>.<kind>.ts per building block, by subdomain, plus its stories |
| 12 | server/ @bank/server the Worker that hosts it, middleware, Stripe/Sift/D1 adapters, Axiom telemetry |
| 13 | web/ @bank/web the foldkit app and its Worker |
| 14 | alchemy.run.ts the stack: the bank Worker and the app |
| 15 | test/integ.test.ts deploys the stack and drives it |
| 16 | ``` |
| 17 | |
| 18 | See [Project layout](https://alchemy.run/domain/project-layout) for the conventions. |
| 19 | |
| 20 | ## Run the tests |
| 21 | |
| 22 | ```sh |
| 23 | pnpm --filter @bank/domain test # stories: the whole model, in memory |
| 24 | pnpm --filter @bank/server test # the Apis, in memory |
| 25 | pnpm --filter @bank/web test # the foldkit app |
| 26 | ``` |
| 27 | |
| 28 | ## Deploy |
| 29 | |
| 30 | The stack needs Cloudflare, Stripe (test mode) and Axiom credentials: an alchemy profile with Cloudflare and Stripe, and `AXIOM_TOKEN` in the environment. |
| 31 | |
| 32 | ```sh |
| 33 | pnpm deploy # or: pnpm dev, to run it locally |
| 34 | pnpm test:integ # deploy, drive it, destroy it |
| 35 | ``` |
| 36 | |
| 37 | Traces land in `bank-<stage>-traces` in Axiom: one trace per click, from the app's command through every policy and Durable Object it reaches. See [Observability](https://alchemy.run/domain/observability). |