A self-hosted Grafana dashboard for GitHub repository Insights — traffic (views, unique visitors, clones, unique cloners), referring sites, and popular content — built as a lead-generation / audience-insight tool: summarize all repos, drill into a selected repo, rank traffic sources, and slice by interesting filters.
See CLAUDE.md for the full design/instruction set.
cp .env.example .env
# token + full repo list (owned first, then forks, newest push first):
{
echo "GH_TOKEN=$(gh auth token)"
echo "COLLECT_DAYS=14"
echo "REPOS=$(gh repo list <owner> -L 2000 --json nameWithOwner,isFork,pushedAt --jq '
(map(select(.isFork|not))|sort_by(.pushedAt)|reverse)
+ (map(select(.isFork))|sort_by(.pushedAt)|reverse) | map(.nameWithOwner)|join(","))"
} >> .env
docker compose up -d --build
docker compose exec collector python -m ghtraffic.cli --backfilldocker compose exec collector python -m ghtraffic.cli --sync-reposRootless Docker note: if
dockercan’t find the daemon, point it at the rootless socket:export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock.
visibility (public/private), type (source/fork),
archived, and a chained repository picker.gh CLI (auth today, PAT/App provisioned for later) → Python OOP collector →
SQLite (single file, idempotent daily upserts) → Grafana (frser-sqlite-datasource,
provisioned dashboards + alerts). Two containers only, via docker compose.
Client retries on rate-limit (403/429) and transient DNS/network errors.
Want to take a quick peek without installing or running, please check:

CLAUDE.md)README.md with goals + checklist.gitignore (.env, data volumes, Python caches).env.example documenting GH_TOKEN, REPOS, DB credstraffic_daily(repo, day, metric, count, uniques) upsert keyreferrers(repo, day, source, count, uniques) upsert keypopular_paths(repo, day, path, count, uniques) upsert keyrepos(repo, is_fork, visibility, is_archived, updated_at) dimension tableschema.sqlAuthProvider interface + CliAuthProvider (gh auth token)EnvTokenProvider provision (reads GH_TOKEN)GitHubClient wrapping traffic/referrers/paths endpointsRepoMeta sync via list_owned_repos / --sync-reposTrafficPoint, Referrer, PopularPath, RepoMetabusy_timeoutcollect --once one-shot entrypointdocker compose: grafana + collector (non-root, shared named volume)frser-sqlite-datasource as code$repository + visibility/type/archived filters