Overview for developers
This section is for developers. If you just want to put a folder online, the Start here guides are all you need.
Bailey hosts static sites and gives each one a small, governed backend (key-value storage and form/data collection) reachable from the page itself, no server of your own to run.
The mental model
Section titled “The mental model”There are two planes:
- The data plane serves your published sites and exposes the in-page store API. This is the hot path: a Go service resolves the request’s
Hostto a site and streams files straight from disk. - The control plane is the dashboard backend: accounts, projects, versions, domains, the audit log. It’s authenticated with your Bailey login (Supabase Auth) and is where ownership is enforced.
You rarely touch the control plane directly; the dashboard does. As a developer, the part you’ll actually use is the JavaScript SDK (in your pages). There’s also an optional, not-yet-released bailey CLI for advanced setups, but the dashboard covers publishing, reading and erasing data without it.
How serving works
Section titled “How serving works”GET https://acme-pricing.trybailey.app/about │ ▼ Host → site (subdomain or your verified custom domain) │ ▼ Serve the live version's files from disk ├─ "/" → index.html ├─ "/about" → about/index.html (clean URLs) └─ unknown → the site's own 404Key behaviours:
index.htmlis the default document for any directory.- Clean URLs: a path with no file extension (
/about) falls back toabout/index.html, the format most static generators emit. - Isolation is structural: files are opened through a kernel-level root jail, so a crafted URL (
.., symlinks) can never read another site’s files. - Security headers are set for you:
X-Content-Type-Options: nosniff, a baselineContent-Security-Policy, correctContent-Typederived from the file extension server-side (never sniffed). - A “Hosted on Bailey” badge is injected into served HTML at serve time (it’s never written into your files).
What you get for dynamic features
Section titled “What you get for dynamic features”A purely static site can still:
- Store and read key-value data (a published config, a theme):
recon.store.kv. - Count things atomically (votes, likes, views) with no lost updates:
recon.store.counter. - Collect submissions (a contact form, a waitlist) into append-only buckets that the browser can write to but cannot read back:
recon.store.collect. Only you, the owner, read submissions. - Give each member their own private data (a personal journal, a saved draft) on organization pages, written and read back only by its author — never by other members, or even you:
recon.store.mine.
Both come from one script tag and require no keys in your code: the SDK fetches a short-lived, origin-bound token for you. Start with the JavaScript SDK.
Where to go next
Section titled “Where to go next”- The JavaScript SDK: add data and forms to your pages.
- Reading & erasing collected data: get submissions out, honour erasure requests.
- The
baileyCLI: optional, advanced; publish and manage from the terminal (not yet released). - AI assistants (MCP): let Claude or ChatGPT drive sites over an OAuth-scoped MCP server.
- Data API reference: the raw endpoints, if you’re not using the SDK.
- Security model: tokens, isolation, the defense chain.