
Cloudflare SaaS Stack
https://github.com/supermemoryai/cloudflare-saas-stack- Category
- Developer Tools
- Rank
- No. 1087Tools index
Previous survey · No. 1092 ·
- Pricing
- Open Source
- Type
- TOOL
- Builder
- supermemoryai
- GitHub
- 3.7k stars
- Date
About
Supermemory's quickstart for full-stack apps on Cloudflare — database, auth, styling, storage, and deploy in a single template.
What it does
An opinionated Next.js foundation for building SaaS products directly on Cloudflare’s edge platform. It connects Google sign-in, a D1 database, Drizzle models, Tailwind styling, reusable UI components, dark mode, local development, migrations, previews, and Pages deployment.
Why it's ranked here
The template proves its choices with working integration code, not merely a dependency list. Authentication persists through Drizzle, the home screen queries D1, and deployment scripts target Cloudflare Pages. However, configuration inconsistencies and starter metadata mean teams should treat it as a practical foundation, not a finished production baseline.
What's good
The included page exercises the stack end to end: it reads a user count, detects a session, and offers Google login or logout. Database tables cover users, accounts, sessions, verification tokens, and authenticators. The theme system avoids server and client disagreement by loading its toggle only in the browser.
Tradeoffs
The stack commits you to Cloudflare Pages, D1, Next.js, Drizzle, NextAuth, Bun, and Google authentication. Environment handling is inconsistent: validation requires an authentication URL but omits it from runtime mapping, while database access reads a separate process binding. The default title and description also remain generic starter text.
How to use it well
Choose it for a Cloudflare-first SaaS prototype whose first milestone needs authentication, relational persistence, styling, theming, and edge deployment. Run local migrations, then periodically preview under the Pages environment as the documentation advises. Bring your own product architecture, billing, tests, monitoring, authorization rules, and production hardening because those needs are not demonstrated here.
Technical notes+
package.json defines Bun-driven Next.js development, Cloudflare Pages build, preview and deploy commands, Wrangler type generation, and Drizzle migration and studio commands. src/app/page.tsx runs at the edge, calls NextAuth session helpers, queries the users table through Drizzle, and renders Google sign-in state. src/server/auth.ts connects NextAuth’s Google provider to the Drizzle adapter. src/server/db/index.ts initializes the D1 driver from process.env.DATABASE, while src/env.mjs validates authentication variables but declares AUTH_URL without adding it to runtimeEnv. src/app/layout.tsx still carries generated Next.js metadata. src/lib/theme/theme-script.tsx, src/hooks/use-theme.ts, and src/lib/theme/get-theme-button.tsx implement persisted light and dark themes with a client-only toggle.
Observed
- Primary language
- TypeScript and TSX
- Package surface
- Private Next.js application installed and operated with Bun scripts
- Deployment interface
- Wrangler CLI and Cloudflare next-on-pages commands target Cloudflare Pages
- Database platform
- Cloudflare D1 accessed through Drizzle ORM’s D1 driver
- Authentication
- NextAuth with Google provider and Drizzle adapter
- UI stack
- React, Tailwind CSS, Radix UI primitives, and class-variance-authority
- Runtime target
- The main page and not-found page explicitly select the edge runtime
Read from README.md, package.json, src/env.mjs, src/app/page.tsx, src/lib/utils.ts, src/app/layout.tsx, src/server/auth.ts, src/app/not-found.tsx, src/hooks/use-theme.ts, src/server/db/index.ts, src/server/db/schema.ts, src/components/ui/button.tsx, src/lib/theme/theme-button.tsx, src/lib/theme/theme-script.tsx, src/lib/theme/get-theme-button.tsx.
What it can do
Set up database infrastructure
Application requirements and configuration → Configured Cloudflare database instance
Implement user authentication
Authentication requirements and user data → Working auth system with login/signup flows
Apply pre-built styling templates
Design preferences and component requirements → Styled application interface
Configure file storage system
Storage requirements and file types → Functional cloud storage integration
Deploy application to production
Application code and deployment settings → Live, accessible web application
Generate full-stack project template
Project specifications and requirements → Complete application boilerplate with all services integrated
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.