backyard

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: Apache-2.0

README

Backyard

Drop a folder of HTML, get an internal URL — with a zero-config backend for every site.

CI

Backyard is an open-source, enterprise-ready take on Quick, the internal hosting platform Shopify described on its engineering blog: anyone in the company copies a folder of HTML to a server and gets https://lunch-vote.backyard.acme.com/ — reachable only by colleagues, signed in through the company identity provider. Every site can include one script and get a realtime database, file uploads, AI, the data warehouse, websockets and the viewer's identity, with no backend code and no secrets in the page. The free-tier Cloudflare edition is inspired by OpenQuick.

<script src="/__backyard/backyard.js"></script>
<script type="module">
  const me = await backyard.me();                                   // who is viewing
  const votes = backyard.db.collection("votes");
  await votes.set(me.id.replace(/[^A-Za-z0-9_\-:.]/g, "_"), { choice: "tacos", name: me.name });
  votes.watch((docs) => render(docs));                               // live in every tab
</script>

Why

Most internal tools are a page, a list, a button and a bit of AI. They die in the backlog because each one needs a repo, a backend, a database, credentials, a deploy pipeline and a security review. Backyard removes all of that:

  • A site is a folder. No framework, no build step (a dist/ folder is fine too), no config. Deploying is copying; overwriting is updating.
  • The backend is already there. Database with realtime, files, AI, warehouse, websockets and identity, all scoped per site, all behind your company login.
  • Saying no is a feature. No server code, no cron, no custom backends — a small, fixed set of capabilities that a platform team can secure once.
  • Agents can do it all. Coding agents get the docs, a skill, an MCP server and templates, so "build me a lunch-vote page" ends with a URL — and with the Claude connector, so does a chat in Claude.

Features

  • One binary: server, deploy CLI, local dev server and MCP server; a container image and Terraform/Helm/Compose/systemd kits.
  • Client SDK (/__backyard/backyard.js): backyard.db (JSON documents, queries, change feeds, live queries), backyard.files, backyard.ai (chat, streaming, images, embeddings), backyard.warehouse (read-only SQL), backyard.socket (rooms with presence), backyard.id.
  • Hub: a searchable directory of every site, drag-and-drop deploys, CLI setup, API docs at /docs and /llms.txt for agents.
  • Sign-in: Okta / any OIDC provider, Google IAP, AWS ALB, trusted proxy headers (oauth2-proxy, Pomerium, Azure Easy Auth, Cloudflare Access), or none for labs; API tokens, static CI tokens and the OAuth device flow for CLIs.
  • Claude connector (opt-in, both editions): add https://<hub>/__backyard/mcp to Claude (web, Desktop, mobile, Cowork, Claude Code) as a custom connector; people sign in with the company login, approve Backyard's consent page, and Claude finds, reads and publishes sites as them. Backyard is the OAuth server; your IdP needs no change (guide).
  • Deploy any way: Backyard's diffed upload API (no cloud account needed), aws s3 sync, gcloud storage rsync, az storage blob sync or plain rsync.
  • Pluggable everything: storage (disk, S3, GCS, Azure Blob), database (SQLite, PostgreSQL, DynamoDB), realtime fan-out (in-memory, Postgres, Redis), any AI provider, BigQuery / Redshift / Postgres / Athena.
  • Enterprise-ready: admin groups, allowed domains and groups, optional site ownership, rate limits and quotas, audit logs, Prometheus metrics, health checks, horizontal scaling.
  • Runs anywhere: AWS, Google Cloud, Azure, Kubernetes, one VM without a bucket — or Cloudflare's free tier with no server at all.

Quickstart (60 seconds)

curl -fsSL https://raw.githubusercontent.com/thasami/backyard/main/scripts/install.sh | sh
# or: go install github.com/thasami/backyard/cmd/backyard@latest

backyard serve --dev          # terminal 1: hub at http://localhost:8080, no login, data in ./.backyard-data
backyard init lunch-vote && cd lunch-vote       # terminal 2: index.html, .backyard.json, CLAUDE.md, AGENTS.md, skill
backyard dev                                    # live preview with a local backend: http://lunch-vote.localhost:4321/
backyard login --server http://localhost:8080   # the dev server accepts anonymous deploys
backyard deploy                                 # → http://lunch-vote.localhost:8080/

Then open http://localhost:8080/ to see the hub. Next: the getting started guide.

The client API at a glance

// Identity — from your IdP, no login forms
const me = await backyard.id.me();     // {id, email, name, title, team, avatar_url, groups, …}

// Database — JSON documents per site, type-strict queries, realtime
const todos = backyard.db.collection("todos");
await todos.create({ text: "Ship it", done: false });
const open = await todos.where("done", "==", false).orderBy("_meta.created_at", "desc").limit(20).get();
todos.subscribe({
  onCreate: (doc) => toast(`${doc._meta.created_by} added “${doc.text}”`),
  onUpdate: (doc) => rerender(doc),
  onDelete: (id) => remove(id),
});

// AI — the server holds the keys; pages pick an alias
const { content } = await backyard.ai.chat("Summarize this thread: " + text, { model: "fast" });
for await (const chunk of backyard.ai.stream("Write release notes for: " + changes)) out.textContent += chunk.text;

// Files and the warehouse
const file = await backyard.files.upload(input.files[0]);            // {id, url, name, size, …}
const { rows } = await backyard.warehouse.named("weekly_active_users", { team: "growth" });

// Websocket rooms — presence and messages
const room = backyard.socket.room("standup", { state: { name: me.name, speaking: false } });
room.on("members", (members) => renderPeople(members));
room.on("message", (data, from) => react(data.emoji, from.user.name));
room.send({ emoji: "🎉" });

Full reference: docs/client-api.md and the API reference; complete example apps in recipes and examples/.

Architecture

                     ┌──────────── company IdP (Okta · Entra ID · Google · …) ────────────┐
                     │                                                                     │
browser ──HTTPS──▶ [ built-in OIDC │ Google IAP │ AWS ALB │ trusted proxy │ none ] ──▶ backyard serve
                                                                                        │
   hub:   https://backyard.acme.com/                      ├─ static sites ─────▶ storage   fs │ s3 │ gcs │ azure
   sites: https://<site>.backyard.acme.com/               ├─ backyard.db ──────▶ database  sqlite │ postgres │ dynamodb
          (or https://backyard.acme.com/s/<site>/)        ├─ backyard.socket ──▶ pub/sub   memory │ postgres │ redis
                                                          ├─ backyard.ai ──────▶ Anthropic · OpenAI-compatible · Azure OpenAI
                                                          │                       · Bedrock · Gemini / Vertex · Ollama
                                                          ├─ backyard.warehouse ▶ BigQuery · Postgres / Redshift · Athena
                                                          └─ deploy gateway (embedded)
CLI · CI · agents ──▶ deploy gateway: embedded │ `backyard gateway` │ AWS Lambda ──presigned PUT──▶ bucket
                └───▶ or direct: aws s3 sync · gcloud storage rsync · az storage blob sync · rsync

More in docs/architecture.md; the normative contract is docs/spec/SPEC.md.

Deploy it

Where What you get Kit
AWS ECS Fargate behind an ALB (built-in OIDC or ALB authentication), S3, DynamoDB or RDS PostgreSQL, Valkey pub/sub, Claude on Bedrock, optional Lambda deploy gateway deploy/terraform/aws
Google Cloud Cloud Run behind a global load balancer with IAP (like Shopify's Quick), GCS, Cloud SQL, Gemini and Claude on Vertex AI, BigQuery deploy/terraform/gcp
Azure Container Apps behind Front Door, Blob Storage, PostgreSQL Flexible Server, Entra ID, keyless Azure OpenAI deploy/terraform/azure
Kubernetes Helm chart: one replica on a volume with SQLite by default; production values with buckets, Postgres/DynamoDB, Redis, OIDC, HPA, PDB, ServiceMonitor deploy/helm/backyard
One VM, no bucket — Docker Compose Backyard + PostgreSQL + Caddy (automatic TLS for the wildcard domain), files on a volume, rsync deploys deploy/docker-compose
One VM, no bucket — systemd One hardened binary, SQLite, files on disk, Caddy or nginx, rsync deploys deploy/systemd
Cloudflare free tier One Worker + Durable Objects + Workers AI, optional R2 and Cloudflare Access; no server, no credit card, no Terraform: backyard cloudflare setup (Node.js 22+; a release build of the CLI installs its engine, one from go install needs a checkout or --package), then domain add and access enable deploy/cloudflare, Terraform (optional)

The container image is ghcr.io/thasami/backyard. Configuration is one backyard.yaml (reference; backyard config example prints an annotated one).

Authentication

Mode How Docs
oidc Built-in login against Okta, Entra ID, Google Workspace, Auth0, Keycloak… (authorization code + PKCE); one session for the hub and every site Okta step by step
iap Google Cloud Identity-Aware Proxy assertions IAP
alb AWS ALB authenticate-oidc (e.g. with Okta), signed X-Amzn-Oidc-Data ALB
header Trusted proxy headers or a verified JWT: oauth2-proxy, Pomerium, Azure Easy Auth, Cloudflare Access header
Cloudflare Access Native in the Workers edition (AUTH_MODE=access) Cloudflare
none Anonymous guests, for laptops and labs none

CLIs sign in through the browser (backyard login), with the OAuth device flow, or with a token; CI uses static tokens whose SHA-256 is all the server stores.

Deploy methods

Method For
api (default) Everyone: diffed uploads through Backyard's deploy gateway — embedded in the server, standalone (backyard gateway), or an AWS Lambda function URL for people without cloud accounts (they backyard login through the browser first, then deploy with their token).
s3 aws s3 sync straight into the bucket
gcs gcloud storage rsync (or gsutil rsync)
azure az storage blob sync
rsync rsync to a server with local-disk storage — no bucket at all

backyard deploy picks automatically; see deploying sites.

Backends

Capability Options
Storage (site files, uploads) Local disk / NFS / mounted buckets (fs), Amazon S3 and S3-compatible (MinIO, Cloudflare R2, Ceph, B2), Google Cloud Storage, Azure Blob Storage
Database (backyard.db) SQLite (single node), PostgreSQL (RDS, Cloud SQL, Azure, Neon…), Amazon DynamoDB, in-memory
Realtime fan-out In-memory (one instance), PostgreSQL LISTEN/NOTIFY, Redis / Valkey
AI Anthropic (API, Vertex AI, Bedrock), OpenAI and compatible servers (vLLM, LiteLLM, OpenRouter, Workers AI, AI Gateway), Ollama, Azure OpenAI, Amazon Bedrock, Google Gemini (AI Studio, Vertex AI); Workers AI on the Cloudflare edition
Warehouse BigQuery, PostgreSQL-compatible (Redshift, AlloyDB, Aurora…), Amazon Athena

Guides: storage and databases, AI providers, warehouse, realtime.

Agent-native

  • Claude skill — skills/backyard: rules, API cheat sheet, recipes and deploy guide. backyard skill install, and added to every project by backyard init.

  • Claude Code plugin — skill, /backyard:new, /backyard:deploy, /backyard:docs and the MCP server:

    /plugin marketplace add thasami/backyard
    /plugin install backyard@backyard
    
  • MCP server — backyard mcp (e.g. claude mcp add backyard -- backyard mcp): tools to read the docs, scaffold, deploy, list sites and read other sites' code, with the CLI's login.

  • Claude connector — the hub as a remote MCP server at /__backyard/mcp, with the company sign-in and no CLI: docs/claude-connector.md.

  • Init templates — backyard init --agents claude,codex,cursor,copilot writes CLAUDE.md, AGENTS.md, .cursor/rules/backyard.mdc and .github/copilot-instructions.md.

  • /llms.txt, /llms-full.txt, /docs on every hub.

See docs/agents.md.

Security model

Backyard trusts everyone your IdP signs in — that is the point — and nobody else:

  • every request is authenticated; outsiders see nothing, and allowed_domains, allowed_emails and allowed_groups narrow access further;
  • inside the bubble there are no per-site permissions: anyone may read and write any site's data, so sites must not hold data not every employee may see;
  • in host mode each site is its own browser origin, separated from other sites and the hub by a CSRF header, Origin checks and websocket origin checks (path mode shares one origin — a documented trade-off);
  • secrets stay server-side; all keys derive from one server.secret with HKDF; tokens are short-lived JWTs or hashed static tokens;
  • rate limits, quotas, upload limits, read-only warehouse roles, sandboxed uploads (only known passive types are served without a sandbox), SSRF-guarded fetching and audit logs bound the damage of a runaway page;
  • in host mode a site's page cannot sign visitors in as someone else (conflicting cookies fail closed), a CLI login another site started needs confirmation, and backyard pull never writes repository metadata or agent files from a site.

Read docs/security.md before going to production; report vulnerabilities privately as described in SECURITY.md.

Documentation

Getting started · Configuration · Authentication · Deploying sites · Storage and databases · AI providers · Warehouse · Realtime · Client API · CLI · Agents · Security · Operations · Cloudflare · Architecture · Specification

Project layout

cmd/backyard/            the binary: server, CLI, MCP server
cmd/backyard-lambda/     the deploy gateway as an AWS Lambda function
internal/                server, auth, docstore, blob, pubsub, realtime, ai, warehouse, deploy, cli, …
web/sdk/                 the client SDK (backyard.js / .mjs / .d.ts) served to every site
web/hub/                 the hub UI
skills/backyard/         the Claude skill: the single source of agent-facing docs
templates/               files written by `backyard init`
commands/, .claude-plugin/  the Claude Code plugin
deploy/                  Terraform (aws, gcp, azure, cloudflare), Helm, Docker Compose, systemd,
                         and the Cloudflare Workers edition (deploy/cloudflare)
examples/                complete example sites
conformance/             the black-box API suite both editions must pass (SPEC §17)
e2e/                     real-browser end-to-end tests (Playwright, Chromium)
docs/                    documentation and the design specification (docs/spec/SPEC.md)
scripts/                 install script and CI tooling

Contributing

Contributions are welcome — see CONTRIBUTING.md for the development setup, tests (including the integration services, the cross-edition conformance suite and the Playwright end-to-end tests) and guidelines. Please follow the code of conduct.

License

Apache License 2.0. Backyard is an independent project and is not affiliated with Shopify or Cloudflare.

Directories

Path Synopsis
cmd
backyard command
Command backyard is the single Backyard binary: the server (serve, gateway, dev) and the CLI/MCP server developers and agents use to build and deploy sites.
Command backyard is the single Backyard binary: the server (serve, gateway, dev) and the CLI/MCP server developers and agents use to build and deploy sites.
backyard-lambda command
Command backyard-lambda runs the Backyard deploy gateway (SPEC §7) as an AWS Lambda function behind a function URL (or an API Gateway HTTP API).
Command backyard-lambda runs the Backyard deploy gateway (SPEC §7) as an AWS Lambda function behind a function URL (or an API Gateway HTTP API).
deploy
helm/charttest
Package charttest holds tests for the Helm chart in deploy/helm/backyard.
Package charttest holds tests for the Helm chart in deploy/helm/backyard.
terraform/aws/configcheck
Package configcheck holds an integration test for the AWS Terraform module in deploy/terraform/aws: it runs every scenario of the module's tests/module.tftest.hcl (terraform test with mocked providers) and loads the backyard.yaml each one renders, for the ECS service and for the Lambda deploy gateway, with Backyard's own loader in internal/config, in the environment the container or function would get (Secrets Manager values replaced by placeholders).
Package configcheck holds an integration test for the AWS Terraform module in deploy/terraform/aws: it runs every scenario of the module's tests/module.tftest.hcl (terraform test with mocked providers) and loads the backyard.yaml each one renders, for the ECS service and for the Lambda deploy gateway, with Backyard's own loader in internal/config, in the environment the container or function would get (Secrets Manager values replaced by placeholders).
terraform/azure/configcheck
Package configcheck holds an integration test for the Azure Terraform module in deploy/terraform/azure: it runs every scenario of the module's tests/module.tftest.hcl (terraform test with mocked providers) and loads the backyard.yaml each one gives the Container App with Backyard's own loader in internal/config, in the environment the container would get (Container Apps secrets replaced by placeholders).
Package configcheck holds an integration test for the Azure Terraform module in deploy/terraform/azure: it runs every scenario of the module's tests/module.tftest.hcl (terraform test with mocked providers) and loads the backyard.yaml each one gives the Container App with Backyard's own loader in internal/config, in the environment the container would get (Container Apps secrets replaced by placeholders).
terraform/gcp/configcheck
Package configcheck holds an integration test for the Google Cloud Terraform module in deploy/terraform/gcp: it renders backyard.yaml for the scenarios in testdata/render.tftest.hcl and for every run of the module's own tests/module.tftest.hcl (terraform test with mocked Google providers), and loads each result with Backyard's own loader in internal/config, the same way the server does at startup (strict YAML, ${ENV} expansion, environment overrides, defaults and validation).
Package configcheck holds an integration test for the Google Cloud Terraform module in deploy/terraform/gcp: it renders backyard.yaml for the scenarios in testdata/render.tftest.hcl and for every run of the module's own tests/module.tftest.hcl (terraform test with mocked Google providers), and loads each result with Backyard's own loader in internal/config, the same way the server does at startup (strict YAML, ${ENV} expansion, environment overrides, defaults and validation).
Package docs holds Backyard's user and operator documentation (Markdown, including the normative design specification in spec/SPEC.md).
Package docs holds Backyard's user and operator documentation (Markdown, including the normative design specification in spec/SPEC.md).
internal
ai
Package ai defines provider-neutral types for the AI proxy (backyard.ai).
Package ai defines provider-neutral types for the AI proxy (backyard.ai).
ai/anthropic
Package anthropic implements ai.Provider for Claude using the official Anthropic Go SDK (github.com/anthropics/anthropic-sdk-go).
Package anthropic implements ai.Provider for Claude using the official Anthropic Go SDK (github.com/anthropics/anthropic-sdk-go).
ai/bedrock
Package bedrock implements ai.Provider for Amazon Bedrock using the AWS SDK for Go v2 (bedrockruntime).
Package bedrock implements ai.Provider for Amazon Bedrock using the AWS SDK for Go v2 (bedrockruntime).
ai/gemini
Package gemini implements ai.Provider for Google's Gemini models over raw HTTP, either through the Gemini API in Google AI Studio (api_key, https://generativelanguage.googleapis.com/v1beta) or through Vertex AI (project_id + location with Application Default Credentials; location "global" uses https://aiplatform.googleapis.com).
Package gemini implements ai.Provider for Google's Gemini models over raw HTTP, either through the Gemini API in Google AI Studio (api_key, https://generativelanguage.googleapis.com/v1beta) or through Vertex AI (project_id + location with Application Default Credentials; location "global" uses https://aiplatform.googleapis.com).
ai/internal/claudemodel
Package claudemodel encodes per-model request rules for Claude models that are shared by the anthropic provider (first-party, Vertex AI, Bedrock Mantle) and the bedrock provider (Converse API).
Package claudemodel encodes per-model request rules for Claude models that are shared by the anthropic provider (first-party, Vertex AI, Bedrock Mantle) and the bedrock provider (Converse API).
ai/internal/httpx
Package httpx holds HTTP helpers shared by the raw-HTTP AI providers (openai, gemini): JSON requests, bounded response decoding and conversion of upstream error bodies into *ai.UpstreamError.
Package httpx holds HTTP helpers shared by the raw-HTTP AI providers (openai, gemini): JSON requests, bounded response decoding and conversion of upstream error bodies into *ai.UpstreamError.
ai/internal/imagefetch
Package imagefetch downloads remote images referenced by URL in chat requests for providers that only accept inline bytes (Gemini, Bedrock, Claude on Vertex AI/Bedrock, Ollama and other self-hosted OpenAI-compatible servers).
Package imagefetch downloads remote images referenced by URL in chat requests for providers that only accept inline bytes (Gemini, Bedrock, Claude on Vertex AI/Bedrock, Ollama and other self-hosted OpenAI-compatible servers).
ai/internal/sse
Package sse is a small, allocation-conscious reader for the text/event-stream format (https://html.spec.whatwg.org/multipage/server-sent-events.html) as emitted by OpenAI-compatible and Gemini streaming endpoints.
Package sse is a small, allocation-conscious reader for the text/event-stream format (https://html.spec.whatwg.org/multipage/server-sent-events.html) as emitted by OpenAI-compatible and Gemini streaming endpoints.
ai/openai
Package openai implements ai.Provider for the OpenAI Chat Completions, Images and Embeddings APIs and for compatible servers: provider types "openai" (api.openai.com or any OpenAI-compatible base_url such as vLLM, LiteLLM, LM Studio or OpenRouter), "ollama" (OpenAI-compatible endpoint of a local Ollama) and "azure-openai" (Azure OpenAI / Azure AI Foundry, API key or Entra ID authentication).
Package openai implements ai.Provider for the OpenAI Chat Completions, Images and Embeddings APIs and for compatible servers: provider types "openai" (api.openai.com or any OpenAI-compatible base_url such as vLLM, LiteLLM, LM Studio or OpenRouter), "ollama" (OpenAI-compatible endpoint of a local Ollama) and "azure-openai" (Azure OpenAI / Azure AI Foundry, API key or Entra ID authentication).
ai/router
Package router maps client-facing model aliases to configured providers and implements ai.Service.
Package router maps client-facing model aliases to configured providers and implements ai.Service.
app
Package app wires configuration into running components and serves them.
Package app wires configuration into running components and serves them.
auth
Package auth authenticates requests (SPEC §8): browser sessions via the built-in OIDC login (Okta, Entra ID, Google…), identity-aware proxies (Google IAP, AWS ALB OIDC, trusted headers), Backyard API tokens, static tokens and IdP-issued bearer JWTs (device flow).
Package auth authenticates requests (SPEC §8): browser sessions via the built-in OIDC login (Okta, Entra ID, Google…), identity-aware proxies (Google IAP, AWS ALB OIDC, trusted headers), Backyard API tokens, static tokens and IdP-issued bearer JWTs (device flow).
blob
Package blob defines the object storage abstraction that holds site files, metadata and user uploads.
Package blob defines the object storage abstraction that holds site files, metadata and user uploads.
blob/azure
Package azure implements blob.Store on Azure Blob Storage (and Azurite).
Package azure implements blob.Store on Azure Blob Storage (and Azurite).
blob/backends
Package backends constructs a blob.Store from configuration.
Package backends constructs a blob.Store from configuration.
blob/blobtest
Package blobtest is a conformance test-suite for blob.Store implementations.
Package blobtest is a conformance test-suite for blob.Store implementations.
blob/fs
Package fs implements blob.Store on a local directory tree.
Package fs implements blob.Store on a local directory tree.
blob/gcs
Package gcs implements blob.Store on Google Cloud Storage.
Package gcs implements blob.Store on Google Cloud Storage.
blob/internal/blobutil
Package blobutil holds helpers shared by the blob.Store implementations: key/prefix validation, content-type detection on streams, exact-size enforcement, chunked reading for multi-part uploads, synthetic ETags, presign TTL clamping and small concurrency utilities.
Package blobutil holds helpers shared by the blob.Store implementations: key/prefix validation, content-type detection on streams, exact-size enforcement, chunked reading for multi-part uploads, synthetic ETags, presign TTL clamping and small concurrency utilities.
blob/s3
Package s3 implements blob.Store on Amazon S3 and S3-compatible object stores (MinIO, Cloudflare R2, Ceph RGW, Backblaze B2, ...).
Package s3 implements blob.Store on Amazon S3 and S3-compatible object stores (MinIO, Cloudflare R2, Ceph RGW, Backblaze B2, ...).
cli
Package cli implements the `backyard` command line (SPEC §13): the server entry points (serve, gateway, dev), the developer workflow (init, deploy, login, sites, open, pull, token, skill), the MCP server for agents, and `backyard cloudflare setup|domain|access|status` for the Workers edition.
Package cli implements the `backyard` command line (SPEC §13): the server entry points (serve, gateway, dev), the developer workflow (init, deploy, login, sites, open, pull, token, skill), the MCP server for agents, and `backyard cloudflare setup|domain|access|status` for the Workers edition.
cli/clitest
Package clitest provides an in-memory fake of a Backyard server's client surface (the deploy gateway protocol of SPEC §7, the CLI login handoff of §8.3 and POST /__backyard/api/tokens) for testing the CLI and the MCP server without running the real server.
Package clitest provides an in-memory fake of a Backyard server's client surface (the deploy gateway protocol of SPEC §7, the CLI login handoff of §8.3 and POST /__backyard/api/tokens) for testing the CLI and the MCP server without running the real server.
cli/scaffold
Package scaffold writes the files of a new Backyard project (`backyard init` and the MCP tool backyard_init) and provides SafeJoin, the path guard used whenever the CLI writes files whose names come from elsewhere (templates, `backyard pull`).
Package scaffold writes the files of a new Backyard project (`backyard init` and the MCP tool backyard_init) and provides SafeJoin, the path guard used whenever the CLI writes files whose names come from elsewhere (templates, `backyard pull`).
clientconfig
Package clientconfig manages the local state of the Backyard CLI and MCP server (SPEC §13): the per-user config file with named profiles ($XDG_CONFIG_HOME/backyard/config.json, mode 0600), environment overrides, the per-project .backyard.json file, gateway URL resolution, token expiry awareness and the OAuth device-flow helpers used to obtain and refresh IdP-issued tokens.
Package clientconfig manages the local state of the Backyard CLI and MCP server (SPEC §13): the per-user config file with named profiles ($XDG_CONFIG_HOME/backyard/config.json, mode 0600), environment overrides, the per-project .backyard.json file, gateway URL resolution, token expiry awareness and the OAuth device-flow helpers used to obtain and refresh IdP-issued tokens.
config
Package config defines Backyard's configuration schema, loading (YAML with ${ENV} expansion), defaults and validation.
Package config defines Backyard's configuration schema, loading (YAML with ${ENV} expansion), defaults and validation.
deploy
Package deploy implements the deploy gateway protocol (SPEC §7): the server side (Gateway, mountable inside the main server, as `backyard gateway`, or as an AWS Lambda function), the Go client used by the CLI and MCP server, and the local file collection/ignore rules shared by every deploy method.
Package deploy implements the deploy gateway protocol (SPEC §7): the server side (Gateway, mountable inside the main server, as `backyard gateway`, or as an AWS Lambda function), the Go client used by the CLI and MCP server, and the local file collection/ignore rules shared by every deploy method.
docstore
Package docstore defines Backyard's schemaless JSON document database (backyard.db).
Package docstore defines Backyard's schemaless JSON document database (backyard.db).
docstore/backends
Package backends constructs a docstore.Store from configuration.
Package backends constructs a docstore.Store from configuration.
docstore/conformance
Package conformance is the shared semantic test-suite for docstore.Store implementations.
Package conformance is the shared semantic test-suite for docstore.Store implementations.
docstore/dynamodb
Package dynamodb is the docstore.Store for Amazon DynamoDB (and DynamoDB Local / LocalStack for development).
Package dynamodb is the docstore.Store for Amazon DynamoDB (and DynamoDB Local / LocalStack for development).
docstore/internal/dsutil
Package dsutil holds helpers shared by the docstore backends: argument validation, canonicalisation of document bodies and JSON encoding.
Package dsutil holds helpers shared by the docstore backends: argument validation, canonicalisation of document bodies and JSON encoding.
docstore/memory
Package memory is an in-process docstore.Store backed by maps.
Package memory is an in-process docstore.Store backed by maps.
docstore/postgres
Package postgres is the docstore.Store for PostgreSQL (Cloud SQL, RDS, Aurora, Azure Database for PostgreSQL Flexible Server, self-hosted…) using pgx/v5 and JSONB.
Package postgres is the docstore.Store for PostgreSQL (Cloud SQL, RDS, Aurora, Azure Database for PostgreSQL Flexible Server, self-hosted…) using pgx/v5 and JSONB.
docstore/sqlite
Package sqlite is the embedded, single-node docstore.Store backed by SQLite (modernc.org/sqlite, pure Go, driver name "sqlite").
Package sqlite is the embedded, single-node docstore.Store backed by SQLite (modernc.org/sqlite, pure Go, driver name "sqlite").
identity
Package identity defines the user profile shared by authentication, the identity API (backyard.id), presence and audit logging.
Package identity defines the user profile shared by authentication, the identity API (backyard.id), presence and audit logging.
identity/identitytest
Package identitytest holds integration tests that run the identity user cache against the real docstore backends (memory, SQLite and, when the BACKYARD_TEST_* services are available, PostgreSQL and DynamoDB Local).
Package identitytest holds integration tests that run the identity user cache against the real docstore backends (memory, SQLite and, when the BACKYARD_TEST_* services are available, PostgreSQL and DynamoDB Local).
keys
Package keys derives purpose-specific keys from server.secret so that a session key can never be used to forge an API token or an upload URL.
Package keys derives purpose-specific keys from server.secret so that a session key can never be used to forge an API token or an upload URL.
mcpremote
Package mcpremote serves the remote MCP endpoint of the Claude connector, POST /__backyard/mcp (SPEC §14.1): Streamable HTTP, stateless, JSON responses only, protocol versions 2025-11-25 and 2025-06-18.
Package mcpremote serves the remote MCP endpoint of the Claude connector, POST /__backyard/mcp (SPEC §14.1): Streamable HTTP, stateless, JSON responses only, protocol versions 2025-11-25 and 2025-06-18.
mcpserver
Package mcpserver implements `backyard mcp`: a Model Context Protocol server (stdio) that lets coding agents read the Backyard docs, scaffold sites, deploy them and look at — or reuse code from — other sites, using the credentials of the current CLI profile (SPEC §14).
Package mcpserver implements `backyard mcp`: a Model Context Protocol server (stdio) that lets coding agents read the Backyard docs, scaffold sites, deploy them and look at — or reuse code from — other sites, using the credentials of the current CLI profile (SPEC §14).
netguard
Package netguard guards outbound HTTP requests whose target comes from outside the server (an end user's image URL, an MCP client metadata document) against server-side request forgery: connections to loopback, private, link-local, multicast or otherwise non-public addresses are refused.
Package netguard guards outbound HTTP requests whose target comes from outside the server (an end user's image URL, an MCP client metadata document) against server-side request forgery: connections to loopback, private, link-local, multicast or otherwise non-public addresses are refused.
pubsub
Package pubsub is the cross-instance message bus used by realtime to fan out database events, room messages and presence between server instances.
Package pubsub is the cross-instance message bus used by realtime to fan out database events, room messages and presence between server instances.
pubsub/backends
Package backends constructs a pubsub.Broker from configuration.
Package backends constructs a pubsub.Broker from configuration.
pubsub/internal/fanout
Package fanout is the local delivery engine shared by the pubsub brokers.
Package fanout is the local delivery engine shared by the pubsub brokers.
pubsub/memory
Package memory is the in-process pubsub.Broker used for single-instance deployments, development and tests.
Package memory is the in-process pubsub.Broker used for single-instance deployments, development and tests.
pubsub/postgres
Package postgres implements pubsub.Broker on PostgreSQL LISTEN/NOTIFY, so a horizontally scaled deployment that already uses Postgres for documents needs no extra infrastructure.
Package postgres implements pubsub.Broker on PostgreSQL LISTEN/NOTIFY, so a horizontally scaled deployment that already uses Postgres for documents needs no extra infrastructure.
pubsub/pubsubtest
Package pubsubtest is the conformance suite every pubsub.Broker implementation must pass.
Package pubsubtest is the conformance suite every pubsub.Broker implementation must pass.
pubsub/redis
Package redis implements pubsub.Broker on Redis (or Valkey, ElastiCache, Memorystore) PUBLISH/SUBSCRIBE.
Package redis implements pubsub.Broker on Redis (or Valkey, ElastiCache, Memorystore) PUBLISH/SUBSCRIBE.
ratelimit
Package ratelimit implements Backyard's per-instance request limits (SPEC §11): token buckets per category and key, and a daily budget of AI tokens.
Package ratelimit implements Backyard's per-instance request limits (SPEC §11): token buckets per category and key, and a daily budget of AI tokens.
realtime
Package realtime implements the per-site websocket hub described in docs/spec/SPEC.md §6: database change subscriptions, rooms with broadcast/direct messages and presence, fanned out across instances through a pubsub.Broker.
Package realtime implements the per-site websocket hub described in docs/spec/SPEC.md §6: database change subscriptions, rooms with broadcast/direct messages and presence, fanned out across instances through a pubsub.Broker.
server
Package server is Backyard's HTTP layer (SPEC §2–§6): host/path routing, static site serving, the site API (identity, db, files, ai, warehouse, websocket), the hub (UI, docs, llms.txt, site list, tokens), the embedded deploy gateway mount, health checks, rate limiting and metrics.
Package server is Backyard's HTTP layer (SPEC §2–§6): host/path routing, static site serving, the site API (identity, db, files, ai, warehouse, websocket), the hub (UI, docs, llms.txt, site list, tokens), the embedded deploy gateway mount, health checks, rate limiting and metrics.
server/servertest
Package servertest holds end-to-end tests that run the HTTP server against real components: the filesystem blob store, the SQLite (and, when BACKYARD_TEST_POSTGRES_DSN is set, PostgreSQL) document store, the realtime hub over in-memory (and, when BACKYARD_TEST_REDIS_URL is set, Redis) pub/sub, the auth package in mode "none" and the embedded deploy gateway.
Package servertest holds end-to-end tests that run the HTTP server against real components: the filesystem blob store, the SQLite (and, when BACKYARD_TEST_POSTGRES_DSN is set, PostgreSQL) document store, the realtime hub over in-memory (and, when BACKYARD_TEST_REDIS_URL is set, Redis) pub/sub, the auth package in mode "none" and the embedded deploy gateway.
sites
Package sites owns site naming, metadata and manifests stored in the blob store (SPEC §7.2, §9).
Package sites owns site naming, metadata and manifests stored in the blob store (SPEC §7.2, §9).
sites/sitestest
Package sitestest provides test helpers for code built on the sites registry and the deploy gateway: an in-memory blob.Store with optional presigned uploads served by an http.Handler.
Package sitestest provides test helpers for code built on the sites registry and the deploy gateway: an in-memory blob.Store with optional presigned uploads served by an http.Handler.
version
Package version holds build information injected with -ldflags.
Package version holds build information injected with -ldflags.
warehouse
Package warehouse provides read-only analytics queries (backyard.warehouse) against BigQuery, Postgres-compatible databases (incl.
Package warehouse provides read-only analytics queries (backyard.warehouse) against BigQuery, Postgres-compatible databases (incl.
warehouse/athena
Package athena implements warehouse.Source for Amazon Athena (Trino SQL) with the AWS SDK for Go v2.
Package athena implements warehouse.Source for Amazon Athena (Trino SQL) with the AWS SDK for Go v2.
warehouse/bigquery
Package bigquery implements warehouse.Source for Google BigQuery (GoogleSQL) with cloud.google.com/go/bigquery.
Package bigquery implements warehouse.Source for Google BigQuery (GoogleSQL) with cloud.google.com/go/bigquery.
warehouse/internal/conv
Package conv holds JSON-friendly value conversions shared by the warehouse sources (sqlsource, bigquery, athena), so every engine renders numbers, decimals, bytes and timestamps the same way (SPEC §5.5).
Package conv holds JSON-friendly value conversions shared by the warehouse sources (sqlsource, bigquery, athena), so every engine renders numbers, decimals, bytes and timestamps the same way (SPEC §5.5).
warehouse/service
Package service implements warehouse.Service on top of the configured sources (SPEC §5.5).
Package service implements warehouse.Service on top of the configured sources (SPEC §5.5).
warehouse/sqlsource
Package sqlsource implements warehouse.Source for PostgreSQL and Postgres-compatible engines (Amazon Redshift, AlloyDB, Aurora, Neon, CockroachDB, …) on a pgx/v5 connection pool.
Package sqlsource implements warehouse.Source for PostgreSQL and Postgres-compatible engines (Amazon Redshift, AlloyDB, Aurora, Neon, CockroachDB, …) on a pgx/v5 connection pool.
scripts
checkconfig command
Command checkconfig validates Backyard server configuration files exactly the way `backyard serve` loads them (strict YAML with ${ENV} expansion, environment overrides, defaults and validation, see internal/config), but without needing the real secrets.
Command checkconfig validates Backyard server configuration files exactly the way `backyard serve` loads them (strict YAML with ${ENV} expansion, environment overrides, defaults and validation, see internal/config), but without needing the real secrets.
mkzip command
Command mkzip writes a zip archive of the given files, each stored at the archive root under its base name.
Command mkzip writes a zip archive of the given files, each stored at the archive root under its base name.
tfrender
Package tfrender renders Backyard's Terraform modules for tests.
Package tfrender renders Backyard's Terraform modules for tests.
Package skills embeds the Backyard agent skill (skills/backyard/**), the single source of truth for agent-facing documentation.
Package skills embeds the Backyard agent skill (skills/backyard/**), the single source of truth for agent-facing documentation.
Package templates renders the files written by `backyard init` (and the MCP tool backyard_init): the starter page(s), .backyard.json, .backyardignore, and the instructions for coding agents — CLAUDE.md plus the embedded Backyard skill for Claude Code, AGENTS.md for Codex and other AGENTS.md-aware agents, a Cursor project rule and GitHub Copilot repository instructions.
Package templates renders the files written by `backyard init` (and the MCP tool backyard_init): the starter page(s), .backyard.json, .backyardignore, and the instructions for coding agents — CLAUDE.md plus the embedded Backyard skill for Claude Code, AGENTS.md for Codex and other AGENTS.md-aware agents, a Cursor project rule and GitHub Copilot repository instructions.
Package web embeds the browser assets: the client SDK (web/sdk/) served at /__backyard/backyard.{js,mjs,d.ts} on every host and the hub UI (web/hub/).
Package web embeds the browser assets: the client SDK (web/sdk/) served at /__backyard/backyard.{js,mjs,d.ts} on every host and the hub UI (web/hub/).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL