Ship your SaaS
to the edge.
A complete, production-ready starter for building SaaS apps on Cloudflare Workers. Auth, database, billing, email, and admin tooling are already wired up — clone it and deploy globally in minutes.
// the whole stack, already assembled
Cloudflare platform
- Workers
- D1
- KV
- R2
- Images
- Queues
- Turnstile
App framework
- Next.js via Vinext
- React Server Components
- Drizzle ORM
- Lucia Auth
- Tailwind CSS
- Stripe
// what's in the box
Skip the boilerplate. Build the product.
Every undifferentiated part of a SaaS is already here and tested. Open the repo and start writing the code that only your product needs.
Authentication, solved
Email and password sign-in, sign-up, password reset, and sessions on Lucia Auth — plus passkeys and Google OAuth.
Database & email
Drizzle ORM over Cloudflare D1, KV-backed sessions, and transactional email sent straight from the Worker.
Deployed to the edge
Ship to Cloudflare Workers and serve from 330+ cities with zero cold starts. One command pushes to production.
Modern runtime
Next.js App Router and React Server Components running on Vinext and Vite for an instant dev loop.
Billing built in
Per-team Stripe subscriptions with an embedded Payment Element are wired up, so you can charge customers without starting from scratch.
A real design system
Tailwind CSS with Shadcn and Base UI components, dark mode, and responsive layouts ready to extend.
Teams & admin
Multi-tenant teams, role-based access, and an admin panel for managing users and content out of the box.
Developer experience
TypeScript end to end, Oxlint, a CMS for blog and docs, and GitHub Actions deployment you don't have to write.
One command to clone.
Yours to ship.
Free and open source. No license fees, no attribution required. Fork it, rename it, and make it your own.
git clone https://github.com/LubomirGeorgiev/cloudflare-workers-nextjs-saas-template.git// faq
Questions, answered
Still curious? The README covers everything else, and issues are always open.
Yes, this template is completely free and open source! You can use it for both personal and commercial projects without any licensing fees. You can fork, copy, modify, and distribute it as you see fit without any restrictions and attribution.
The template includes a comprehensive set of features:
- Authentication with email/password and forgot password flow
- Database integration with Drizzle ORM and Cloudflare D1
- Email service powered by Cloudflare Email Service
- Modern UI components from Shadcn UI and Tailwind CSS
- Form validations and error handling
- Dark mode support
- Responsive design
- TypeScript throughout the codebase
- Automated deployments with GitHub Actions
- Captcha integration with Turnstile
- SEO optimization with Next.js
- And countless other features...
The template uses modern and reliable technologies:
- Next.js App Router with React Server Components through Vinext and Vite
- TypeScript for type safety
- Tailwind CSS and Shadcn UI for styling
- DrizzleORM with Cloudflare D1 for database
- Lucia Auth for authentication
- Cloudflare Workers for serverless deployment
- Cloudflare KV for session storage
- Cloudflare Email Service for transactional email
Deployment is automated with GitHub Actions. You'll need to:
- Create Cloudflare D1 and KV namespaces
- Onboard your sending domain in Cloudflare Email Service
- Enable Cloudflare Images for image optimization
- Configure Turnstile for captcha
- Add your Cloudflare API token to GitHub secrets
- Push to the main branch
The deployment process is fully documented in the GitHub repository.
You'll need a Cloudflare account (free tier is fine), Node.js installed locally, and basic knowledge of React and TypeScript. The template includes detailed documentation to guide you through the setup.
You can also check out the documentation for more information.
We have an exciting roadmap ahead! Planned features include:
- Multi-language support (i18n)
- Billing and payment processing
- Admin dashboard
- Email verification on sign up
- Notifications system
- Webhooks support
- Team collaboration features
- Real-time updates
- Analytics dashboard
Transactional email templates are rendered by the app and sent through Cloudflare Email Service from the Worker.
Before deploying to production, you should:
- Update project details in
src/constants.ts - Modify the footer in
src/components/footer.tsx - Optionally update the color palette in
src/app/globals.css
Contributions are welcome! Feel free to open issues, submit pull requests, or help improve the documentation on GitHub. The project follows standard open source contribution guidelines.