zitejs for access and data. Pages render on
the server first, then run in the browser. Each app lives in its own directory, apps/<dir>/, in the
workspace monorepo, next to the workspace’s other apps, and they all share one
database.
What an app is made of
- Pages and routes:
src/routes/, one file per route. A page reads its data through TanStack Query, whose queries call server functions, and itsloadersends the first page with that data. See Pages and loaders. - Server functions: the server code pages call, exported from
*.functions.tsfiles and built withsignedInFnorpublicFnfromzitejs/start, which decide who may call them. Server-only helpers go in*.server.tsfiles. See Server functions. - API routes: routes under
src/routes/api/withserver.handlers, for when a URL is itself the product: a JSON feed, a file download, a URL another service calls. See API routes. - Automations: background work beside the apps, under
automations/, written withcreateAutomation. An app holds none of its own; it can schedule one withZiteSchedules. - Data: the typed
ziteclient fromzitejs/db, used only in server code. See Database. - Generated files: the
.zite/directories andsrc/routeTree.gen.ts, which the platform writes and you never edit. - Config: the app’s
zite.config.json: access mode, sign-in, integration settings. See App config.
Automations
An automation lives inautomations/<dir>/, and its src/index.ts default-exports
createAutomation({ description, on, run }). The directory is its id. on is the one way it fires:
One with no
on runs only on the schedules an app adds at runtime through ZiteSchedules. A second way to
fire is a second automation.
Automations are durable: a step that throws is tried again on its own, a run can sleep, and a long run carries
on in later calls (a poll runs as one request). See Durable runs.
An automation has no user: there is no context.user, no page can call it, and it can’t call a server
function. Logic it shares with an app goes in a package under packages/.
Schedules need the Business plan.
Access modes
Every app is internal (org members who have been given access to the app, signed in automatically) or external (a public URL, with sign-in where the app asks for it). The app’saccessMode in its
zite.config.json decides. See Access and sign-in.
Built and served by agents
Agents build apps through the Zite MCP in a cloud sandbox.create_app scaffolds
apps/<dir>/ with a placeholder home page at src/routes/index.tsx, which the agent replaces with the app’s
real pages. The platform builds the app itself, and its server code runs on Cloudflare Workers. Publishing
makes the app live at https://<subdomain>.zite.so or a custom domain. See
Build tools and Publishing.