Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nickruigrok/baseflare/llms.txt

Use this file to discover all available pages before exploring further.

Baseflare is an open-source, MIT-licensed backend framework that gives you the developer experience of Convex — typed schema, query/mutation/action functions, deny-by-default permissions, and a document database model — but running entirely on your own Cloudflare account. There is no hosted control plane, no vendor between you and your data, and no per-seat pricing. You define your data model and server functions in TypeScript, deploy to Cloudflare Workers, and consume the generated API from your app without assembling a custom backend stack first.

baseflare/values

Validators (v.string(), v.number(), v.boolean(), etc.), shared RPC types, typed application errors (BaseflareError), pagination helpers, and ID utilities (generateId(), getCreatedAtFromId()). The shared leaf imported by both server and client code.

baseflare/server

Schema definition (defineSchema, defineTable), server function wrappers (query, mutation, action), permissions (defineRules), the HTTP router, query builder, document serialization, and the Worker entry-point factory (createWorker). Everything that runs on Cloudflare Workers.

baseflare/client

Browser and Node.js client SDK — BaseflareClient, WebSocket connection management, subscription state, optimistic updates, and auth methods. Planned — package is scaffolded, implementation in progress.

@baseflare/react

React hooks built on top of the client SDK: useQuery, useMutation, useAction, usePaginatedQuery, BaseflareProvider, and useAuth. Planned — package is scaffolded, implementation in progress.

How Baseflare Compares

Baseflare occupies a unique position: it matches Convex’s developer experience while running on infrastructure you own and control. The table below summarises the key differences across the main alternatives.
BaseflareConvexFirebaseSupabase
RuntimeCF Workers (edge, global)Custom V8 (single region)Google CloudAWS (single region)
DatabaseD1 (SQLite)Custom DBFirestorePostgres
Real-timeDurable Objects + WebSocketBuilt-in sync engineFirestore listenersPostgres LISTEN/NOTIFY
Pricing$0–5/month flat$25/seat/monthUnpredictable$25/month + usage
Self-hosted✅ Yes (your CF account)❌ No❌ No⚠️ Yes (complex)
Open source✅ MIT❌ No❌ No✅ Apache 2.0
Authbetter-auth (any provider)Clerk / Auth0 / ConvexAuthFirebase AuthGoTrue
Permissions✅ Native deny-by-default❌ None built-inSecurity RulesRLS (Postgres)

Current Status

What is implemented today:
  • Full validator suite (baseflare/values) — v.string(), v.number(), v.boolean(), v.id(), v.array(), v.object(), v.union(), v.literal(), v.enum(), v.any(), v.optional(), and more
  • UUIDv7 document IDs with _createdAt derived from the ID at read time
  • Schema definition (defineSchema, defineTable) with index support and schema diffing
  • Server function wrappers — query, mutation, action, internalQuery, internalMutation, internalAction
  • Deny-by-default permissions (defineRules, evaluateRules)
  • Query builder with filter, order, limit, first, unique, take, count, collect, and paginate
  • Document serialization and write-time schema validation
  • HTTP router and HTTP action wrapper
  • Cloudflare D1 runtime foundation — Worker entry-point factory (createWorker) with path-based RPC routing
Planned next:
  • Full CLI workflows: init, local dev, deploy, codegen, and environment management
  • Generated client SDK (baseflare/client)
  • React hooks (@baseflare/react)
  • Auth helpers (better-auth integration via defineAuth)
  • Real-time subscriptions (Durable Objects + WebSocket)
  • Scheduler (ctx.scheduler.runAfter, ctx.scheduler.runAt), storage (R2), and vector search (Vectorize) adapters
  • Local dashboard (npx baseflare dashboard)

Where to Go Next

Quickstart

Install Baseflare, define a todos schema, write a query and a mutation, spin up the Worker, and make your first API calls — in under 15 minutes.

Concepts

Understand the document model, function types, permission system, UUIDv7 IDs, and Cloudflare resource mapping that make up the Baseflare architecture.

Build docs developers (and LLMs) love