๐ŸŽ“Iris Courses
โ† AI App Building (No-Code & Low-Code)
Day 6 of 14

Deploying on Cloudflare and Vercel

Vercel โ€” Frontend and API Deployment

Vercel is the gold standard for deploying Next.js, React, and other JavaScript/TypeScript web applications. It provides: automatic deployments from GitHub (every push deploys a preview, merges to main deploy to production), global CDN with edge caching, serverless API routes (Next.js API routes run as serverless functions), and analytics. For a SaaS web app (a web version of BathCheck's admin portal, or a marketing site), Vercel is the correct choice. Deployment is: connect GitHub repo โ†’ configure build command โ†’ deploy. No server management, no nginx configs, no SSL certificate management. The Hobby tier is free; the Pro tier ($20/month) adds team collaboration, more function execution time, and priority support. Vercel + Supabase is the most common modern SaaS stack. Vercel handles the frontend and API layer; Supabase handles the database, auth, and storage. Both have generous free tiers and scale independently. This combination can handle 10,000 monthly active users on a combined infrastructure cost of $50โ€“$100/month.

Cloudflare Workers โ€” The Edge Computing Layer

Cloudflare Workers run JavaScript/TypeScript at Cloudflare's edge โ€” 300+ data centres globally, executing code within milliseconds of any user in the world. Workers are distinct from Vercel in that they're designed for: high-performance API endpoints, request transformation and routing, authentication middleware, rate limiting, and applications where cold start latency is unacceptable. Cloudflare's ecosystem for full-stack apps: Workers (serverless functions), Pages (static site hosting with server-side rendering), D1 (SQLite database at the edge, excellent for read-heavy workloads), R2 (object storage, S3-compatible, free egress), KV (key-value store for configuration and caching), and Queues (job queue for async processing). For Darkice Interactive, Cloudflare is the right choice for: API endpoints that need global low latency (Gliderol or Dormakaba integrations that need to respond fast), webhook processing from Apple's App Store or Stripe, and any compute task that needs to run close to the user. The Workers free tier (100,000 requests/day) covers early-stage usage entirely.

โšก Today's Action

Deploy a simple 'Hello World' API endpoint on both Cloudflare Workers and Vercel today. Time how long each deployment takes from sign-up to live URL. Experience the developer experience firsthand โ€” this 30-minute exercise makes the infrastructure choice real rather than theoretical.

๐Ÿ’ก Pro Tip

Use Cloudflare as your DNS for all your domains regardless of where you deploy โ€” it's free, provides DDoS protection, caching, and makes switching infrastructure providers trivial (no DNS propagation issues).