Skip to content

NW1: the waitlist on Workers - #2

Merged
pullely merged 1 commit into
mainfrom
orun/NW-2-the-waitlist-on-workers
Oct 29, 2026
Merged

pullely merged 1 commit into
mainfrom
orun/NW-2-the-waitlist-on-workers

Conversation

@pullely

@pullely pullely commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

lakshaybhushan/nextjs-notion-waitlist-template (main 4798588; no licence file — its README allows personal and commercial use and modification) in apps/web: Next.js 16.3.8 (upstream's 14.2.4; OpenNext 1.20 refuses 15.5) with React 19, framer-motion 12, sonner 2 and Tailwind 3, built by next build --webpack (Turbopack's per-route chunks put the Worker at 2.97 MiB gzipped; webpack's are 1.48 MiB, inside Workers Free) and then @opennextjs/cloudflare (standalone output, the static-assets incremental cache) into one Worker with Static Assets. Upstash's rate limit is the Worker's own Workers Rate Limiting binding, SIGNUP_LIMITER in wrangler.jsonc (two per sixty seconds), and it now covers both /api/mail and /api/notion — upstream left the Notion route unlimited — keyed on the site's host, the route and CF-Connecting-IP (request.ip is gone in Next 15+). Notion's and Resend's keys (NOTION_SECRET, NOTION_DB, RESEND_API_KEY and RESEND_FROM for the template's hard-coded sender) are read per request (lib/waitlist.ts): without them each route answers 503 naming what it lacks and the page's toast says the waitlist is not connected yet — never a 500 (upstream's module-level Resend client threw without a key). The build runs without them (env -u) and tooling/wire/worker-secrets.mjs hands them to the Worker as Worker secrets from a deploy lane; the component reads all four as optional Orun secret refs. The Notion client (2.3, the template's major) gets the Worker's fetch through a plain function (its default is node-fetch, and workerd refuses its native fetch called as a method); Resend 6; each React Email component from its own package. The email keeps the template's design and words, but its sender is RESEND_FROM, the reply-to and mailto to the template's author are gone and its logo is on the site's origin; /api/mail answers 502 when Resend refuses (upstream answered 200). Figtree is self-hosted, @vercel/analytics and the unused dependencies dropped, the Upstash and Vercel logos dropped, the Open Graph images served from public/ (as file conventions Next compiles each 1.3 MB image into the Worker), the site's name one seam (SITE_NAME in app/site.ts), metadataBase NEXT_PUBLIC_SITE_URL, and "Use this template" the site's own source link. /api/health is the deploy's smoke (ok while the Worker has its rate-limit binding; Notion and Resend reported, connected or not). tests/web: identity, the switch, the 503, the rate-limit key and check, the email, the secret push. typecheck, lint, test and build are green; wrangler dev serves the page, answers a signup not connected, and — connected to a local stand-in of Notion's and Resend's APIs — sends the template's email and row and refuses the third request a minute with a 429.

🤖 Generated with Claude Code

lakshaybhushan/nextjs-notion-waitlist-template (main 4798588; no licence file — its README allows personal and commercial use and modification) in apps/web: Next.js 16.3.8 (upstream's 14.2.4; OpenNext 1.20 refuses 15.5) with React 19, framer-motion 12, sonner 2 and Tailwind 3, built by next build --webpack (Turbopack's per-route chunks put the Worker at 2.97 MiB gzipped; webpack's are 1.48 MiB, inside Workers Free) and then @opennextjs/cloudflare (standalone output, the static-assets incremental cache) into one Worker with Static Assets. Upstash's rate limit is the Worker's own Workers Rate Limiting binding, SIGNUP_LIMITER in wrangler.jsonc (two per sixty seconds), and it now covers both /api/mail and /api/notion — upstream left the Notion route unlimited — keyed on the site's host, the route and CF-Connecting-IP (request.ip is gone in Next 15+). Notion's and Resend's keys (NOTION_SECRET, NOTION_DB, RESEND_API_KEY and RESEND_FROM for the template's hard-coded sender) are read per request (lib/waitlist.ts): without them each route answers 503 naming what it lacks and the page's toast says the waitlist is not connected yet — never a 500 (upstream's module-level Resend client threw without a key). The build runs without them (env -u) and tooling/wire/worker-secrets.mjs hands them to the Worker as Worker secrets from a deploy lane; the component reads all four as optional Orun secret refs. The Notion client (2.3, the template's major) gets the Worker's fetch through a plain function (its default is node-fetch, and workerd refuses its native fetch called as a method); Resend 6; each React Email component from its own package. The email keeps the template's design and words, but its sender is RESEND_FROM, the reply-to and mailto to the template's author are gone and its logo is on the site's origin; /api/mail answers 502 when Resend refuses (upstream answered 200). Figtree is self-hosted, @vercel/analytics and the unused dependencies dropped, the Upstash and Vercel logos dropped, the Open Graph images served from public/ (as file conventions Next compiles each 1.3 MB image into the Worker), the site's name one seam (SITE_NAME in app/site.ts), metadataBase NEXT_PUBLIC_SITE_URL, and "Use this template" the site's own source link. /api/health is the deploy's smoke (ok while the Worker has its rate-limit binding; Notion and Resend reported, connected or not). tests/web: identity, the switch, the 503, the rate-limit key and check, the email, the secret push. typecheck, lint, test and build are green; wrangler dev serves the page, answers a signup not connected, and — connected to a local stand-in of Notion's and Resend's APIs — sends the template's email and row and refuses the third request a minute with a 429.

Co-Authored-By: Claude <noreply@anthropic.com>
Orun-Task: NW-2
@pullely
pullely merged commit 5c334f4 into main Oct 29, 2026
2 checks passed
@pullely
pullely deleted the orun/NW-2-the-waitlist-on-workers branch October 29, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants