# Xeer documentation
The complete documentation from https://docs.xeer.run, as one file.
---
The full-stack framework
Describe your app. Ship it in minutes.
Xeer gives you a typed server, a reactive client, a database, authentication, and a test runner that already know about each other — then puts the whole thing on a real URL with one command.
## Four commands, start to production
```sh
npx @impetik/xeer new my-app
cd my-app && npm install
npx xeer dev # local server, instant feedback
npx xeer test # the suite that ships with your app
npx xeer deploy # a real URL on a global edge network
```
No bundler to configure, no database to provision, no CI to write, no dashboard to visit. `xeer new`
scaffolds a working app with a database, a client, and a passing test suite — or pick a different starting
point with `--template todo`, `blog`, or `personal-site`. Everything after that is your code.
## A taste of the model
An app is three things: a **manifest** that declares what it has, a **server** of typed functions, and
a **client** that reads them and re-renders when they change.
### The manifest
`xeer.app.json` is the whole shape of your app in one file — tables, indexes, entrypoints, the
capabilities it is allowed to use. The compiler reads it and generates types for everything below.
```json
{
"format": "xeer.application-source.v0",
"name": "notes",
"entrypoints": {
"client": "src/client.tsx",
"server": "src/server.ts"
},
"database": {
"tables": {
"notes": {
"fields": {
"text": { "type": "string", "maxLength": 500 },
"ownerId": { "type": "string", "maxLength": 128 }
},
"indexes": { "by_owner": ["ownerId"] }
}
}
},
"capabilities": ["database"]
}
```
### The server
Queries read, mutations write, endpoints handle raw HTTP. `ctx.db` is typed from the manifest, and
`ctx.auth` is the verified identity of the caller — never something the browser asserted.
```ts
import { defineServer, mutation, query } from '@impetik/xeer/server';
export default defineServer({
queries: {
'notes.list': query({
input: {},
handler: (ctx) => ctx.db.table('notes')
.find({ where: { ownerId: ctx.auth.appUserId } }),
}),
},
mutations: {
'notes.create': mutation({
input: { text: 'string' },
handler: (ctx, input) => ctx.db.table('notes').insert({
text: input.text,
ownerId: ctx.auth.appUserId,
}),
}),
},
});
```
### The client
`useQuery` knows the operation's input and output types from the server you just wrote. It also knows
which tables the query read — so when anyone, in any browser, mutates one of them, this component
re-renders. You did not wire that up.
```tsx
import { useMutation, useQuery, useState } from '@impetik/xeer/client';
export default function App() {
const notes = useQuery('notes.list', {});
const createNote = useMutation('notes.create');
const [text, setText] = useState('');
return (
A database and a file store, declared
Name a capability in the manifest and its typed surface appears on ctx — a transactional
database, an object store, or both. No connection string, no bucket name, no credential.
Anything you did not declare does not exist in your app: reaching for it is a compile error.
Capabilities →
Live by default
Every query records the tables it read; every mutation reports the tables it wrote. Open clients
refetch only what actually changed — across tabs, across users, across the world.
Live updates →
Identity before the first request
Every visitor to a Xeer app arrives with a verified, stable identity — no sign-in screen required. Own
data per user from day one, and add named accounts when you actually want them.
Auth →
Authorization you can prove
Declare a table owned-per-user or scoped-to-a-workspace and the rule is enforced in the data layer,
not in a handler somebody might forget. Then write a test that proves it.
Table policies →
A test runner in the box
xeer test builds your app, boots it with fresh isolated state, and runs your tests as
three different users. No test framework to pick, no harness to build.
Testing →
Preview, promote, roll back
Ship to a side-by-side URL, look at it, then promote the exact same bundle to production. If it goes
wrong, put a previous version back by its content address.
Deploy →
Secrets that stay secret
Store configuration per environment and read it from ctx.env. Server code cannot be
imported by client code — the compiler refuses — so a key cannot reach a browser by accident.
Environment variables →
Machine-readable end to end
Every command takes --json. Every failure carries a stable code with a suggested
repair. There is an MCP server. Pair with an agent and it can actually read the output.
Building with agents →
## Built for developers working with agents
Xeer's whole surface is designed to be read by a program as easily as by a person. Commands emit
structured envelopes rather than prose. Failures carry stable
[`XE####` codes](/reference/diagnostics) with a machine-readable location and a suggested edit. The
app's entire shape lives in one declarative manifest, so an agent can reason about what exists without
guessing. And [`@impetik/xeer-mcp`](/guides/agents#the-mcp-server) exposes the whole loop — scaffold,
check, test, build, deploy — as tools.
That is not a bolt-on. It is why the framework is small enough to hold in your head, and small enough
to hand to something that has to hold it in a context window.
Xeer is in closed beta. The CLI, the compiler, and the local development loop are
open source and work offline with no account at all — xeer new, xeer dev, and
xeer test need nothing but Node.js. Deploying needs an account,
and accounts are currently by invitation. See the FAQ.
## Next
- **[Quickstart](/quickstart)** — a running, deployed app in five minutes.
- **[Project structure](/guides/project-structure)** — what each generated file is for.
- **[Server functions and the database](/guides/server)** — the whole data API.
- **[CLI reference](/reference/cli)** — every command.
---
# Quickstart
Five minutes from nothing to a deployed app. You need **Node.js 22.12 or newer** and nothing else.
## 1. Create an app
```sh
npx @impetik/xeer new my-app
cd my-app
npm install
```
Nothing to install first. `npm install` then puts Xeer in the project, so from here on `npx xeer