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 agents/db/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions agents/db/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
{
"name": "@frostbase-dev/db",
"version": "0.7.0",
"version": "0.7.1",
"description": "Documents with live queries and schema-first SQL tables on Cloudflare Durable Objects, one isolated instance per collection or table - the database primitive behind Frostbase.",
"license": "Apache-2.0",
"type": "module",
Expand Down
43 changes: 23 additions & 20 deletions src/routes/(marketing)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@
class="mt-6 flex flex-wrap items-center justify-center gap-x-5 gap-y-1.5 font-mono text-xs text-muted-foreground/70"
>
<span class="flex items-center gap-1.5">
<Star class="h-3.5 w-3.5 text-primary" /> 231 stars on GitHub
<Star class="h-3.5 w-3.5 text-primary" /> 233 stars on GitHub
</span>
<span class="flex items-center gap-1.5">
<GitFork class="h-3.5 w-3.5" /> 10 forks
<GitFork class="h-3.5 w-3.5" /> 17 forks
</span>
<span class="flex items-center gap-1.5">
<Boxes class="h-3.5 w-3.5" /> 900+ demo backends created
Expand Down Expand Up @@ -788,8 +788,9 @@

<!-- INSTALL: the CLI one-liner and its agent-shaped twin, Deno-style.
The boxes stay zinc-950 in both themes, matching every other
terminal block on this page. -->
<section id="install" class="px-4 pb-16 sm:px-8 md:pb-28">
terminal block on this page. This is the card band that heads the
card/white alternation; every band below flips accordingly. -->
<section id="install" class="border-y border-border bg-card px-4 py-16 sm:px-8 sm:py-24">
<div class="mx-auto max-w-3xl">
<div class="text-center">
<span
Expand Down Expand Up @@ -831,7 +832,7 @@

<div class="mt-6 overflow-hidden rounded-xl border border-border">
<div
class="flex flex-wrap items-center gap-x-2 gap-y-0.5 border-b border-border bg-card px-5 py-2.5 font-mono text-xs text-muted-foreground"
class="flex flex-wrap items-center gap-x-2 gap-y-0.5 border-b border-border bg-background/60 px-5 py-2.5 font-mono text-xs text-muted-foreground"
>
{#each agentNames as name (name)}
<span>{name}</span>
Expand Down Expand Up @@ -869,8 +870,9 @@
</section>

<!-- PRICING: the real /pricing calculator, embedded - straight above
the API section on purpose, with /pricing's own hero copy. -->
<section id="pricing" class="border-y border-border bg-card px-4 py-16 sm:px-8 sm:py-24">
the API section on purpose, with /pricing's own hero copy.
White band, now that the install card band sits above it. -->
<section id="pricing" class="px-4 py-16 sm:px-8 sm:py-24">
<div class="mx-auto max-w-6xl">
<div class="mb-10 max-w-3xl">
<span
Expand All @@ -895,8 +897,8 @@
</div>
</section>

<!-- COMPARE -->
<section id="compare" class="px-4 py-16 sm:px-8 sm:py-24">
<!-- COMPARE (card band) -->
<section id="compare" class="border-y border-border bg-card px-4 py-16 sm:px-8 sm:py-24">
<div class="mx-auto max-w-6xl">
<div class="mb-10 max-w-xl">
<span
Expand Down Expand Up @@ -964,8 +966,8 @@
</div>
</section>

<!-- API -->
<section id="api" class="border-y border-border bg-card px-4 py-16 sm:px-8 sm:py-24">
<!-- API (white band) -->
<section id="api" class="px-4 py-16 sm:px-8 sm:py-24">
<div class="mx-auto grid max-w-7xl grid-cols-1 items-center gap-14 md:grid-cols-[2fr_3fr]">
<div>
<span
Expand Down Expand Up @@ -1048,9 +1050,9 @@
</div>
</section>

<!-- ARCHITECTURE (white band: keeps the section backgrounds alternating
card/white now that the pricing band sits above the API card) -->
<section id="architecture" class="px-4 py-14 sm:px-8 sm:py-20">
<!-- ARCHITECTURE (card band: keeps the backgrounds alternating
card/white now that the install band heads the rotation) -->
<section id="architecture" class="border-y border-border bg-card px-4 py-14 sm:px-8 sm:py-20">
<div class="mx-auto max-w-6xl">
<div class="mb-10 max-w-xl">
<span
Expand Down Expand Up @@ -1086,8 +1088,8 @@
</div>
</section>

<!-- ROADMAP -->
<section id="roadmap" class="border-y border-border bg-card px-4 py-16 sm:px-8 sm:py-24">
<!-- ROADMAP (white band) -->
<section id="roadmap" class="px-4 py-16 sm:px-8 sm:py-24">
<div class="mx-auto max-w-6xl">
<div class="mb-14 max-w-xl">
<span
Expand Down Expand Up @@ -1135,8 +1137,8 @@
</div>
</section>

<!-- FAQ -->
<section id="faq" class="px-4 py-16 sm:px-8 sm:py-24">
<!-- FAQ (card band) -->
<section id="faq" class="border-y border-border bg-card px-4 py-16 sm:px-8 sm:py-24">
<div class="mx-auto max-w-3xl">
<div class="mb-12 text-center">
<span
Expand Down Expand Up @@ -1169,8 +1171,9 @@
</div>
</section>

<!-- CTA BAND (card band: closes out the alternation after the white FAQ) -->
<section class="border-t border-border bg-card px-4 py-20 text-center sm:px-8 sm:py-28">
<!-- CTA BAND (white band: closes out the alternation after the card FAQ,
whose own bottom border already draws the separation) -->
<section class="px-4 py-20 text-center sm:px-8 sm:py-28">
<span
class="inline-flex items-center gap-2 rounded-full border border-primary/25 bg-primary/10 px-3 py-1.5 text-xs font-medium tracking-wide text-primary uppercase"
>
Expand Down
44 changes: 22 additions & 22 deletions static/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ architecture.

Pick ONE path, then run the Verify step for it.

- **Path A — throwaway demo.** No account, no deploy, ready in seconds.
- **Path A - throwaway demo.** No account, no deploy, ready in seconds.
Best for prototypes, hackathons, and trying the API.
- **Path B — the user's own Cloudflare account.** A real, self-hosted backend.
- **Path B - the user's own Cloudflare account.** A real, self-hosted backend.
Best for production.
- **Path C — a managed console project.** The user already has an account on
- **Path C - a managed console project.** The user already has an account on
frostbase.dev or a self-hosted console.

## Path A — throwaway demo (no account)
## Path A - throwaway demo (no account)

Mint a project id: `demo-` + 12 random lowercase hex characters, generated
with a CSPRNG — the id is the only credential, so it must be unguessable.
with a CSPRNG - the id is the only credential, so it must be unguessable.

```bash
node -e "console.log('demo-'+require('crypto').randomBytes(6).toString('hex'))"
```

The project exists the moment you touch it — there is no create call. Your
The project exists the moment you touch it - there is no create call. Your
base URLs (replace `<id>`):

```
Expand All @@ -35,7 +35,7 @@ OpenAPI https://frostbase.dev/api/projects/<id>/openapi.json
Console https://frostbase.dev/dashboard/<id>
```

Fetch the OpenAPI document first — it is public and describes every endpoint
Fetch the OpenAPI document first - it is public and describes every endpoint
for this exact project. Point the user at the Console URL: it is a full
dashboard for their demo project and updates live as your code writes data.

Expand All @@ -46,7 +46,7 @@ project; graduate to Path B or C instead.
### Verify (Path A)

Collections default to authenticated access, so mint a project token, create
the collection explicitly, then write — anonymous sign-in counts as signing
the collection explicitly, then write - anonymous sign-in counts as signing
in:

```bash
Expand All @@ -65,15 +65,15 @@ curl -s -X POST $BASE/db/collections/posts/documents \
```

Step 4 answers `201` with the document, now visible in the Console URL above.
Create every collection explicitly, as in step 3 — writes also auto-create on
Create every collection explicitly, as in step 3 - writes also auto-create on
first touch, but explicit creation is deterministic and is where access modes
are set. If a write ever answers `503 {"error":"collection is unavailable"}`,
create the collection explicitly and retry the write.

## Path B — the user's own Cloudflare account
## Path B - the user's own Cloudflare account

Requires Node 20+ and a Cloudflare account (the free tier is enough).
`npx wrangler login` opens a browser — have the user run it, or let them set
`npx wrangler login` opens a browser - have the user run it, or let them set
`CLOUDFLARE_API_TOKEN`. Ask before deploying; it creates resources on their
account.

Expand All @@ -93,9 +93,9 @@ Existing Worker project: run `frostbase add <agent>` inside it instead of
`init`. It npm-installs the package, merges the agent's config fragment into
`wrangler.jsonc`, wires the entrypoint, and reruns `wrangler types`. It is
idempotent and never overwrites values the user set. `wrangler.toml` projects
are declined — convert to `wrangler.jsonc` first.
are declined - convert to `wrangler.jsonc` first.

The deployed Worker serves every project id under these bases — pick one id
The deployed Worker serves every project id under these bases - pick one id
(for example the app's name) and use it everywhere; the first request
provisions it:

Expand All @@ -106,7 +106,7 @@ Storage https://<worker>.workers.dev/agents/storage-agent/<project>
```

No secrets are required: each project generates its own signing key. Sign-in
works immediately — the deployment trusts its own origin. Only add
works immediately - the deployment trusts its own origin. Only add
`TRUSTED_ORIGINS` (in `wrangler.jsonc` vars) for *extra* origins, like a
separate domain serving the UI.

Expand All @@ -117,11 +117,11 @@ curl -s https://<worker>.workers.dev/agents/auth-agent/<project>/config
```

JSON config comes back. Operator routes (`/admin/*`, `/overview`) answer 404
on this Worker by design — they are reachable from server code through the
on this Worker by design - they are reachable from server code through the
Durable Object binding, never over public HTTP. Do not set
`EXPOSE_OPERATOR_API` on a Worker with a public hostname.

## Path C — a managed console project
## Path C - a managed console project

```bash
npm install -g @frostbase-dev/cli
Expand All @@ -131,22 +131,22 @@ frostbase key create # server-side service key, shown once
```

Base URLs are the console's, same shapes as Path A with the real project id.
Service keys (`fsb_…`) are admin-grade and server-only: the API refuses any
Service keys (`fsb_...`) are admin-grade and server-only: the API refuses any
request carrying an `Origin` header, so a key leaked into frontend code fails
at the desk, not in production. Put the key in an env var
(`FROSTBASE_SERVICE_KEY`), never in the bundle or the repo.

## Integrate the app

Auth — the stock Better Auth client works as-is:
Auth - the stock Better Auth client works as-is:

```ts
import { createAuthClient } from 'better-auth/client'; // or /react, /svelte
const auth = createAuthClient({ baseURL: '<Auth base URL>' });
await auth.signUp.email({ name, email, password });
```

Database — documents, typed tables, and live queries:
Database - documents, typed tables, and live queries:

```ts
import { createDbClient } from '@frostbase-dev/db/client';
Expand All @@ -163,10 +163,10 @@ posts.subscribe({ orderBy: [{ field: 'votes', direction: 'desc' }], limit: 25 },
{ onSnapshot: (docs) => render(docs) });
```

Storage — `createStorageClient` from `@frostbase-dev/storage/client`, same
Storage - `createStorageClient` from `@frostbase-dev/storage/client`, same
`baseUrl`/`getToken` pattern; `upload()` handles multipart above 100 MB.

Everything is also plain HTTP — no SDK is required. The per-project OpenAPI
Everything is also plain HTTP - no SDK is required. The per-project OpenAPI
document is the complete, machine-readable contract; prefer it over guessing
routes.

Expand All @@ -182,4 +182,4 @@ routes.
- Demo projects are throwaway: unguessable-id access, capped, erased in ~30
days. Say so in your handoff to the user.

Source: https://github.com/frostbase-dev/frostbase · Site: https://frostbase.dev
Source: https://github.com/frostbase-dev/frostbase - Site: https://frostbase.dev
2 changes: 1 addition & 1 deletion static/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Frostbase is agent-first: every backend primitive ships as a versioned npm packa
## Site

- [Home](https://frostbase.dev/): what it is, how it compares to Firebase and Supabase, architecture, and roadmap.
- [agents.md](https://frostbase.dev/agents.md): setup instructions written for coding agents — throwaway demo projects, self-hosted deploys, and managed projects.
- [agents.md](https://frostbase.dev/agents.md): setup instructions written for coding agents - throwaway demo projects, self-hosted deploys, and managed projects.
- [Pricing](https://frostbase.dev/pricing): the same workload priced on Cloudflare, Firebase, and Supabase, with dated sources.
- [Live demo](https://frostbase.dev/dashboard): an ephemeral throwaway project, no sign-up.

Expand Down
Loading