Skip to content

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.

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 Host to 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.

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 404

Key behaviours:

  • index.html is the default document for any directory.
  • Clean URLs: a path with no file extension (/about) falls back to about/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 baseline Content-Security-Policy, correct Content-Type derived 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).

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.

Hosted on Bailey