Cratis Arc task recipes
Cratis Arc task recipes help you add or check one part of an application feature: submit a command, reject invalid input, or read the data a screen needs. Each recipe explains the setup it assumes, shows a minimal implementation, and gives you an outcome to check.
Start with an Arc application configured for C#, Kotlin or Java, or the TypeScript backend (published on npm). If you have not built a feature yet, the tutorial walks through the setup and implementation together. The TypeScript capability reference describes that backend’s supported behavior.
For Arc for Go, start with its running application guide and parity reference. The recipes’ backend tabs do not yet include Go examples; use the Go guides for registration, handlers, queries, and generated clients rather than translating framework-specific APIs.
The default recipes use standalone Arc with configured storage providers or application services. They do not require Cratis Chronicle; sections that use its event store identify the additional integration.
| Recipe | When you reach for it |
|---|---|
| Validate a command | Reject malformed or duplicate input before it writes state |
| Return a result or an error | A command needs to hand back more than “it worked” — a value, or a typed failure |
| Provide data to a command handler | A decision needs data you must fetch — keep the fetch out of Handle so it stays testable |
| Use current state in a command | A decision depends on provider-owned state — resolve it by an explicit command key |
| Query data across slices | A screen needs data that spans more than one feature |
| Execute a command from React | Wire a form or button to a command through the generated proxy |
| Test a command | Check the pipeline result and handler work in-process, with application services substituted |
| Authorize a command or query: C#, Kotlin or Java, TypeScript, Go | Restrict who may run a command or read a query; check your backend’s authorization model |
If your C# feature records events in Chronicle, continue with its integration recipes: React to an event and Add event sourcing to an Arc slice.
For a task not listed here, use the backend options or Frontend guides. If an implementation does not behave as expected, start with Troubleshooting.