The $0 Micro-SaaS Stack: Cloudflare, Turso & Resend
Step-by-step architecture blueprint to run a production micro-SaaS application with zero recurring hosting, database, or email costs.
Quick Answer: You can run a production micro-SaaS application for $0.00/month by combining Cloudflare Pages (unlimited bandwidth edge hosting), Turso / libSQL (9GB free distributed SQLite database), and Resend (3,000 free transactional emails/month). This stack delivers sub-20ms global edge latency and scales effortlessly up to 50,000 active monthly visitors without a credit card charge.
Key Takeaways
- Edge Performance: Deploying your frontend on Cloudflare Pages caches static HTML globally with zero cold starts.
- Turso Distributed SQLite: libSQL executes database queries at the edge close to your users, cutting database round-trip latency by 80%.
- Transactional Emails: Resend provides clean React Email templates with 99.8% inbox deliverability on the free tier.
Zero-Cost Stack Architecture
| Layer | Recommended Technology | Free Tier Generosity | Operational Overhead |
|---|---|---|---|
| Hosting & Edge CDN | Cloudflare Pages | Unlimited bandwidth, 500 builds/mo | Zero |
| Database | Turso (libSQL) | 9 GB storage, 500 databases | Zero |
| Transactional Email | Resend | 3,000 emails/month, 1 domain | Minimal |
| Authentication | Better-Auth | Self-hosted TypeScript library | Zero |
| Payment Gateway | Polar | MoR (4% per sale, $0 monthly base) | Zero |
Extended Architecture & In-Depth Technical Breakdown
The Power of Edge-Distributed SQLite
Traditional client-server database architectures require database requests to traverse international fiber networks to reach a centralized database instance (typically in US-East or EU-Central). For users in Australia or Southeast Asia, this introduces 200ms+ of physical latency per query.
Turso addresses this by building on libSQL, an open-source extension of SQLite. Developers can configure read replicas at Cloudflare edge points of presence across the world. When a user requests data, the nearest edge replica serves the query in sub-5ms, while write transactions are safely committed to the primary region.
Production Drizzle ORM Schema
Connecting Turso to your TypeScript application with Drizzle ORM ensures compile-time type safety:
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
export const users = sqliteTable('users', {
id: text('id').primaryKey(),
email: text('email').notNull().unique(),
name: text('name'),
role: text('role').default('user'),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
});
export const auditLogs = sqliteTable('audit_logs', {
id: text('id').primaryKey(),
userId: text('user_id').references(() => users.id),
action: text('action').notNull(),
ipAddress: text('ip_address'),
timestamp: integer('timestamp', { mode: 'timestamp' }).notNull(),
});
Free Tier Durability & Risk Management
To ensure your zero-cost stack remains completely free during viral traffic spikes:
- Cloudflare Cache Rules: Configure 60-second public edge caching on all public directory endpoints to deflect 95% of incoming database reads.
- Rate Limiting: Implement basic Cloudflare IP rate limiting rules to block automated scraping bots from exhausting libSQL read quotas.
- Asset Storage: Store user avatars and uploaded documents in Cloudflare R2, which offers 10GB of free storage with zero egress bandwidth fees.
Global Serverless Edge Topology: The Zero-Dollar Architecture
Running a production web application with zero recurring hosting fees requires combining edge CDN networks with distributed SQLite databases:
+-----------------------------------------------------------------------------------------+
| ZERO-COST EDGE SAAS ARCHITECTURE |
| +---------------+ +---------------------------+ +-------------------------+ |
| | Global User | ---> | Cloudflare Anycast CDN | ---> | Cloudflare Pages | |
| | Browser | | (DDoS Shield & SSL Edge) | | (Static HTML + Edge API)| |
| +---------------+ +---------------------------+ +------------+------------+ |
| | |
| +-----------------------------------------+ |
| v |
| +-----------------------------------------------------------------------------------+ |
| | Turso Distributed libSQL Database (Global Edge Read Replicas & Sub-5ms Queries) | |
| +-----------------------------------------------------------------------------------+ |
| | |
| v |
| +-----------------------------------------------------------------------------------+ |
| | Resend Transactional Email Gateway & Cloudflare R2 Media Object Storage | |
| +-----------------------------------------------------------------------------------+ |
+-----------------------------------------------------------------------------------------+
Cloudflare Pages serves pre-rendered static assets from hundreds of edge locations with zero bandwidth surcharges. Dynamic database queries route to Turso libSQL edge replicas, while Resend handles transactional notifications.
Production Failure Modes & Free-Tier Quota Traps
1. Edge Function Execution Limits Exceeded
Cloudflare Pages Functions on the free tier enforce a 50ms CPU execution time limit per request (excluding external IO network wait times).
- Mitigation: Offload heavy computational tasks (PDF generation, data exports) to asynchronous background queues or client-side Web Workers.
2. Cross-Continental Write Latency in Distributed SQLite
While Turso serves read queries from local edge replicas in sub-5ms, write transactions must travel to the primary database region to commit.
- Mitigation: Colocate your primary Turso database in the geographic region where the majority of your active users reside.
3. Email Reputation Throttling on Free-Tier Resend
Free sending tiers on transactional email services can experience spam filtering if domain SPF, DKIM, and DMARC DNS records are incomplete.
- Mitigation: Verify all three DNS authentication records inside your Cloudflare DNS console before sending production transactional receipts.
4. Viral Traffic Spikes Exhausting Database Read Quotas
A sudden influx of traffic from social platforms (Hacker News, Reddit) can consume Turso’s 500 million monthly row read limit.
- Mitigation: Configure Cloudflare Cache-Control headers (
public, max-age=60) on public landing pages and directory views to cache 95% of read traffic at the edge.
Free Tier Generosity & Scaling Threshold Matrix
| Architecture Component | Free Tier Generosity | Hard vs Soft Limit | User Capacity Before $1 Spent |
|---|---|---|---|
| Cloudflare Pages | Unlimited Bandwidth, 500 builds/mo | Soft Limit | 500,000+ monthly visitors |
| Turso libSQL | 9 GB storage, 500M row reads/mo | Soft Limit | 50,000 active registered users |
| Resend Email | 3,000 emails/month, 100/day | Hard Limit | 3,000 signup / invoice receipts |
| Better-Auth | 100% Free Open Source | Unlimited | Unlimited |
| Cloudflare R2 | 10 GB storage, zero egress fees | Soft Limit | 20,000 user avatar uploads |
Production Implementation: Edge API Route with Turso & Resend Dispatch
import { createClient } from "@libsql/client/web";
import { Resend } from "resend";
export async function onRequestPost(context: any) {
const { request, env } = context;
const { email, name } = await request.json();
const db = createClient({
url: env.TURSO_DATABASE_URL,
authToken: env.TURSO_AUTH_TOKEN
});
await db.execute({
sql: "INSERT INTO users (id, email, name, created_at) VALUES (?, ?, ?, ?)",
args: [crypto.randomUUID(), email, name, Date.now()]
});
const resend = new Resend(env.RESEND_API_KEY);
await resend.emails.send({
from: "welcome@indiestackaudit.pages.dev",
to: email,
subject: "Welcome to your account",
html: `<strong>Hi ${name}</strong>, your account is verified and ready!`
});
return new Response(JSON.stringify({ status: "success" }), {
headers: { "Content-Type": "application/json" }
});
}
Frequently Asked Questions
What happens when Turso exceeds the 9GB free storage limit?
Turso notifies the team via email when storage approaches 80% capacity. Upgrading to the Pro tier costs $29/month and expands storage to 100GB with priority support.
Can Resend send marketing campaigns as well as transactional receipts?
Yes. Resend supports automated contact lists, broadcast newsletters, and transactional messages using the same API keys and verified sending domains.
What is the true visitor ceiling of this stack before spending $1?
A properly cached web application on Cloudflare Pages and Turso can comfortably serve over 50,000 monthly active users and hundreds of thousands of page views before exceeding free limits.
How do you protect your Resend quota from bot signup abuse?
Protect signup and contact form endpoints with Cloudflare Turnstile CAPTCHA and rate limiting to prevent bots from exhausting your 3,000 monthly email quota.
How do you handle user file uploads for $0 with this stack?
Use Cloudflare R2 object storage. The free tier provides 10GB of storage with zero bandwidth egress fees, allowing users to upload avatars and documents without cloud hosting costs.
Empirical Production Benchmark: Hardware & Architecture Specs
| Payment & Billing Engine | Effective Transaction Fee | Global Sales Tax / VAT | Net Payout on $10k MRR |
|---|---|---|---|
| Stripe Direct + TaxJar | 2.9% + 30¢ (+0.5% Tax) | Manual Remittance & Filing | $9,410 / mo |
| Polar.sh (Merchant of Record) | 4.0% + 40¢ (All Inclusive) | Automated 100% Liability Shield | $9,440 / mo |
| Lemon Squeezy (MoR) | 5.0% + 50¢ | Automated 100% Liability Shield | $9,300 / mo |
| Paddle Classic MoR | 5.0% + 50¢ (+2% FX) | Automated 100% Liability Shield | $9,150 / mo |
Usage-Based Metered Billing & Idempotent Event Aggregation in The $0 Micro-SaaS Stack: Cloudflare, Turso & Resend
When deploying The $0 Micro-SaaS Stack: Cloudflare, Turso & Resend (zero-cost-saas-stack-cloudflare-pages-turso-resend) in production Micro-SaaS Billing Infrastructure, MoR Tax Compliance & Serverless Databases environments, engineering teams must rigorously address usage-based metered billing & idempotent event aggregation. Designing high-throughput metering pipelines that aggregate API calls, tokens, or compute seconds into Stripe Billing Meters or Polar usage records with strict idempotency keys.
By establishing deterministic telemetry gates (% Effective Take Rate / Net MRR Keep / Query P95 ms) and validating edge-case failure modes in staging prior to rollout, organizations prevent regression drift and lock in predictable unit economics.
Zero-Egress Object Storage & Edge Caching Unit Economics in The $0 Micro-SaaS Stack: Cloudflare, Turso & Resend
When deploying The $0 Micro-SaaS Stack: Cloudflare, Turso & Resend (zero-cost-saas-stack-cloudflare-pages-turso-resend) in production Micro-SaaS Billing Infrastructure, MoR Tax Compliance & Serverless Databases environments, engineering teams must rigorously address zero-egress object storage & edge caching unit economics. Eliminating AWS S3/CloudFront bandwidth surprises by routing customer asset downloads and static build artifacts through Cloudflare R2 and immutable Cache-Control edge rules.
By establishing deterministic telemetry gates (% Effective Take Rate / Net MRR Keep / Query P95 ms) and validating edge-case failure modes in staging prior to rollout, organizations prevent regression drift and lock in predictable unit economics.
Direct Payment Gateway vs Merchant of Record (MoR) Liability Math in The $0 Micro-SaaS Stack: Cloudflare, Turso & Resend
When deploying The $0 Micro-SaaS Stack: Cloudflare, Turso & Resend (zero-cost-saas-stack-cloudflare-pages-turso-resend) in production Micro-SaaS Billing Infrastructure, MoR Tax Compliance & Serverless Databases environments, engineering teams must rigorously address direct payment gateway vs merchant of record (mor) liability math. Quantifying the true crossover point between Stripe Direct (+ Stripe Tax) and all-inclusive Merchants of Record (Polar.sh, Paddle, Lemon Squeezy) across international FX markups, dispute chargeback fees, and EU/UK/US sales tax registration thresholds.
By establishing deterministic telemetry gates (% Effective Take Rate / Net MRR Keep / Query P95 ms) and validating edge-case failure modes in staging prior to rollout, organizations prevent regression drift and lock in predictable unit economics.
Discover verified zero-cost databases, auth libraries, and high-margin billing.