Repository navigation
NW1: the waitlist on Workers - #2
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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