Skip to content
cloudtifact

Pages that remember what people put in them.

Every space has its own SQLite database, so a published page can be a small app people use together: a tracker, a sign-up sheet, a poll, a labelling desk. There's nothing to set up.

From document to app

People used to read a published page and comment on it. With a database behind it, they use it: tick a task, sign up, vote, label. What one person adds, everyone who opens the page sees.

Your agent builds the page the way it does now, plus a SQL file that says what the page keeps. Publishing creates the tables.

In the page

Every HTML page gets window.cloudtifact.db. Use ? placeholders for values. Add { objects: true } to get rows as objects.

const db = window.cloudtifact.db;

// Everyone who can view the page can read.
const { rows } = await db.query(
  "SELECT choice, COUNT(*) AS votes FROM votes GROUP BY choice", [], { objects: true });

// Members of the space can write, when they open the page in Cloudtifact.
await db.exec("INSERT INTO votes (choice) VALUES (?)", ["tacos"]);
index.html

Tables ship with the page

Put SQL files in a db/ folder next to the page. cloudtifact publish and cloudtifact push run each file once, in name order, and remember which ran. To change the tables later, add a new file.

poll/
  index.html
  db/001_schema.sql   CREATE TABLE IF NOT EXISTS votes (choice TEXT NOT NULL, at TEXT DEFAULT CURRENT_TIMESTAMP);

$ cloudtifact publish poll
db: applied 001_schema.sql
Published "Poll" v1

Try the idea

A tracker page, with a database behind it

donetaskownerRemove
Write the launch postgczh
QA the checkout flowclaude-code
Ship on Fridaygczh
Tick, add or remove rows, then pull them. Here the rows stay in your browser; in Cloudtifact they will live in the page's own database. The command is illustrative while the feature is being built.

Data your agent can read

What a page collects comes back to your agent in one command, as a compact table it can summarise, act on, or build the next version from.

$ cloudtifact db query "SELECT choice, COUNT(*) AS votes FROM votes GROUP BY choice" --toon
rows[2]{choice,votes}:
  ramen,4
  tacos,7
CommandDoes
cloudtifact db queryRun SQL. Read-only unless you add --write
cloudtifact db schemaTables, columns, row counts, size
cloudtifact db exportThe whole database as a .sql file
cloudtifact db migrateRun the db/ files without publishing
cloudtifact db reset / restoreWipe it, or roll back to any time in the last 30 days (admins)

Who can do what

ReadWriteReset, restore
Workspace owners and adminsYesYesYes
Workspace membersYesYesNo
Anyone who can view the pageYesNoNo
Pages write only when a member opens them inside Cloudtifact. A page opened by its direct link can read, not write. Each space's database is separate from every other space's, and every write is logged with who made it.