[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-82847":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":15,"starSnapshotCount":15,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},82847,"butterbase","butterbase-ai\u002Fbutterbase","butterbase-ai","Open-source backend-as-a-service. Postgres, auth, storage, functions, AI gateway, MCP.",null,"TypeScript",1865,143,86,1,0,54,571,772,282,104.48,"Apache License 2.0",false,"main",[25,26,27,28,29,30,31],"baas","backend-as-a-service","mcp","open-source","postgres","supabase-alternative","typescript","2026-06-12 04:01:39","\u003Cp align=\"center\">\n  \u003Cimg src=\".github\u002Fassets\u002Flogo.png\" alt=\"Butterbase\" width=\"420\" \u002F>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\u003Cstrong>AI-native, open-source backend-as-a-service.\u003C\u002Fstrong>\u003Cbr\u002F>Postgres · Auth · Storage · Functions · AI Gateway · MCP server\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\".\u002FLICENSE\">\u003Cimg alt=\"License: Apache 2.0\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-blue.svg\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase\u002Fstargazers\">\u003Cimg alt=\"GitHub stars\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fbutterbase-ai\u002Fbutterbase?style=social\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase\u002Fnetwork\u002Fmembers\">\u003Cimg alt=\"GitHub forks\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fforks\u002Fbutterbase-ai\u002Fbutterbase?style=social\">\u003C\u002Fa>\n  \u003Cbr\u002F>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase\u002Fissues\">\u003Cimg alt=\"GitHub issues\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fbutterbase-ai\u002Fbutterbase\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase\u002Fcommits\u002Fmain\">\u003Cimg alt=\"Last commit\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flast-commit\u002Fbutterbase-ai\u002Fbutterbase\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase\u002Freleases\">\u003Cimg alt=\"Release\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Fbutterbase-ai\u002Fbutterbase?include_prereleases&sort=semver\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FeZ7PT68uP\">\u003Cimg alt=\"Discord\" src=\"https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1495105159469207702?logo=discord&logoColor=white&label=Discord&color=5865F2\">\u003C\u002Fa>\n  \u003Cimg alt=\"TypeScript\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTypeScript-3178C6?logo=typescript&logoColor=white\">\n  \u003Cimg alt=\"Postgres\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPostgres-336791?logo=postgresql&logoColor=white\">\n  \u003Cimg alt=\"Docker\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocker-2496ED?logo=docker&logoColor=white\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fbutterbase.ai\">\u003Cstrong>Website\u003C\u002Fstrong>\u003C\u002Fa> ·\n  \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FeZ7PT68uP\">\u003Cstrong>Discord\u003C\u002Fstrong>\u003C\u002Fa> ·\n  \u003Ca href=\".\u002FSETUP.md\">\u003Cstrong>Self-host\u003C\u002Fstrong>\u003C\u002Fa> ·\n  \u003Ca href=\".\u002Fdocs\">\u003Cstrong>Docs\u003C\u002Fstrong>\u003C\u002Fa> ·\n  \u003Ca href=\".\u002FROADMAP.md\">\u003Cstrong>Roadmap\u003C\u002Fstrong>\u003C\u002Fa> ·\n  \u003Ca href=\".\u002FExamples\">\u003Cstrong>Examples\u003C\u002Fstrong>\u003C\u002Fa> ·\n  \u003Ca href=\".\u002FCONTRIBUTING.md\">\u003Cstrong>Contributing\u003C\u002Fstrong>\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n\u003C!-- Drop a demo gif at .github\u002Fassets\u002Fdemo.gif and uncomment:\n\u003Cp align=\"center\">\u003Cimg src=\".github\u002Fassets\u002Fdemo.gif\" alt=\"Butterbase demo\" width=\"720\" \u002F>\u003C\u002Fp>\n-->\n\nButterbase gives you the building blocks for AI-driven applications without lock-in: a Postgres-backed backend with row-level security, serverless functions, an LLM gateway, realtime subscriptions, key-value store, file storage, RAG, durable per-key actors, and a built-in **Model Context Protocol (MCP) server** so agents can operate your backend with tools instead of glue code.\n\n## Features\n\n**Data**\n- **Postgres data plane** — per-app databases with declarative schema (`\u002Fschema`), automatic REST endpoints (`\u002Fauto-api`), and migrations.\n- **Row-Level Security** — first-class RLS policy management with user-isolation helpers (`\u002Frls`).\n- **Key-Value store** — regional, quota-protected KV with TTL, audit trail, and dashboard expose rules (`\u002Fv1\u002F:app\u002Fkv\u002F*`). *New in v0.2.0.*\n- **File storage** — S3\u002FR2-backed object storage with presigned URLs, ACLs, and async indexing (`\u002Fstorage`).\n\n**Compute**\n- **Serverless functions** — TypeScript functions executed on the Deno runtime (`\u002Ffunctions`).\n- **Durable Objects** — stateful per-key actors for chat rooms, multiplayer, rate limiters, long-running agents (`\u002Fdurable-objects`).\n- **Realtime** — WebSocket subscriptions to table changes for live UIs and presence (`\u002Frealtime`).\n- **Edge SSR** — deploy Next.js \u002F Remix \u002F Astro edge handlers from source (`\u002Fedge-ssr`, `\u002Fedge-ssr-from-source`).\n- **Frontend hosting** — zip or build-from-source static \u002F SPA deploys with custom domains (`\u002Ffrontend`, `\u002Fcustom-domains`).\n\n**AI**\n- **AI gateway** — single endpoint for chat, embeddings, model listing; pluggable router adapters (`\u002Fgateway`, `\u002Fai-config`).\n- **RAG** — managed collections, document ingestion, semantic search and synthesized answers (`\u002Frag`).\n- **Integrations** — third-party tool access via Composio (`\u002Fintegrations`).\n\n**Identity & ops**\n- **Auth** — email + OAuth (Google, GitHub, Apple, X, …), JWT tuning, post-login hooks, service keys (`\u002Fauth`, `\u002Foauth-config`, `\u002Fapi-keys`).\n- **Audit logs** — structured request audit trail across KV and other surfaces (`\u002Faudit-logs`).\n- **Webhooks** — outbound webhooks for app events (`\u002Fwebhooks`).\n- **Multi-region app moves** — relocate an app across regions with retained source replicas (`scripts\u002Fmove-app\u002F`).\n\n**Agent surface**\n- **MCP server** — every capability above is exposed as MCP tools at `\u002Fmcp` (HTTP) or via stdio (`@butterbase\u002Fmcp` — `npx @butterbase\u002Fmcp`).\n- **Claude Code plugin** — `packages\u002Fplugin` (submodule of [butterbase-skills](https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase-skills)) ships 30+ guided skills (idea → plan → schema → auth → functions → deploy → submit) for agentic app building.\n\n## Open-source vs. managed\n\nThis repo ships the **runtime data plane** — everything required to self-host a fully featured Butterbase instance. The **managed offering** at [butterbase.ai](https:\u002F\u002Fbutterbase.ai) adds multi-region orchestration, billing, upstream AI router adapters, lease-based quota enforcement, and ops dashboards (those live in a private repo that consumes this one as a submodule).\n\nWhen you self-host, the AI gateway runs without upstream router adapters, billing uses a no-op provider, and quotas are unlimited. Wire your own implementations via the `BillingProvider`, `QuotaEnforcer`, and `RouterAdapter` interfaces in `packages\u002Fshared`.\n\n## Quickstart (self-host)\n\n**Requirements:** Docker, Node 22+, npm.\n\n### 1. Clone (with submodules)\n\nThe Claude Code plugin containing skills (`packages\u002Fplugin`) is a git submodule ([butterbase-skills](https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase-skills)). A plain clone leaves `packages\u002Fplugin\u002F` empty and `npm install` silently skips that workspace.\n\n```bash\ngit clone --recurse-submodules https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase.git\ncd butterbase\n```\n\nIf you already cloned without submodules:\n\n```bash\ngit submodule update --init --recursive\n```\n\nOptional — keep submodules updated on every pull:\n\n```bash\ngit config --global submodule.recurse true\n```\n\n### 2. Install dependencies and configure env\n\n```bash\nnpm ci\ncp .env.example .env\n```\n\n`docker-compose.local.yml` sets `KV_REDIS_URL_US_EAST_1` for you. Edit `.env` only if you override defaults (e.g. run control-api on the host — use `redis:\u002F\u002Flocalhost:6379`).\n\n### 3. Start the stack\n\nFirst run builds images and can take several minutes.\n\n```bash\ndocker compose -f docker-compose.local.yml up -d\n```\n\nWait until control-api is healthy:\n\n```bash\ncurl -sf http:\u002F\u002Flocalhost:4000\u002Fhealth\u002Fready\n```\n\n### 4. Run database migrations\n\nSchema is **not** applied automatically on container start. From the repo root (with the stack running):\n\n```bash\nexport NEON_PLATFORM_PRIMARY_URL=postgresql:\u002F\u002Fbutterbase:butterbase_dev@localhost:5433\u002Fbutterbase_control\nexport NEON_RUNTIME_PROJECT_ID_US_EAST_1=postgresql:\u002F\u002Fbutterbase:butterbase_dev@localhost:5437\u002Fbutterbase_runtime_us\nexport BUTTERBASE_REGIONS=us-east-1\n\nnpm run migrate:all\n```\n\n### 5. Seed the local dev user\n\nWith `AUTH_ENABLED=false`, the API uses `DEV_OWNER_ID` from compose. That user must exist in `platform_users` (fresh volumes start empty):\n\n```bash\nexport NEON_PLATFORM_PRIMARY_URL=postgresql:\u002F\u002Fbutterbase:butterbase_dev@localhost:5433\u002Fbutterbase_control\nnpm run seed:dev\n```\n\n### 6. Smoke test\n\nAuth is disabled in the local compose profile (`AUTH_ENABLED=false`):\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:4000\u002Finit \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"name\": \"my-app\"}'\n\ncurl http:\u002F\u002Flocalhost:4000\u002Fapps\n```\n\n### Local endpoints\n\n| Service | URL \u002F port |\n|---------|------------|\n| Control API | http:\u002F\u002Flocalhost:4000 |\n| MCP (HTTP, via control-api) | http:\u002F\u002Flocalhost:4000\u002Fmcp |\n| Deno runtime | http:\u002F\u002Flocalhost:7133 |\n| Docs site | http:\u002F\u002Flocalhost:4321 |\n| Control plane Postgres | `localhost:5433` |\n| Data plane Postgres | `localhost:5435` |\n| Runtime plane Postgres | `localhost:5437` |\n| LocalStack (S3) | http:\u002F\u002Flocalhost:4566 |\n\nFull setup (auth, MCP clients, troubleshooting, production notes): **[`SETUP.md`](.\u002FSETUP.md)**.\n\n## Architecture\n\n```\n              ┌──────────────────────────────────────────┐\n              │    Your app · agent · MCP client · CLI   │\n              └──────────────────────┬───────────────────┘\n                                     │  REST · WebSocket · MCP\n              ┌──────────────────────▼───────────────────┐\n              │            control-api (Fastify)         │\n              │   apps · auth · schema · auto-api · RLS  │\n              │   storage · functions · KV · realtime    │\n              │   AI gateway · RAG · DOs · MCP at \u002Fmcp   │\n              └──┬──────┬───────┬───────┬────────┬───────┘\n                 │      │       │       │        │\n        ┌────────▼─┐ ┌──▼───┐ ┌─▼──┐ ┌──▼─────┐ ┌▼─────────────┐\n        │ Postgres │ │ S3 \u002F │ │Redis│ │ Deno   │ │ Python agent │\n        │ 3 planes │ │ R2   │ │ KV  │ │runtime │ │   runtime    │\n        └──────────┘ └──────┘ └────┘ └────────┘ └──────────────┘\n                                              ┌──────────────────┐\n                                              │ Cloudflare:      │\n                                              │ build-runner ·   │\n                                              │ dispatch-worker  │\n                                              └──────────────────┘\n```\n\n**Three Postgres planes:**\n- **control-plane** (`db\u002Fcontrol-plane\u002F`) — platform metadata: users, apps, billing, audit.\n- **runtime-plane** (`db\u002Fruntime-plane\u002F`) — hot-path runtime tables (KV expose rules, realtime channels, sessions).\n- **data-plane** (`db\u002Fdata-plane\u002F`) — per-app user data; each app gets isolated schemas with RLS.\n\n## Repo layout\n\n**Services** (`services\u002F`)\n\n| Service | Language | What it does |\n|---|---|---|\n| `control-api` | Node.js \u002F Fastify | Main entry point. All public APIs, embeds MCP at `\u002Fmcp`. |\n| `mcp-server` | Node.js | MCP tool implementations (built into control-api; also ships as `butterbase-mcp` stdio binary). |\n| `deno-runtime` | Deno | Executes user serverless functions in isolates. |\n| `agent-runtime` | Python (uv) | Long-running agent executor for `manage_ai` \u002F agent tasks. |\n| `build-runner` | Cloudflare Worker | Builds frontends and edge-SSR bundles from source. |\n| `storage-indexer` | Node.js | Async indexer for uploaded objects. |\n| `docs` | Astro | Public documentation site (also served locally at `:4321`). |\n\n**Packages** (`packages\u002F`)\n\n| Package | Description |\n|---|---|\n| `@butterbase\u002Fsdk` | Universal TypeScript SDK (browser + server). |\n| `@butterbase\u002Fcli` | `butterbase` CLI for scaffolding and backend management. |\n| `@butterbase\u002Fplugin` | Claude Code plugin — 30+ guided skills for AI-driven app building. Git submodule of [butterbase-skills](https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase-skills). |\n| `@butterbase\u002Fshared` | Shared types, constants, and pluggable interfaces (`BillingProvider`, `QuotaEnforcer`, `RouterAdapter`). |\n\n**Other top-level pieces**\n- `dispatch-worker\u002F` — Cloudflare Worker that routes per-app subdomain traffic.\n- `bb-placeholder\u002F` — placeholder origin for unprovisioned subdomains.\n- `infra\u002F` — `pgbouncer` and `traefik` configs for self-host.\n- `db\u002F` — SQL migrations for the three Postgres planes.\n- `Examples\u002F` — `todo-2026-04-02`, `grocery-list-2026-04-03`.\n\n## What's *not* in this repo\n\nThe OSS \u002F managed boundary is intentional. The following are private to the managed offering:\n\n- Multi-region orchestration and the cross-region scheduler.\n- Billing logic, lease-based quota math, and Stripe wire-up beyond the no-op provider.\n- Upstream AI router adapters (OpenAI \u002F Anthropic \u002F Bedrock provider integrations beyond the gateway interface).\n- Customer \u002F admin dashboards, hackathon-host dashboards, and ops tooling.\n\nIf you need these for self-host, implement against the interfaces in `packages\u002Fshared` — see [`CONTRIBUTING.md`](.\u002FCONTRIBUTING.md) for the scope rules.\n\n## Documentation\n\n- [`SETUP.md`](.\u002FSETUP.md) — self-host and local development guide\n- [`CHANGELOG.md`](.\u002FCHANGELOG.md) — release notes (latest: **v0.2.0**, 2026-05-25 — KV store)\n- [`ROADMAP.md`](.\u002FROADMAP.md) — what's next\n- [`CONTRIBUTING.md`](.\u002FCONTRIBUTING.md) — contributor workflow and OSS scope\n- [`SUBDOMAIN_IMPLEMENTATION.md`](.\u002FSUBDOMAIN_IMPLEMENTATION.md) — tenant subdomain routing\n- [`docs\u002Frunbooks\u002Flocal-e2e.md`](.\u002Fdocs\u002Frunbooks\u002Flocal-e2e.md) — multi-region E2E stack\n- [`docs\u002Frunbooks`](.\u002Fdocs\u002Frunbooks) — operational runbooks\n- [`Examples\u002F`](.\u002FExamples) — example apps (todo, grocery list)\n- Docs site (local): `http:\u002F\u002Flocalhost:4321` after `docker compose up`\n\n## Project status\n\nLatest release: **v0.2.0** (2026-05-25) — adds the KV store across SDK \u002F REST \u002F CLI \u002F MCP. The data plane is production-tested by the managed offering; the OSS distribution is young — please file self-host issues and we'll tighten docs and defaults from feedback. See [`CHANGELOG.md`](.\u002FCHANGELOG.md) for the full history.\n\n## Community & support\n\n- **[Discord](https:\u002F\u002Fdiscord.gg\u002FeZ7PT68uP)** — chat with the team and other builders\n- **[GitHub Issues](https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase\u002Fissues)** — bug reports, feature requests\n- **Email** — [yuki@butterbase.ai](mailto:yuki@butterbase.ai) for direct contact\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](.\u002FCONTRIBUTING.md). The boundary between OSS and the managed offering is intentional — please read the scope section before opening a PR that touches billing, quota math, or upstream router adapters.\n\n## Security\n\nSee [`SECURITY.md`](.\u002FSECURITY.md). Report vulnerabilities to `security@butterbase.ai`.\n\n## License\n\n[Apache-2.0](.\u002FLICENSE). Copyright 2026 NetGPT Inc.\n\n## Contributors\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fbutterbase-ai\u002Fbutterbase\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src=\"https:\u002F\u002Fcontrib.rocks\u002Fimage?repo=butterbase-ai\u002Fbutterbase\" alt=\"Contributors\" \u002F>\n\u003C\u002Fa>\n\n## Star history\n\n\u003Ca href=\"https:\u002F\u002Fwww.star-history.com\u002F#butterbase-ai\u002Fbutterbase&Date\">\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=butterbase-ai\u002Fbutterbase&type=Date&theme=dark\" \u002F>\n    \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=butterbase-ai\u002Fbutterbase&type=Date\" \u002F>\n    \u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=butterbase-ai\u002Fbutterbase&type=Date\" \u002F>\n  \u003C\u002Fpicture>\n\u003C\u002Fa>","Butterbase 是一个开源的后端即服务（BaaS）平台，专为构建AI驱动的应用程序而设计。它提供了基于Postgres的数据存储、认证、文件存储、无服务器函数以及AI网关等功能，并且支持模型上下文协议（MCP）服务器，使得后端能够以工具而非粘合代码的方式被操作。该平台采用TypeScript编写，具有强大的数据管理和安全性功能，如行级安全性和自动REST API生成等特性。适用于需要快速开发和部署现代化Web应用或AI项目的场景，尤其是那些希望避免供应商锁定同时寻求高效后端解决方案的开发者。",2,"2026-06-11 04:09:25","CREATED_QUERY"]