jmou/cgithub
git clone https://github.com/jmou/cgithub.git
git clone git@github.com:jmou/cgithub.git
Loading…
(top)/CLAUDE.md
language: Markdown
2.02 KB / 44 lines / 31 loc
History
View raw

Project Overview

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.

Commands

# Local dev server (Cloudflare Workers runtime)
pnpm run dev

# Deploy to Cloudflare Workers
pnpm run deploy

# Run tests
pnpm test

Architecture

Stack: Hono (web framework) + Eta (templating) + TypeScript, running on Cloudflare Workers

Source files:

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:

Instructions