Interactive dashboard for GitHub traffic with:
- clones
- unique cloners (daily uniques)
- views
- unique visitors (daily uniques)
- repo/date/metric filters
- day/month/year aggregation
- current month and custom date range filters
- click-to-drill chart and period table
- popular content and top referrer sections (GitHub traffic style)
- download current filtered view as JSON/CSV
index.html: dashboard UI.scripts/merge-traffic-history.js: per-repo history merge (adapted from your snippet).scripts/sync-github-traffic.js: pulls real traffic data from GitHub API for all configured repositories.scripts/build-dashboard-data.js: combines many repos into one dashboard dataset.repos.json: repository list used by the sync workflow..github/workflows/sync-traffic-dashboard.yml: scheduled/manual central sync and aggregation workflow..github/workflows/deploy-pages.yml: publishes dashboard to GitHub Pages.
Edit repos.json:
{
"repos": [
{ "repo": "netascode/nac-branch" },
{ "repo": "your-org/repo-2" }
]
}Create a secret in this repository:
TRAFFIC_PAT
The PAT must have access to all repos listed in repos.json and permission to call GitHub traffic endpoints.
Run locally (optional):
GITHUB_TOKEN=YOUR_TOKEN \
node scripts/sync-github-traffic.js \
--config=repos.json \
--historyDir=data/rawThis writes one history file per repo under data/raw/.
File naming is repo-based for clarity, for example netascode/nac-branch becomes data/raw/netascode-nac-branch.traffic.json.
Because sync runs on a schedule and merges daily windows into local history, you keep data far beyond GitHub's native 14-day traffic API limit.
Current schedule is daily (02:23 UTC) plus manual trigger.
node scripts/build-dashboard-data.js \
--config=repos.json \
--historyDir=data/raw \
--out=public/dashboard.jsonUse VS Code Simple Browser or any static server and open:
traffic-dashboard/index.html
The page reads public/dashboard.json.
The repository includes a Pages deployment workflow. To enable it:
- GitHub repository Settings → Pages.
- Under Build and deployment, choose Source =
GitHub Actions. - Run workflow
Deploy Dashboard to GitHub Pagesonce manually (or push tomain).
After deployment, your dashboard is available from your repo's Pages URL.
If you still want to run collection jobs inside each source repository, this script is available:
Use this script inside each repo workflow after downloading /tmp/clones.json and /tmp/views.json from the GitHub traffic API:
node traffic-dashboard/scripts/merge-traffic-history.js \
--history=data/traffic.json \
--clones=/tmp/clones.json \
--views=/tmp/views.jsonIt preserves historical days beyond the 14-day GitHub API window and recomputes totals each run.