End-to-end recipe
One coherent path from empty project → runtime demos. Matches the homepage SaaS starter story and golden prompts G1–G6.
0. Prep
- Create a project (Getting started).
- Optional: connect BYOK (Bring your own key).
1. Apply saas-leads
Apply the saas-leads data template.You should see queries, webhook, workflows, schedule, CDC, and secret refs under .appbricx/backend/. Details: Data templates.
2. Set secrets
- Open project secrets / env UI.
- Set
WEBHOOK_SECRET(required for hook demos). - Optional:
LEAD_NOTIFY_URL(public HTTPS),DIGEST_EMAIL.
Guide: Secrets & env.
3. Build the UI
Build a public signup form and an admin dashboard that lists leads
via runtime.queries.run("list_leads"). Subscribe to topic leads.created
so the table updates live. No raw SQL in components.4. Exercise auto CRUD
curl -X POST "$ORIGIN/__appbricx/api/v1/leads" \
-H "Authorization: Bearer $DATA_TOKEN" \
-H "x-appbricx-data-api: 1" \
-H "content-type: application/json" \
-d '{"email":"api@example.com","source":"postman"}'Full reference: Auto CRUD REST API.
5. Fire the webhook
curl -X POST "$ORIGIN/hooks/$PROJECT_ID/lead-intake" \
-H "content-type: application/json" \
-H "x-appbricx-webhook-secret: $WEBHOOK_SECRET" \
-d '{"email":"hook@example.com","source":"webhook"}'Workflow creates the lead (or uses payload), publishes leads.created, admin UI updates. See Webhooks & schedules.
6. Invoke a workflow manually
await runtime.workflows.invoke("nightly-digest", { payload: {} });
// or POST /__appbricx/runtime/workflows/nightly-digest/runDocs: Workflows.
7. Live topics
runtime.topics.subscribe("leads.created", (ev) => refreshTable());Docs: Topics & CDC.
8. Publish
Deploy from the editor when you want a stable URL. Publish & domains.
Internal map (what just happened)
Browser / Postman
→ Caddy (/__appbricx/* or /hooks/*)
→ API auth (data token / webhook secret)
→ Named query engine | CRUD | workflow runner | topic bus
→ Project PGlite worker (RLS)
→ CDC emit → bindings → topic SSE / more workflowsGolden prompts. The same flow is documented as G1–G6 in the repo
docs/FULLSTACK_RUNTIME.md and docs/MARKETING_DEMO.md.