Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ body:
attributes:
value: |
Found a security issue? Do not file it here - see
[SECURITY.md](https://github.com/cloudflarebase/cloudflarebase/blob/main/SECURITY.md).
[SECURITY.md](https://github.com/frostbase-dev/frostbase/blob/main/SECURITY.md).

- type: textarea
id: what-happened
Expand Down Expand Up @@ -35,7 +35,7 @@ body:
options:
- Local development (npm run dev)
- Self-hosted deployment on my own Cloudflare account
- The hosted demo at cloudflarebase.com
- The hosted demo at frostbase.dev
- Playwright e2e suite
validations:
required: true
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Security vulnerability
url: https://github.com/cloudflarebase/cloudflarebase/security/advisories/new
url: https://github.com/frostbase-dev/frostbase/security/advisories/new
about: Report privately. Please do not open a public issue.
- name: Questions and ideas
url: https://github.com/cloudflarebase/cloudflarebase/discussions
url: https://github.com/frostbase-dev/frostbase/discussions
about: For usage questions and open-ended discussion.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Feature request
description: Suggest something Cloudflarebase should do
description: Suggest something Frostbase should do
labels: ['enhancement']
body:
- type: textarea
Expand All @@ -8,7 +8,7 @@ body:
label: What are you trying to do
description: >
Describe the problem rather than the solution. What are you building,
and where does Cloudflarebase get in the way?
and where does Frostbase get in the way?
validations:
required: true

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ If applicable:
agent; never hand-edit `src/migrations.ts`)
- [ ] Binding change has regenerated types (`npm run cf-typegen`,
`npx wrangler types`)
- [ ] New agent route declared in that agent's `cloudflarebase.agent.json` -
- [ ] New agent route declared in that agent's `frostbase.agent.json` -
the console guard is generated from it, and undeclared routes are
operator-only
- [ ] Caught errors that become an error response also
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auth-agent-deploy-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:
workingDirectory: 'agents/auth'
packageManager: npm
# The top level of wrangler.jsonc is the self-hosted default now;
# cloudflarebase.com's own configuration lives in env.production,
# frostbase.dev's own configuration lives in env.production,
# which pins the Worker name back to `auth-agent`.
environment: production
2 changes: 1 addition & 1 deletion .github/workflows/db-agent-deploy-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:
workingDirectory: 'agents/db'
packageManager: npm
# The top level of wrangler.jsonc is the self-hosted default;
# cloudflarebase.com's own configuration lives in env.production,
# frostbase.dev's own configuration lives in env.production,
# which pins the Worker name back to `db-agent`.
environment: production
60 changes: 0 additions & 60 deletions .github/workflows/hosting-agent-deploy-preview.yaml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/hosting-agent-deploy-prod.yaml

This file was deleted.

10 changes: 1 addition & 9 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,7 @@ jobs:
run: npm run test:unit
working-directory: agents/storage

- name: Typecheck the hosting agent
run: npx tsc --noEmit
working-directory: agents/hosting

- name: Unit-test the hosting agent
run: npm run test:unit
working-directory: agents/hosting

# The CLI is a fifth npm project; the root install does not cover it.
# The CLI is a fourth npm project; the root install does not cover it.
- name: Install CLI dependencies
run: npm ci
working-directory: cli
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ name: Release
# for an approval click.
#
# Tags remain the manual escape hatch: pushing auth-v1.2.3, db-v1.2.3,
# storage-v1.2.3, hosting-v1.2.3, or cli-v1.2.3 publishes that one package,
# storage-v1.2.3, or cli-v1.2.3 publishes that one package,
# refusing a tag whose version does not match the package.json it points at.
#
# Publishing uses npm trusted publishing (OIDC): npmjs.com is configured to
# accept publishes from exactly this repository, this workflow file, and the
# `release` environment - no npm token exists anywhere, so there is nothing to
# steal or rotate. After this repository's supply-chain incident, that is the
# point. One-time setup per package on npmjs.com (package settings → Trusted
# Publisher): repository cloudflarebase/cloudflarebase, workflow release.yaml,
# Publisher): repository frostbase-dev/frostbase, workflow release.yaml,
# environment release. If npm will not accept a trusted publisher for a
# package that has never been published, publish the first version locally
# with `npm publish` and configure it after.
Expand All @@ -38,7 +38,6 @@ on:
- 'auth-v*.*.*'
- 'db-v*.*.*'
- 'storage-v*.*.*'
- 'hosting-v*.*.*'
- 'cli-v*.*.*'

permissions:
Expand Down Expand Up @@ -66,11 +65,10 @@ jobs:
node <<'EOF' >> "$GITHUB_OUTPUT"
const { execSync } = require('child_process');
const packages = [
{ name: '@cloudflarebase/auth', dir: 'agents/auth', prefix: 'auth-v' },
{ name: '@cloudflarebase/db', dir: 'agents/db', prefix: 'db-v' },
{ name: '@cloudflarebase/storage', dir: 'agents/storage', prefix: 'storage-v' },
{ name: '@cloudflarebase/hosting', dir: 'agents/hosting', prefix: 'hosting-v' },
{ name: '@cloudflarebase/cli', dir: 'cli', prefix: 'cli-v' },
{ name: '@frostbase/auth', dir: 'agents/auth', prefix: 'auth-v' },
{ name: '@frostbase/db', dir: 'agents/db', prefix: 'db-v' },
{ name: '@frostbase/storage', dir: 'agents/storage', prefix: 'storage-v' },
{ name: '@frostbase/cli', dir: 'cli', prefix: 'cli-v' },
];
const refType = process.env.GITHUB_REF_TYPE;
const refName = process.env.GITHUB_REF_NAME;
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/storage-agent-deploy-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
workingDirectory: 'agents/storage'
packageManager: npm
# The top level of wrangler.jsonc is the self-hosted default (no
# BUCKET binding at all); cloudflarebase.com's own configuration
# BUCKET binding at all); frostbase.dev's own configuration
# lives in env.production, which pins the Worker name back to
# `storage-agent` and declares the shared R2 bucket. This deploy
# needs the auth worker to exist first for its AUTH_AGENT service
Expand Down
7 changes: 0 additions & 7 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,24 @@
src/lib/components/ui/
agents/auth/drizzle/meta/
agents/db/drizzle/meta/
agents/hosting/drizzle/meta/
agents/storage/drizzle/meta/
# Regenerated by drizzle-kit; formatting it here is undone on the next generate.
agents/auth/drizzle/migrations.js
agents/db/drizzle/migrations.js
agents/hosting/drizzle/migrations.js
agents/storage/drizzle/migrations.js
**/worker-configuration.d.ts
AGENTS.md
agents/auth/AGENTS.md
agents/db/AGENTS.md
agents/hosting/AGENTS.md
agents/storage/AGENTS.md
**/package-lock.json
agents/auth/.prettierrc
agents/db/.prettierrc
agents/hosting/.prettierrc
agents/storage/.prettierrc

# Publish build output for the published packages.
agents/auth/dist/
agents/db/dist/
agents/hosting/dist/
agents/storage/dist/
cli/dist/

Expand All @@ -36,8 +31,6 @@ agents/auth/LICENSE
agents/auth/NOTICE
agents/db/LICENSE
agents/db/NOTICE
agents/hosting/LICENSE
agents/hosting/NOTICE
agents/storage/LICENSE
agents/storage/NOTICE
cli/LICENSE
Expand Down
31 changes: 20 additions & 11 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cloudflarebase
# Frostbase

The open-source Firebase alternative on Cloudflare. Every project gets its own
Durable Objects, so one tenant's data is physically separate from the next —
Expand All @@ -9,24 +9,23 @@ that only matter inside it. Read that one before changing an agent.

## Repository shape

Six separate npm projects, separate Wrangler configs, separate generated `Env`
Five separate npm projects, separate Wrangler configs, separate generated `Env`
types.

| Path | Worker | Durable Objects |
| ---------------- | --------------- | -------------------------------------------------- |
| `/` | `cloudflarebase` | none — SvelteKit console + marketing, D1 registry |
| `/` | `frostbase` | none — SvelteKit console + marketing, D1 registry |
| `agents/auth` | `auth-agent` | `AuthAgent` |
| `agents/db` | `db-agent` | `DbAgent` `DbCollection` `DbTable` `DbGateway` `DbView` |
| `agents/storage` | `storage-agent` | `StorageAgent` `StorageBucket` |
| `agents/hosting` | `hosting-agent` | `HostingAgent` (+ an outbound worker) |
| `cli` | none | `@cloudflarebase/cli`, runs on a consumer's machine |
| `cli` | none | `@frostbase/cli`, runs on a consumer's machine |

**Never import runtime code or generated Worker types across those
boundaries.** Shared DTOs are deliberately copied — `src/lib/agents.ts` mirrors
the agents' exported types, and `agents/storage/src/access.ts` is a copy of the
db agent's gate. Change one side, change the other in the same commit.

The one exception is `cloudflarebase.agent.json`: the app imports each manifest
The one exception is `frostbase.agent.json`: the app imports each manifest
**directly** from `agents/<name>/`, because the console guard is generated from
its `routes` block and a stale copy would silently open or close the wrong
surface. The CLI keeps its own schema copy and reads manifests from the
Expand All @@ -38,7 +37,7 @@ project's Durable Objects.

## The agent contract

Each agent package ships a `cloudflarebase.agent.json` declaring what it is and
Each agent package ships a `frostbase.agent.json` declaring what it is and
what the platform must do to host it: worker name, DO classes and their scope,
bindings, secrets, vars, the route table, the console proxy prefix, permission
keys, and its sidebar pages.
Expand Down Expand Up @@ -79,22 +78,22 @@ should be open — a loud, testable failure — never open something that should
closed. The refusal is the ordinary 404 byte for byte, so a closed surface is
not enumerable.

Service keys (`cfbs_`) are an **authentication** change, not an authorization
Service keys (`fsb_`, legacy `cfbs_`) are an **authentication** change, not an authorization
one: they are verified in the console guard and travel to the agent over a
service binding the console already authorized. No agent ever sees the bearer.

## Commands

```bash
npm run dev # auth :8788, db :8789, hosting :8790, storage :8791, web :5173
npm run dev # auth :8788, db :8789, storage :8791, web :5173
npm run check # svelte-check
npm run lint # prettier + eslint
npm test # full Playwright suite against real workerd
```

All three checks run in CI and all three must pass. The e2e suite boots a
production-mirroring stack — the built SvelteKit worker on `:8797` plus the four
agents on `:8798`–`:8801`, real service bindings, real DO SQLite. It is the
production-mirroring stack — the built SvelteKit worker on `:8797` plus the three
agents on `:8798`, `:8799` and `:8801`, real service bindings, real DO SQLite. It is the
check that actually catches things.

Each agent is its own TypeScript project with its own unit tests:
Expand Down Expand Up @@ -140,6 +139,16 @@ cd agents/db && npx tsc --noEmit && npm run test:unit

These are expensive to rediscover.

- **`cloudflarebase` survives in names that hold state, on purpose.** The
project was Cloudflarebase until October 2026. D1 database names
(`cloudflarebase-control-plane*`), Analytics Engine datasets
(`cloudflarebase_*_events`) and the JWT issuer
(`cloudflarebase:<project>`) keep the old spelling,
because renaming them orphans data or invalidates live tokens. Legacy
inputs are still accepted: `cfbs_` service keys, `CLOUDFLAREBASE_*` env
vars, `cloudflarebase.json`, `~/.cloudflarebase`. cloudflarebase.com stays
attached to the console: pages 301 to frostbase.dev, the API keeps
answering.
- **Durable Object SQLite refuses `pragma_table_info()`** (SQLITE_AUTH) and
explicit transactions. The applied schema is *our* record, never
introspection.
Expand Down
Loading
Loading