Skip to content

Move hosting from Vercel to Cloudflare as a static app - #20

Merged
tylercb merged 3 commits into
mainfrom
cloudflare-static-spa
Oct 5, 2026
Merged

tylercb merged 3 commits into
mainfrom
cloudflare-static-spa

Conversation

@tylercb

@tylercb tylercb commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Vercel paused the deployment, so this moves the site to Cloudflare and removes the need for a server.

What changes

  • Static app: Vite + React Router replace Next.js. The UI and URLs are the same. The browser already fetched its data from ClickHouse directly, so the server pieces are removed: /api/stargazers, the server action, and GITHUB_TOKEN.
  • Hosting: an assets-only Cloudflare Worker (wrangler.jsonc), where requests for static assets are not metered.
  • Deploys: a new Deploy workflow runs the tests, lint and build on every push to main, then deploys. It uses the CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID repository secrets.
  • Bug fix: a repo with no results showed the loading skeleton forever, and "Try Again" never refetched.

Testing

  • 52 unit and component tests, lint and build pass, including from a fresh clone of this branch.
  • Checked in a browser against a local Workers preview: routing, live ClickHouse data, theme, the no-results state, and retry after a failed request.
  • The migration commit is what currently serves gitrelated.com and gitrelate.com. It was deployed by hand.
  • The Deploy workflow has not run yet. Merging this is its first run.

Notes

🤖 Generated with Claude Code

tylercb and others added 3 commits October 4, 2026 18:48
Vercel paused the deployment. The app already fetched its data from
ClickHouse in the browser, so it does not need a server. Replace
Next.js with a Vite single-page app using React Router, served from
Cloudflare Workers static assets where requests are not metered.

- Keep the same URLs: /org/repo, with deeper GitHub paths redirecting
  to it. Unknown paths fall back to index.html.
- Remove the unused server pieces: /api/stargazers, the server action,
  unstable_cache and GITHUB_TOKEN.
- Replace next-themes with a small theme provider, and apply the theme
  before first paint from index.html.
- Move response headers from next.config.ts to public/_headers.
- Replace next lint with a flat ESLint config, and run the build in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a Deploy workflow that runs on every push to main, which includes
merged pull requests. It calls the existing test workflow first and
deploys only if the tests, lint and build pass.

The test workflow no longer triggers on pushes to main itself, so the
tests run once per push. CI now uses Node 24, the version the new
toolchain was verified on.

Requires the CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID repository
secrets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RepoTable inferred "still loading" from having no rows, so a repo that
returned no results never left the skeleton. The same assumption meant
"Try Again" cleared the error without fetching again.

Track the initial load explicitly and rerun the fetch on retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tylercb
tylercb merged commit ef1ff67 into main Oct 5, 2026
1 check passed
@tylercb
tylercb deleted the cloudflare-static-spa branch October 5, 2026 00:07
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