跪拜 Guibai
← All articles
Frontend · Backend · GitHub

A 5-Month Side Project on Free Tiers: $0 Cloud Bill Beyond a Domain

By 三只萌新 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

A complete, production-viable MVP can run on Vercel and Cloudflare free tiers for nothing but the cost of a domain, so the real barrier to a side project is configuration and debugging knowledge, not cloud spend. The documented pitfalls — like better-sqlite3 breaking on Workers and misleading error metrics — are exactly what trips up developers new to edge serverless.

Summary

The post breaks down a zero-server-cost side-project architecture. Frontend runs on Vercel (for Next.js) or Cloudflare Pages (for static Vue/H5), backend uses Cloudflare Workers running Express, D1 provides a SQLite-based business database, and R2 handles images and uploads with no egress fees. The only fixed cost is a domain, purchased and hosted on Cloudflare.

The author walks through real deployment pitfalls: building and configuring Cloudflare Pages requires correct build commands and output folders; better-sqlite3 fails in the Worker runtime because it depends on OS-native binaries; and the Worker overview's Errors metric only counts runtime crashes, not business-level 500s — so a global error handler has to print error stacks manually. A debugging workflow is given: check Vercel Observability for frontend issues, filter the Events log for backend errors, verify the actual code version, and use D1's Console to inspect tables.

Domain setup also has traps: CNAME is an alias, not a redirect; the proxy cloud must be orange for Cloudflare protection; root domains can't use CNAME directly; and the custom domain must also be validated inside Vercel, not just at Cloudflare. The recommended MVP stack keeps everything on free quotas, which the author says is enough for low-traffic personal tools and SaaS validation.

Takeaways
— Total cloud spend over five months was 6 yuan, solely for a domain; Vercel and Cloudflare free tiers covered everything.
— Vercel suits Next.js best; Cloudflare Pages suits static Vue, Astro, and H5 with unlimited free bandwidth.
— Cloudflare Workers runs Express backend code at edge nodes, with no server management.
— D1 is Cloudflare's SQLite database; R2 is object storage with no egress fees for file downloads.
— K2 (message queue) and Basin (data lake) were skipped — K2 needs a paid plan and neither fits a small MVP.
— better-sqlite3 fails on Workers because it needs native binaries; code must branch between local SQLite and the bound D1 instance.
— The Worker overview Errors metric counts only runtime crashes, not business-level 500 responses; global error handlers are required to surface those.
— Use wrangler dev locally to reproduce issues before touching production logs.
— CNAME records only work for subdomains, not root domains; the proxy cloud must be orange for Cloudflare to route traffic.
— A custom domain must be added and verified inside Vercel even after the CNAME is set at Cloudflare.
— Free quotas for D1, R2, and Workers are limited but sufficient for low-traffic MVPs.
Conclusions

The steepest cost of a free-tier stack is debugging time, not money; most of the article's length is about misconfigured builds, runtime incompatibilities, and misleading metrics.

Platform-specific constraints reshape development habits: what works in local Node (like better-sqlite3) can silently break on edge runtimes, forcing environment-conditional code from day one.

Observability on Workers is intentionally coarse — a zero-Errors dashboard can hide 500s — so developers must build their own error plumbing instead of trusting platform metrics.

Concepts & terms
D1
Cloudflare's serverless SQLite database, used for structured business data like users and tasks; accessed from Workers via bindings, monitored through its own console.
R2
Cloudflare's object storage service, comparable to Alibaba OSS or AWS S3, with the key difference that outbound (egress) traffic is not billed, making it good for user uploads and images.
CNAME
A DNS alias record that maps a subdomain to another hostname; it is not a redirect. When proxied (orange cloud), traffic passes through Cloudflare's CDN and protections before reaching the origin.
From the discussion
Featured comments
striveLei

The hard part isn't deployment; without a good idea, nothing works.

三只萌新

[嘿哈] Yes, with a good idea, I'd have time to chat on Juejin instead of going out to make money [偷笑]

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗