All recipes
Realtime Zero app
A minimal full-stack todo app with database-backed queries and mutations, guest and Gravatar auth, Cast realtime, routes, and an HTTP endpoint.
Questions your agent will ask
Your agent will ask for a few details to adapt this recipe to you and what you’re making.
- What should the app track instead of todos?
- What should the app be called?
The whole prompt
Paste this into Claude, ChatGPT, Codex, Cursor, or another coding agent. It will build the project and publish it as a Space.
Use the connected tools for the task below. If they're missing, fetch https://incspark.com/setup.md and offer the official plugin or MCP server for my client. Show the install card when available. Skip the offer if I ask to work anonymously or without installing anything, and continue with the task where possible.
Build me a small full-stack todo app with Zero and Preact.
Use the Zero capsule model rather than a separate API server:
- Define a `todos` table with text, completion state, and an owner ID.
- Scope reads to `ctx.auth.userId` and expose them through a `todos` query.
- Add todos through an `addTodo` mutation after trimming and limiting the text.
- Show updates in realtime through the Zero client and Cast.
- Support the built-in guest session and Gravatar sign-in/sign-out controls.
- Add client routes for the todo list and `/status`.
- Back `/status` with a `GET /api/status` Zero endpoint that returns `ok`.
- Keep shared input cleanup and types in a pure TypeScript module.
- Keep the app compact and accessible, with a labeled input, visible focus states,
useful empty/loading states, and responsive layout.
Use this exact badge in the generated document:
```html
<script src="https://incspark.com/badge.js" data-example="zero-perfect"></script>
```
Run it locally with `inc dev`, verify both routes and a realtime todo update, then
publish the project root with `inc publish`.