Now open-source — deploy your first edge app in 60 seconds

The backend platform
AI coding tools understand

SparrowBase gives Cursor, Windsurf, v0, Lovable, Bolt, and Claude a pre-wired Cloudflare Edge backend with Auth, Database, Storage, AI Search, and Rate Limiting — so they generate production-grade code on the first try, not hallucinated Express.js that crashes at deploy.

0ms
Cold Start Latency
$0
Bandwidth Egress
100K
Free Requests/Day
330+
Edge Locations
# 1. Create a new SparrowBase project $ npx sparrowbase init my-saas-app # 2. Install dependencies $ cd my-saas-app && npm install # 3. Provision free Cloudflare resources $ npx wrangler d1 create sparrowbase-db $ npx wrangler r2 bucket create uploads $ npx wrangler kv namespace create CACHE # 4. Run local development server (Miniflare) $ npm run dev # → Server running at http://localhost:8787 # 5. Deploy to Cloudflare Edge (330+ locations) $ npx wrangler deploy # → Published to https://my-saas-app.workers.dev
// .sparrowbase/CLAUDE.md — Auto-loaded by AI coding agents // This file teaches Cursor, Windsurf, v0, and Claude how to // write 100% compatible Cloudflare Workers code. ## Runtime Constraints - NEVER import Node.js modules: fs, net, tls, http, child_process - NEVER use express, fastify, koa, or next/server - NEVER use bcrypt or jsonwebtoken (native C++ bindings) - ALWAYS use Hono.js for routing - ALWAYS use crypto.subtle (Web Crypto API) for hashing - ALWAYS use Drizzle ORM with D1 for database access ## Available Bindings - DB → D1 SQLite database (via Drizzle ORM) - CACHE → KV key-value store (rate limiting) - UPLOADS → R2 object storage (file uploads) - AI → Workers AI (embeddings, inference) - VECTORIZE→ Vector index (RAG search)
import { createSparrowClient } from '@sparrowbase/client'; // Initialize type-safe client const sparrow = createSparrowClient({ baseUrl: 'https://api.myapp.workers.dev', }); // Authentication const { user, session } = await sparrow.auth.signUp({ email: 'dev@example.com', password: 'securePassword123', }); // Database queries (type-safe) const users = await sparrow.get('/api/users'); // Direct streaming file upload to R2 const { publicUrl } = await sparrow.uploadFile(file, 'user_123'); // AI vector search (RAG) const results = await sparrow.ai.search('edge native databases');
import { Hono } from 'hono'; import { cors } from 'hono/cors'; import { getDb } from './db'; import { rateLimiter } from './middleware/rate-limit'; import { authMiddleware } from './middleware/auth'; const app = new Hono(); // Global middleware app.use('*', cors()); app.use('/api/*', rateLimiter({ limit: 100, window: 60 })); // Health check app.get('/api/health', (c) => c.json({ status: 'healthy' })); // Protected route with auth app.get('/api/users', authMiddleware, async (c) => { const db = getDb(c.env.DB); const users = await db.query.users.findMany(); return c.json({ success: true, data: users }); }); export default app;
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core'; // Multi-tenant user table export const users = sqliteTable('users', { id: text('id').primaryKey(), email: text('email').notNull().unique(), name: text('name'), orgId: text('org_id').references(() => orgs.id), createdAt: integer('created_at', { mode: 'timestamp' }), }); // Organization for multi-tenancy export const orgs = sqliteTable('organizations', { id: text('id').primaryKey(), name: text('name').notNull(), plan: text('plan').default('free'), stripeId: text('stripe_customer_id'), }); // Subscription tracking export const subscriptions = sqliteTable('subscriptions', { id: text('id').primaryKey(), orgId: text('org_id').references(() => orgs.id), status: text('status').default('active'), plan: text('plan').default('free'), });
⚡ Platform Features

Everything you need to ship.
Nothing you don't.

SparrowBase includes Auth, Database, File Storage, AI Search, Rate Limiting, Stripe Billing, and an AI Rules Engine — all pre-configured for Cloudflare's edge runtime.

🧠
AI Rules Engine (.cursorrules + CLAUDE.md)
The secret weapon. SparrowBase embeds machine-readable constraint files into every project. When you open your codebase in Cursor, Windsurf, v0, Lovable, Bolt, or Claude — the AI reads these rules and generates code that is 100% compatible with Cloudflare Workers. No more import express or require('fs') hallucinations. No more broken deploys. The AI just works.
.sparrowbase/CLAUDE.md · .cursorrules · .windsurfrules
🔐
Authentication (Better-Auth)
Email/password, OAuth, and session management using Better-Auth with Web Crypto API. No native Node.js modules — runs natively on Workers. Includes multi-tenant organization memberships out of the box.
crypto.subtle.importKey() → Web Crypto HMAC
🗄️
Database (D1 + Drizzle ORM)
SQLite at the edge with Drizzle ORM. Full type-safe queries, migration support, and multi-tenant schemas. 5 million free reads per day — enough for 150 million queries per month at $0.
const db = drizzle(c.env.DB);
📦
File Storage (R2)
Direct streaming uploads to Cloudflare R2 with zero egress fees. Unlike AWS S3 ($0.09/GB) or Vercel Blob ($0.15/GB), R2 charges $0 for bandwidth — forever. Includes pre-signed URL support and 10GB free storage.
await c.env.UPLOADS.put(key, stream);
🔍
AI Vector Search (Vectorize)
Embed text with Workers AI and query a vector index for semantic search, RAG pipelines, and recommendation engines. Pre-wired with 768-dimension embeddings and cosine similarity.
c.env.VECTORIZE.query(embedding, { topK: 10 })
🛡️
Rate Limiting (KV)
Sliding-window rate limiter backed by Workers KV. Protects your API from abuse with configurable limits per IP, user, or API key. 100,000 free KV reads per day — no external Redis needed.
rateLimiter({ limit: 100, window: 60 })
💳
Stripe Billing (Webhook-Ready)
Pre-configured Stripe webhook handler that validates signatures using ArrayBuffer (not JSON.parse, which breaks Stripe's HMAC). Handles checkout.session.completed, invoice.paid, customer.subscription.deleted, and customer.subscription.updated events. Includes subscription status tracking in D1 and multi-tenant org billing.
const sig = c.req.header('stripe-signature'); // ArrayBuffer body verification
🤖 AI-Native

Works with every AI coding tool

SparrowBase embeds .cursorrules, CLAUDE.md, and .windsurfrules into every project. Open your codebase in any AI tool — it reads the rules and writes correct edge code on the first try.

📊 Compare

SparrowBase vs. the competition

Side-by-side comparison on the dimensions that actually matter: pricing, performance, DX, and AI compatibility.

Dimension 🦜 SparrowBase Supabase Vercel Firebase AWS Lambda Railway
Free Tier (Monthly) ✓ 3M req/mo (100K/day), no expiry 500MB DB, auto-pauses after 1 week inactive 100GB bandwidth/mo, 100K function calls/mo 1GB Firestore, 10GB bandwidth/mo 1M req/mo (12-month trial only) $5 credit/mo (burns fast on CPU)
Bandwidth Egress (per GB) ✓ $0.00/GB — always free, forever $0.09/GB (on S3 storage) $0.15/GB (Hobby) to $0.40/GB (overage) $0.12/GB (Cloud Storage) $0.09/GB (S3) to $0.15/GB (Lambda) $0.10/GB egress
Cold Start Latency ✓ 0ms (V8 Isolates, no boot) 100–500ms (Postgres connection pool) 200–1500ms (Lambda container boot) 300–2000ms (Cloud Functions boot) 200–2000ms (container cold start) 100–800ms (Docker container boot)
AI Rules Engine ✓ Built-in .cursorrules + CLAUDE.md None — AI often hallucinates Prisma None — AI generates Express/Node code None — AI confuses Firestore APIs None — AI generates incompatible SDKs None
Database (Free Tier) ✓ D1 SQLite: 5M reads/day (150M/mo), 100K writes/day PostgreSQL: 500MB storage, pauses if inactive No built-in DB — BYO Neon ($0) or PlanetScale Firestore NoSQL: 1GB storage, 50K reads/day DynamoDB: 25GB storage, 200M req/mo (trial) Postgres: 512MB storage, 1 CPU shared
File Storage (Free Tier) ✓ R2: 10GB storage, $0 egress forever 1GB S3-compatible, $0.09/GB egress Vercel Blob: limited, $0.15/GB egress Cloud Storage: 5GB, $0.12/GB egress S3: 5GB (12-mo trial), $0.09/GB egress Volume storage only, no CDN
Authentication ✓ Better-Auth (Web Crypto, edge-native, pre-wired) GoTrue Auth (built-in, Postgres-backed) No built-in — needs Clerk ($25/mo) or NextAuth Firebase Auth (built-in, Google-backed) Cognito (complex setup, IAM policies) No built-in — BYO solution required
Surprise Bill Protection ✓ Hard daily caps — requests drop, never overage Overage billing — can spike unexpectedly Overage billing — bandwidth surprises common Overage billing — Firestore can spike fast Overage billing — Lambda/S3 surprise bills Credit burns, then overage billing
Global Edge Network ✓ 330+ cities, every continent Single region (or read replicas at extra $) Edge Functions: ~30 regions Multi-region available (extra cost) Per-region deployment (manual) Single region only
Vendor Lock-in ✓ Open-source, MIT license, fully portable Open-source core (self-hostable) Proprietary infrastructure Heavy lock-in (Firebase SDKs) Heavy lock-in (AWS services) Docker-based (portable)
Paid Tier Starting Price ✓ $5/mo (Cloudflare Workers Paid) $25/mo (Supabase Pro) $20/mo (Vercel Pro) Pay-as-you-go (Blaze, no minimum) Pay-as-you-go (no minimum) $5/mo credit, then usage-based

All data sourced from official pricing pages as of July 2025. All "per month" and "per day" units are explicitly labeled. SparrowBase costs = Cloudflare infrastructure costs (SparrowBase itself is free and open-source).

💡 Plain English

What "100K requests/day" actually means

We translated Cloudflare's raw infrastructure limits into real-world daily active user (DAU) workloads — so you know exactly how many users your app can handle for free.

SaaS Dashboard
5 requests per user session
20,000 DAU
Login, load dashboard, 2 data queries, 1 settings update. Your typical B2B SaaS app or admin panel can handle 20,000 daily active users for $0/mo.
CRM Admin Panel Analytics Project Management
E-Commerce / Blog
10 requests per visitor session
10,000 DAU
Homepage, category browse, product pages, cart, and checkout. Your store can handle 10,000 daily shoppers for $0/mo with zero bandwidth charges.
Storefront Blog Media Site Portfolio
Social / Chat App
25 requests per user session
4,000 DAU
Feed scroll, comments, likes, DMs, and real-time updates. Interactive apps can support 4,000 daily active users for $0/mo.
Social Feed Chat Forums Community
AI RAG / Vector App
40 requests per user session
2,500 DAU
Embedding generation, vector search, LLM inference, and result rendering. Heavy AI workloads can handle 2,500 daily users for $0/mo.
AI Search Chatbot Doc QA Recommendation
🧮 Calculator

How much will your app cost?

Select your app type, drag the slider, and compare what you'd pay on SparrowBase vs. Vercel, Supabase, Firebase, and AWS for the exact same workload.

5,000 Daily Active Users → 25,000 req/day
$0.00 / month
Fits 100% within Cloudflare Free Tier — 100K daily requests, 5M D1 reads, 10GB R2 storage. No credit card required.

Same workload on other platforms:

💼 Business Model

How SparrowBase earns revenue

SparrowBase's open-source CLI and templates are free forever. We monetize through premium developer services and enterprise offerings.

🆓
Free Forever (Open Source)
The sparrowbase CLI, @sparrowbase/client SDK, all templates, and AI rules files are MIT licensed and free forever. You pay Cloudflare directly for infrastructure (starting at $0/mo). We never touch your data or billing.
💎
SparrowBase Pro (Coming Soon)
Premium templates (SaaS starter kits, e-commerce boilerplates, multi-tenant admin panels), advanced AI rules packs, pre-built UI dashboards, and priority support. One-time purchase or $9–$29/mo subscription.
🏢
Enterprise & Consulting
Custom deployment assistance, architecture review, migration from Vercel/Supabase/Firebase, dedicated Slack support, and SLA-backed managed infrastructure. Custom pricing for teams and enterprises.

tl;dr: SparrowBase follows the same model as Supabase, Hono.js, and Drizzle ORM — open-source core with premium services on top. Your infrastructure bill goes to Cloudflare. Our revenue comes from Pro templates, enterprise support, and consulting.

💰 Pricing

Official Cloudflare Pricing

SparrowBase is free and open-source. You only pay Cloudflare directly for infrastructure usage. Better-Auth is pre-configured and working — email/password, OAuth, and session management all run natively on Workers with zero additional cost.

Free Tier
$0 /month
Perfect for MVPs, side projects, and early-stage startups. No credit card required. No time limit.
  • 100,000 Worker requests / day (3M / month)
  • 5 Million D1 database reads / day
  • 100,000 D1 database writes / day
  • 10 GB R2 object storage
  • $0.00 / GB bandwidth egress (always free)
  • 100,000 KV reads / day
  • 10ms CPU time per request
  • Workers AI (limited free usage)
📖 Documentation

Deploy to production in 4 steps

From zero to a fully-deployed edge backend with Auth, Database, Storage, and AI — in under 5 minutes.

1
Create Your Project
The CLI scaffolds a complete Hono.js + Drizzle ORM + Better-Auth project with AI rules files pre-configured. Open it in Cursor, Windsurf, or any AI IDE.
npx sparrowbase init my-app cd my-app && npm install
2
Provision Cloudflare Resources
Create a D1 database, R2 storage bucket, and KV namespace — all on the free tier. Copy the IDs into wrangler.toml (the CLI guides you).
npx wrangler login npx wrangler d1 create sparrowbase-db npx wrangler r2 bucket create uploads npx wrangler kv namespace create CACHE
3
Develop Locally
Miniflare runs a local Cloudflare Workers environment with real D1, R2, and KV bindings. Hot reload, full type checking, and Vitest unit tests.
npm run dev # → http://localhost:8787/api/health # → {"status":"healthy","db":"connected"}
4
Deploy to Edge (330+ Locations)
One command deploys your entire backend to Cloudflare's global edge network. Zero cold starts. Sub-15ms latency worldwide. Automatic HTTPS.
npx wrangler deploy # → Published to https://my-app.workers.dev # → 330+ global edge locations, 0ms cold start
API Status: Operational
Edge Latency:
Runtime: Cloudflare Workers
Version: v1.0.0
Copied to clipboard!