waitlist-cloudflare is a lightweight, high-performance, and secure Next.js 15 waitlist boilerplate designed for native serverless edge deployment on Cloudflare Workers using the OpenNext Cloudflare adapter.
The stack is 100% Cloudflare-only and requires zero external service configurations.
Live Demo: waitlist.metareignity.com
- Next.js 15 & React 19: Built on Next.js
15.5.18to guarantee compatibility and prevent handler bundling errors on Cloudflare Workers. - Cloudflare D1 Database: Primary SQL database mapping waitlist records natively at the edge. Includes schema files and quick D1 migration commands.
- Referral Tracking Swarm: Auto-generates unique, lightweight referral codes for registrants and tracks referring nodes.
- Native D1 Rate Limiting: Implements IP rate limiting natively inside Cloudflare D1 with a
rate_limitstable to prevent spam submissions, requiring no external databases or Redis instances.
To run this boilerplate, you only need a Cloudflare Account.
- Create a Cloudflare account.
- Authenticate the wrangler CLI locally:
npx wrangler login
- Initialize your D1 SQL database:
npx wrangler d1 create waitlist-db
- Copy the generated
database_idand name into yourwrangler.jsoncfile.
-
Clone the Repository:
git clone https://github.com/Metareignity/waitlist-cloudflare.git cd waitlist-cloudflare -
Install Dependencies:
pnpm install
-
Configure D1 Local Schema: Apply the migration to initialize the SQLite database locally:
npx wrangler d1 execute waitlist-db --file=schema.sql --local
-
Start Development Server:
pnpm dev
Open
http://localhost:3000in your browser. (Note: No local.envor.dev.varsenvironment variables are needed!).
-
Apply D1 Production Migration: Create the database schema on your live Cloudflare D1 instance:
npx wrangler d1 execute waitlist-db --file=schema.sql --remote
-
Configure wrangler.jsonc Bindings: Add D1 binding details and your custom domain target:
-
Deploy live to Cloudflare: Compile the Next.js bundle and upload the worker to Cloudflare:
pnpm run deploy
No production environment variables or secret keys are needed in the Cloudflare Dashboard!
This repository includes an llm.txt file at the root containing standardized markdown context about the architecture, folder layout, and parameters for LLM-based coding agents (like Cursor, Gemini, Copilot) to ingest.
To optimize your repository on GitHub, configure the About section on the right side of the repository page as follows:
- Description: ⚡ 100% Cloudflare-Native Next.js 15 Waitlist Boilerplate. Powered by Cloudflare D1 SQL, edge rate-limiting, referral swarms, and interactive WebGL shaders. Zero external dependencies.
- Website:
https://waitlist.metareignity.com - Topics:
nextjs,react,cloudflare-workers,cloudflare-pages,cloudflare-d1,sqlite,waitlist,boilerplate,tailwindcss,webgl
If you want to maintain two separate sites (e.g., waitlist.metareignity.com as the waitlist boilerplate, and metareignity.com as your primary brand website) using the same code repository but with different configurations (llm.txt, custom domains, text copy), here are the two standard ways to manage this systematically:
Instead of maintaining separate git branches (which leads to merge conflicts over time), you keep all changes in a single branch (main) and split domain configurations into distinct files:
- Create Environment Configuration Files:
- Rename
wrangler.jsonctowrangler.waitlist.jsonc(for waitlist) and create awrangler.brand.jsonc(formetareignity.com). - Create
public/llm.waitlist.txtandpublic/llm.brand.txt.
- Rename
- Add Custom Deploy Commands to
package.json: Add target deployment scripts that copy the correct configuration before running the OpenNext/Wrangler build:"scripts": { "deploy:waitlist": "node scripts/switch-env.js waitlist && opennextjs-cloudflare build && opennextjs-cloudflare deploy", "deploy:brand": "node scripts/switch-env.js brand && opennextjs-cloudflare build && opennextjs-cloudflare deploy" }
This guarantees that you can deploy either site with a single command from main, without managing code drift across Git branches.
If the two sites are highly divergent in content, use git branch staging:
- Branch Layout:
main: Serves as the boilerplate and deploys towaitlist.metareignity.com.brand-site: Derived frommainbut contains custom configurations and custom landing page text, deploying tometareignity.com.
- Git Workflow:
- Make core feature additions, security updates, and bug fixes on
main. - When features are complete, merge
mainintobrand-site:git checkout brand-site git merge main
- Handling Config Drift: Use a
.gitattributesmerge driver (e.g., settingwrangler.jsonc merge=oursandpublic/llm.txt merge=oursinside a.gitattributesfile) to ensure Git never overwrites the branch-specific configurations during merges.
- Make core feature additions, security updates, and bug fixes on
Open-sourced and maintained by METAREIGNITY. Distributed under the MIT License.
