Cookbook
Short, goal-oriented recipes for common Tyravel tasks. Each recipe assumes 1.0.x and links to guide chapters for depth.
Recipes
| Recipe | When to use it |
|---|---|
| Realtime UI with Echo | Push server events to the browser over WebSockets |
| RAG Q&A endpoint | Ingest documents and answer questions with retrieval |
| Testing with fakes | Assert mail, notifications, and broadcasts in Vitest |
| Admin panel | Optional CRUD UI with audit log |
| Multi-locale apps | JSON locales, lang:publish, missing-key checks |
| Production observability | Health probes, structured logs, queue failure signals |
| Multi-tenant apps | Subdomain tenancy with global scopes and channel isolation |
Conventions
- Recipes use
tyravel newdefaults (SQLite + database queue) unless noted. - Optional driver packages (
@tyravel/redis-node,@tyravel/database-pg, …) are called out explicitly. - Stable vs experimental APIs follow API stability.
Contributing a recipe
Open a PR adding a page under docs/cookbook/ and register it in scripts/generate-docs.mjs tutorial/cookbook sidebar lists (or the generated sidebar.mts cookbook section).