Data templates
Starter packs that migrate schema and copy backend artifacts (queries, ACL, workflows, webhooks, schedules, CDC, secret refs) into your project — additive, non-destructive.
Available packs
| Slug | Ships with | Use when |
|---|---|---|
waitlist | waitlist table, create_waitlist_entry / list_waitlist / count_waitlist_24h, REST ACL | Signup + admin list (G1/G2) |
saas-leads | Leads schema, named queries, lead-intake webhook, on-lead-created + nightly-digest workflows, cron, CDC topic, secrets.refs.json | Full runtime demo (G1–G5) |
todo-multi-tenant | Tasks + RLS, list_tasks / create_task | Per-user data stories |
How to apply
In chat
Apply the saas-leads data template, then build a signup form and
admin table using runtime.queries.run — no raw SQL in components.Agent tool: runtime.apply_data_template with { slug: "saas-leads" }.
In the UI
Project settings → Database / Backend → Data templates → Apply. Or POST /projects/:id/backend/data-templates/:slug/apply with your platform session.
What apply does
- Runs pack
migrations/*.sqlthrough the project data worker (idempotent migration ids). - Optionally runs
seed.sql. - Copies missing files from pack dirs:
queries/,api/,workflows/,webhooks/,schedules/,cdc/, plussecrets.refs.jsonif absent. - Syncs schedules + webhooks into platform DB so cron/hooks work immediately.
- Appends the slug to
.appbricx/backend/data-templates.lock.json.
Existing project files are not overwritten — safe to re-apply for missing artifacts only.
After apply — checklist
- Set secret values for any refs (Secrets).
- Ask the agent to build UI on
runtime.queries.run. - Test webhook: Webhooks & schedules.
- Connect email integration before relying on nightly digest mail.
Managing packs
- See applied slugs in the lock file or Backend → Data templates list.
- Do not edit files under
packages/appbricx-runtime/templates/data/for a single project — add project migrations instead. - To customize: edit the copied
.appbricx/backend/**files in the project.
Next: End-to-end recipe