Case study · Web platform
Cloudflare Edge Portfolio
This site: a static Next.js export on Cloudflare Pages, with one Pages Function for the contact form and checks that keep every link live.
How it fits together
- Write
- Markdown notes
- chat-to-draft script
- CI
- lint + tests
- static build
- internal link check
- Cloudflare Pages
- static pages + headers
- contact Pages Function
- Watch
- weekly external link check
- consent-gated analytics
The problem
The old site ran on Vercel with a server it did not need, an old Next.js version with a known vulnerability, and placeholder links. The goal was a fast static site where the only dynamic part is the contact form.
What I built
- Static export (output: export) served by Cloudflare Pages, with security headers and redirects in _headers and _redirects.
- One Cloudflare Pages Function for the contact form, which sends mail through the Resend API.
- Field notes from Markdown files, an RSS feed, and a script that turns Claude and Hermes chats into a draft note with secrets removed.
- A link checker in CI that fails on a missing page, file or #anchor, and a weekly lychee job for external links.
- Analytics that load only after consent, and fonts bundled with the site.
Decisions
- Static first: a portfolio has no per-user data, so a server adds cost and attack surface for nothing.
- Notes are published on this site first and then imported to Medium, which sets a canonical link back here.
What went wrong: Tests that passed by accident
A new node:test file was also picked up by Jest, which failed with "must contain at least one test". A local check had only read the summary line, not the exit code, so CI caught it first. The fix was one ignore pattern, and the lesson was to check exit codes.
What I would improve next
- Add a status panel that shows the last deploy, CI result and link-check result, read from GitHub at build time.
- Add an architecture diagram and decision records for each case study.