# What dabadata is

Source: https://dabadata.com/docs/ (HTML) - https://dabadata.com/docs/index.md (this page as markdown)

dabadata hosts your whole app: its frontend on your own domain, a realtime database, sign-in for your users, file storage and AI calls, all under the same rules. Underneath it is plain Postgres, so your rows sit in ordinary tables you can open with any SQL tool. On top you declare your tables in one file, and rules that read like membership - "admins and editors may create, the owner may update" - and every decision comes back with a sentence that explains it. Every interaction is written to a trace, live subscriptions stream changes over one socket, and an MCP server lets an AI agent use the same data under the same rules.

Every feature is listed on one page, [Features](https://dabadata.com/docs/features/index.md). AI assistants: the docs are indexed as markdown at [/llms.txt](https://dabadata.com/llms.txt), and every page has a markdown copy at its `index.md`.

## How it fits together

1. **Declare.** One TypeScript file, `projects/<name>.ts`, lists the tables, their columns and one rule per operation. It is plain data - no functions hide in it. [Tables](https://dabadata.com/docs/tables/index.md), [Rules](https://dabadata.com/docs/rules/index.md).
2. **Apply.** On start, and whenever you call `POST /v1/schema/reload`, the server creates a Postgres schema for the project plus any missing tables and columns. It never drops anything or changes a type; it tells you about drift instead.
3. **Hand out tokens.** Your own backend holds the project key and mints a user token (id, name, role) for each signed-in person, your identity provider's tokens are trusted as they are, or dabadata [hosts your users' sign-in](https://dabadata.com/docs/end-user-auth/index.md) itself. The browser only ever sees a user token. [Identity and tokens](https://dabadata.com/docs/identity/index.md).
4. **Read, write, subscribe.** The app calls `/v1/mutate` and `/v1/db`, or uses the [JavaScript client](https://dabadata.com/docs/client/index.md), and keeps lists fresh over the [live socket](https://dabadata.com/docs/live/index.md). Each call is checked against the rules and recorded in the [trace](https://dabadata.com/docs/trace/index.md) with its decision and the reason.
5. **Look inside.** The [console](https://dabadata.com/docs/console/index.md) shows your projects, keys, users, team and usage, and the viewer the tables, the trace and a rules simulator; the [MCP server](https://dabadata.com/docs/mcp/index.md) lets an agent read the schema, change rows and explain a denial from the trace.
6. **Put it online.** A [site](https://dabadata.com/docs/sites/index.md) serves your app's frontend next to its data, at `<name>.dabadata.site` on every plan or your own domain from Starter, deployed with one command or by your AI agent.

## What is in the repository

| Folder | What it is |
| --- | --- |
| `server/` | Bun + TypeScript. The HTTP and WebSocket API on top of Postgres. |
| `projects/` | Project definitions. `default.ts` is the demo: a shared task list plus announcements. |
| `client/` | A zero-dependency JavaScript client: insert, update, delete, query, subscribe. |
| `inspect/` | The [console](https://dabadata.com/docs/console/index.md), served at `/console/`, and the viewer, served at `/`: Tables (live rows), Trace, Rules (matrix + simulator) and the WordPress mirror. |
| `mcp/` | An MCP server (stdio) so an agent can work with a project. |
| `plugin/dabadata/` | A WordPress plugin that streams every content change to the server. |
| `examples/` | The live demo, the to-do example and the pricing page. |

> **Note:** One dabadata server runs its own project and, when it hosts them, any number of [hosted projects](https://dabadata.com/docs/projects/index.md), each with live and test environments and its own keys. It is one server process, which keeps live fan-out simple and exact - see [how fan-out works](https://dabadata.com/docs/live/index.md#fan-out).

## Where to go next

- [Getting started](https://dabadata.com/docs/getting-started/index.md) - Sign up, copy your keys, paste a snippet and watch your first live row arrive - or run it on your own machine.
- [Concepts](https://dabadata.com/docs/tables/index.md) - Tables, rules, identity, the trace and live subscriptions - how the pieces think.
- [API reference](https://dabadata.com/docs/api/index.md) - Every `/v1` endpoint with who may call it, the request, the response and the errors.
