A small dashboard for browsing your GitHub starred repositories.
Built with Grid.js on the frontend and Cloudflare Pages + Functions + KV on the backend.
- Fetches all starred repositories for a given GitHub user
- Caches results in Cloudflare KV to avoid hitting the GitHub API on every request
- Simple refresh button to manually re-sync from GitHub
- Search, sort, and paginate using Grid.js
- Deployed as a static site on Cloudflare Pages with serverless API routes
-
/api/update-starred
A Cloudflare Function that calls the GitHub REST API (/users/:username/starred) page by page, extracts only the required fields, and stores the result JSON into a KV namespace (STARRED_CACHE). -
/api/starred
A Cloudflare Function that reads the cached JSON fromSTARRED_CACHEand returns it to the frontend, along with the GitHub username and profile URL. -
Frontend
A static HTML page (index.html) that:- loads cached starred repositories from
/api/starred - renders them via Grid.js
- shows the GitHub username as a link
- exposes a Refresh button that triggers
/api/update-starredand then reloads the data
- loads cached starred repositories from
- A GitHub account
- A Cloudflare account
- A GitHub personal access token (optional but recommended to raise rate limits)
- Node.js (only needed if you want to run local tooling; the app itself is static + Functions)
-
Fork this repository to your own GitHub account.
-
Create a Cloudflare Pages project linked to your forked repository.
-
Configure environment variables (see below).
-
Create a KV namespace and bind it to your Pages project (see below).
-
Deploy the project on Cloudflare Pages. After environment variables and KV bindings are set up, a redeployment is required. You can trigger a redeployment by pushing an empty commit to your forked repository:
git commit --allow-empty -m "Trigger redeploy" git pushor just retry the first deployment from the Cloudflare Pages dashboard.
-
Configure GitHub Actions to automatically refresh the starred cache daily (optional). Just make sure to enable the
Refresh Starred Cacheworkflow and set theUPDATE_KEYsecret in your forked repository's settings.
Configured in Cloudflare Pages → Settings → Environment Variables:
GITHUB_USERNAME– GitHub username whose starred repositories you want to displayUPDATE_KEY- A secret key used to authorize requests to/api/update-starred. Set this to a random string and use the same string when calling the update endpoint. This should be identical to theUPDATE_KEYused in GitHub Actions if you set up automatic updates.GITHUB_TOKEN– (optional) GitHub personal access token used for authenticated requests. Warn: make sure the token is kept secret and not exposed to the frontend.
If
GITHUB_TOKENis not set, the app relies on unauthenticated GitHub API calls and may quickly hit rate limits.
Create a KV namespace in Cloudflare and bind it to your Pages project:
- Go to Cloudflare dashboard → Storage & databases → Workers KV and create a namespace, e.g.
starred-cache. - In your Pages project settings, under Settings → Bindings, add a binding of type KV Namespace:
- Variable name:
STARRED_CACHE - KV namespace: choose the namespace you just created
- Variable name:
The code expects the binding to be accessible as env.STARRED_CACHE.