Cloudflare SaaS Stack

supermemoryai/cloudflare-saas-stack ↗ ·★ 3.7k ·TypeScript ·MIT

Opinionated Next.js SaaS starter for Cloudflare Pages, D1, Drizzle ORM, NextAuth and shadcn/ui.

Cloudflare SaaS Stack screenshot
Stars
★ 3.7k
Language
TypeScript
License
MIT
Deploy targets
1

Overview

Cloudflare SaaS Stack is a Next.js starter designed around one goal: launch a SaaS-shaped product on Cloudflare without assembling every moving part yourself. The app deploys to Pages with edge rendering, data lives in D1 through Drizzle ORM, and the template includes NextAuth, Tailwind and shadcn/ui so the first screen is more than a blank framework demo.

The current README is firmly Cloudflare-first. It documents Wrangler login, D1 creation, Cloudflare Pages build/preview/deploy scripts, runtime bindings, database migrations and R2 CORS setup for uploads. That makes it useful when you want to learn how Cloudflare platform pieces fit together in a real SaaS template, not just in isolated examples.

What you get out of the box is the unglamorous-but-essential plumbing: routing, a typed data layer, auth wiring, UI conventions and Cloudflare deploy configuration. It is a starting point rather than a finished product, so you still bring your product logic, review the security model and test the Pages runtime before launch.

Highlights

  • Full Next.js app deployed to Cloudflare Pages with edge rendering
  • Type-safe data layer with Drizzle ORM over Cloudflare D1 (SQLite at the edge)
  • NextAuth, Tailwind and shadcn/ui included for a complete SaaS shell
  • Cloudflare Pages scripts, bindings, migrations and R2 upload notes documented

Best for

  • Indie hackers bootstrapping a SaaS on a $0 budget
  • Teams that want to stay inside the Cloudflare ecosystem
  • Projects that want D1-backed edge data without a separate backend

Getting started

  1. 1 Clone the repo and run npm install
  2. 2 Install dependencies and confirm Wrangler is logged in to your Cloudflare account
  3. 3 Create a D1 database with Wrangler and wire it into the app bindings
  4. 4 Configure auth secrets and OAuth credentials in .dev.vars or your deploy environment
  5. 5 Use the Pages build, preview and deploy scripts to test the Cloudflare runtime
#nextjs#saas#cloudflare#drizzle#starter

FAQ

Which database does the current README describe?

The current README centers on Cloudflare D1 with Drizzle ORM. Older descriptions mentioned Neon, but the repository now presents D1 as the documented database path.

Can I really run a SaaS for free on this?

For early-stage usage, yes — Cloudflare Pages, Workers and D1 all have free tiers that cover a low-traffic SaaS. You pay as you scale, which is the point of the stack.

Is this production-ready or just a demo?

It is a starter, not a finished product. The plumbing (routing, ORM, auth, Cloudflare scripts and deploy config) is production-shaped, but you still add your own product logic and harden it before launch.

Deploy Cloudflare SaaS Stack for free

Free-tier platforms that can host this project. Pick one and ship it.