cgithub is a lightweight GitHub alternative frontend that scrapes GitHub's server-rendered HTML instead of using the API. Data is usually extracted from embedded JSON data from <script type="application/json"> tags that GitHub includes for hydration.
# Local dev server (Cloudflare Workers runtime)
pnpm run dev
# Deploy to Cloudflare Workers
pnpm run deploy
# Run tests
pnpm testStack: Hono (web framework) + Eta (templating) + TypeScript, running on Cloudflare Workers
Source files:
src/app.ts- Hono routessrc/worker.ts- Cloudflare Workers entry (config inwrangler.jsonc)src/scraper.ts- GitHub HTML fetching and JSON extraction logic
Templates: views/*.eta - Eta templates with layout inheritance. views/layouts/base.eta is the HTML shell every page uses; views/layouts/repo.eta wraps it with the repository header, nav, and search box. Templates address each other from the views root (/layouts/base.eta) or as siblings (./_tree). On Workers, runtime code generation is disallowed, so scripts/build.ts precompiles templates to src/views.generated.ts. The same script records the build's git describe output in src/build.generated.ts for the page footer. Both are gitignored and regenerated by the dev/deploy scripts.
Static files: public/static/*, served by Workers Static Assets.
Routes:
GET /:owner- User or organization profile with pinned repositoriesGET /:owner/:repo- Repository info with directory listingGET /:owner/:repo/tree/:branch/:path*- Directory listingGET /:owner/:repo/blob/:branch/:path- File content viewGET /:owner/:repo/commits/:branch/:path*- Commit history of the repository, a directory, or a fileGET /:owner/:repo/wiki- Wiki home pageGET /:owner/:repo/wiki/:page- Wiki page (also/:page/:oidfor a revision)GET /:owner/:repo/wiki/_pages- Wiki page index
- Use
for (const ... of ...)instead of.forEach() - Update
scraper.test.ts