Innate Feeds supports both API mode and static (GitHub Pages) mode. They share the same sync scripts. The browser always tries GitHub live for digest freshness and READMEs; synced files are the snapshot / fallback.
API mode (bun run dev / bun run start) |
Static mode (VITE_STATIC_MODE=true) |
|
|---|---|---|
| Feeds (trending / starred) | SQLite via /api/feeds |
frontend/public/data/ JSON chunks |
| Digest (90-day archive) | ~/.innate/digest/ or frontend/public/data/digest.json |
digest.json in the Pages build |
| Digest (latest issues) | Browser live-fetches GitHub Issues and merges onto the snapshot | Same |
| README if file exists | API returns ./readmes/{owner}/{repo}.md immediately, then refreshes from GitHub in the background |
Browser live-fetches GitHub; bundled /data/readmes/ is the fallback if GitHub fails |
| How to publish | Not required | Sync → export into this repo → bun run build:static |
Typical Pages path: run a window (or daily) sync in this repo, export JSON, then static-build. The site still talks to GitHub from the visitor’s browser so the snapshot is not the only source.
- Default local DB:
~/.innate/feeds.db - Override with
DB_PATH=/path/to/feeds.db
GitHub’s trending page has no historical API. A 90-day window therefore does:
- Trending — fetch current daily / weekly / monthly lists into SQLite (weekly ≈ last 7 days, monthly ≈ last 30 days). READMEs are prefetched for repos that already appear in stored snapshots whose
snapshot_dateis within 90 days. - Starred — incremental sync of repos you starred in the last 90 days, then prefetch those READMEs.
- Digest issues —
ruanyf/weeklyandGitHubDaily/GitHubDailyissues created in the last 90 days, written to~/.innate/digest/andfrontend/public/data/digest.json.
Run from repository root (gh auth login required).
bun run data:update- Today’s daily trending + starred last 24h
- Digest issues created in the last 90 days
- Export chunks +
digest.json(+ copy./readmesintofrontend/public/data/readmesif present)
bun run data:update:window
# equivalent: bun run data:sync:window && bun run data:exportDefault --days 90. Useful flags:
cd backend
bun run sync:window -- --days 90
bun run sync:window -- --days 90 --skip-readme
bun run sync:window -- --force # refetch READMEs even if cached this week
bun run sync:window -- --skip-trending --skip-starred # digest + READMEs onlyBatch README prefetch skips files fetched in the last 7 days unless --force. Opening a repo in the UI still live-fetches.
bun run data:update:window # or data:update
bun run build:static
# project pages:
VITE_BASE_PATH=/your-repo bun run build:pages| Script | What it does |
|---|---|
bun run data:sync:trending |
Daily + weekly + monthly trending now |
bun run data:sync:starred |
Starred since DB watermark |
bun run data:sync:starred:recent |
Starred last 24h |
bun run data:sync:digest |
Digest issues created in last 90 days |
bun run data:sync:window |
All of the 90-day window including README prefetch |
bun run data:export |
Incremental JSON + digest.json + copy README cache |
bun run data:stats |
SQLite stats |
frontend/public/data/manifest.json: chunk indexfrontend/public/data/chunks/trending/<YYYY-MM-DD>.jsonfrontend/public/data/chunks/starred/<YYYY-MM-DD>.jsonfrontend/public/data/{stats,languages,dates}.jsonfrontend/public/data/digest.json: 90-day issues snapshot (commit this)frontend/public/data/readmes/{owner}/{repo}.md: README snapshot (gitignored; rebuilt on sync/export, included in the Pages artifact)
On-demand API cache stays at project ./readmes/ (also gitignored).
.github/workflows/deploy.yml builds the static site and deploys it.
| Trigger | Sync |
|---|---|
| Daily cron (08:00 UTC) | 90-day window (trending now, starred, digest issues, README prefetch) |
| Run workflow | Choice: window (default), daily, or skip (build committed JSON only). Optional --days, skip/force README |
Push to main |
Light data:update (today’s trending, starred 24h, digest 90d) so code deploys stay fast |
README files are gitignored; CI restores them from Actions cache, refreshes, and Vite copies frontend/public/data/readmes/ into the Pages artifact.
Optional repo settings:
| Name | Type | Purpose |
|---|---|---|
STARRED_USERNAME |
variable | GitHub login whose public stars to sync (recommended in CI) |
SYNC_GITHUB_TOKEN |
secret | PAT with public_repo if github.token rate-limits or starred needs auth |
FIRECRAWL_API_KEY |
secret | Trending scrape; optional, falls back to gh |
VITE_BASE_PATH |
variable | Project Pages subpath (default /<repo>/) |
gh workflow run "Deploy to GitHub Pages" -f sync_mode=window -f days=90bun run format:ts— writebun run format:ts:check— CI check