Skip to content

feat(hosting): move the site from Vercel to Cloudflare Workers - #105

Merged
junaiddshaukat merged 1 commit into
mainfrom
chore/cloudflare-workers
Nov 14, 2026
Merged

junaiddshaukat merged 1 commit into
mainfrom
chore/cloudflare-workers

Conversation

@junaiddshaukat

Copy link
Copy Markdown
Member

What

devweekends.com now runs on Cloudflare Workers (OpenNext adapter) instead of Vercel. It is already live from this branch; this PR brings main in line.

Changes

  • No file system on Workers: posts, guides, SVG sizes and the share-image logo are bundled at build time (scripts/bundle-site-files.mjs, via predev / prebuild).
  • MongoDB: a Worker cannot reuse a socket opened by another request, so each request opens its own connection and models follow it (lib/db.ts, lib/impact-db.ts, lib/model.ts). Under Node (dev, build, Vercel) nothing changes.
  • worker.ts: daily LinkedIn feed cron (replaces vercel.json) and a permanent 308 from devweekends.com to www.
  • Cache: Next.js cache on R2, Durable Objects for revalidation. The Worker is placed in Mumbai, next to the database.
  • SITE_ENV replaces VERCEL_ENV. Next.js 15.5.15 → 15.5.29 (minimum for OpenNext).

Checked

  • Pages, blog/guides, RSS, sitemap, llms-full.txt, share image, image resizing, redirects and security headers on the live domain.
  • DSOC pages, register/login/apply endpoints, join and apply links.
  • No secrets in the diff: secrets live in Cloudflare (wrangler secret), and .env, .dev.vars, the build output and the generated bundle are git-ignored.

Deploying

npm run deploy (needs CLOUDFLARE_ACCOUNT_ID in .env), or Cloudflare Workers Builds from main.

🤖 Generated with Claude Code

The site now runs on Cloudflare Workers through the OpenNext adapter
(@opennextjs/cloudflare). Next.js stays; only the host changes.

- Workers have no file system: posts, guides, SVG sizes and the share
  image logo are packed into the bundle at build time
  (scripts/bundle-site-files.mjs, run by predev/prebuild).
- A Worker cannot reuse a socket opened by another request, so each
  request opens its own MongoDB connection and models follow it
  (lib/db.ts, lib/impact-db.ts, lib/model.ts). Node behaves as before.
- worker.ts adds the daily feed cron (replaces vercel.json) and a
  permanent 308 from devweekends.com to www.
- Next.js cache on R2 with Durable Objects for revalidation; the Worker
  runs in Mumbai, next to the database.
- SITE_ENV replaces VERCEL_ENV. Next.js 15.5.15 -> 15.5.29 (OpenNext minimum).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@junaiddshaukat junaiddshaukat changed the title Move hosting from Vercel to Cloudflare Workers feat(hosting): move the site from Vercel to Cloudflare Workers Nov 14, 2026
@junaiddshaukat
junaiddshaukat merged commit 7e99f43 into main Nov 14, 2026
3 of 4 checks passed
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.

1 participant