Skip to content
Back to skills

How To

ASecurity

A full-stack reactive todo app over a single browser-to-engine WebSocket. Function calls and live change notifications flow over the same connection. The app follows the stored records pattern from [Recipe 2: stored records with live updates](../upgrading/migrate-from-streams#recipe-2-stored-records-with-live-updates): the todo worker owns the data, serves queries, and announces each change by calling `todos::on-changed`, a function that each browser observes.

  • 18,978 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
developmentreactfrontendbackend

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned November 16, 2026

npx -y skills add iii-hq/iii --skill how-to --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of How To?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for How To
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/iii-hq-how-to-6bc9f682/badge)](https://www.skillsdirectory.com/skills/iii-hq-how-to-6bc9f682)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
<!-- generated by iii-skill-render. DO NOT EDIT (changes here are overwritten on the next render). Edit docs/next/how-to/build-a-realtime-todo-app.mdx. -->

# Build a real-time todo app


A full-stack reactive todo app over a single browser-to-engine WebSocket. Function calls and live
change notifications flow over the same connection. The app follows the stored records pattern from
[Recipe 2: stored records with live updates](../upgrading/migrate-from-streams#recipe-2-stored-records-with-live-updates):
the todo worker owns the data, serves queries, and announces each change by calling
`todos::on-changed`, a function that each browser observes.

## Engine configuration

The workers needed to support a browser-driven reactive app: `state` for storage and an RBAC
listener (`rbac-proxy` or `iii-worker-manager`) for browser connections. No streaming worker is
required.

## Backend

The worker, auth, storage, change notifications, and CRUD functions that power the app server-side.

### Worker setup

Connect a worker and register the functions the app needs.

### Auth function (RBAC)

An auth function runs on each new browser WebSocket connection, issues a session ID, and namespaces
the session's registered functions to prevent collisions. The listener exposes `todos::on-changed`
to the session so the browser can observe it.

### Storage

Todos live in the `state` worker under one scope, one key per todo, each with a revision number that
every write increments.

### Change notifications

The todo worker registers `todos::on-changed` as a private function whose handler returns the change
`{ id, revision, op }`, and calls it after every committed write. When it runs, the target of each
browser's observer runs. Its `onObserverAdded` hook caps the number of browsers that observe it,
rejecting the observer past the cap.

### Functions

The CRUD functions the browser calls (create, toggle, delete) write to storage and then call
`todos::on-changed`. `todos::get` and a paginated `todos::list` serve reads.

## Frontend

The browser-side WebSocket connection and reactive hook that render live updates.

### Connection

Connect the browser to the engine over a single WebSocket using `iii-browser-sdk`.

### Real-time hook

A hook that observes `todos::on-changed` with a browser function as the target, then loads the list
with `todos::list`. Each notification re-reads one todo unless the hook already has that revision,
and the hook reloads the list after a reconnect.

## Key concepts

The reactive primitives this app relies on: single-WebSocket transport, per-session RBAC
namespacing, an observable function for change notifications, and a query for the initial state and
recovery.

Files in this skill

  • build-a-realtime-todo-app.mdx1.5 KB
  • build-a-realtime-todo-app.mdx.skill.md1.5 KB
  • schedule-cron-task.mdx445 B
  • schedule-cron-task.mdx.skill.md468 B
  • use-trigger-conditions.mdx602 B
  • use-trigger-conditions.mdx.skill.md585 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.