{"id":47938386,"url":"https://github.com/lancedb/community-metrics","last_synced_at":"2026-04-04T07:55:22.987Z","repository":{"id":340441151,"uuid":"1164271618","full_name":"lancedb/community-metrics","owner":"lancedb","description":"Dashboard for tracking downloads and stars for Lance format and LanceDB SDK adoption.","archived":false,"fork":false,"pushed_at":"2026-04-01T13:34:29.000Z","size":285,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T07:55:22.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://community-metrics-alpha.vercel.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lancedb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-22T22:04:06.000Z","updated_at":"2026-04-01T13:34:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lancedb/community-metrics","commit_stats":null,"previous_names":["lancedb/community-metrics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lancedb/community-metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lancedb%2Fcommunity-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lancedb%2Fcommunity-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lancedb%2Fcommunity-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lancedb%2Fcommunity-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lancedb","download_url":"https://codeload.github.com/lancedb/community-metrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lancedb%2Fcommunity-metrics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31392188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T07:55:22.320Z","updated_at":"2026-04-04T07:55:22.972Z","avatar_url":"https://github.com/lancedb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Community Metrics Dashboard\n\nThis repository tracks community metrics for Lance and LanceDB, stores them in LanceDB Enterprise, and renders a read-only dashboard frontend.\n\nArchitecture split:\n- **Write path**: Python ingestion jobs run on a private host (for example EC2 + cron).\n- **Read path**: Next.js dashboard app serves `/api/v1/dashboard/daily` and is deployed to Vercel.\n\n## What This Tracks\n\n- SDK downloads:\n  - `pylance` (PyPI)\n  - `lance` (crates.io)\n  - `lancedb` (PyPI)\n  - `@lancedb/lancedb` (npm)\n  - `lancedb` (crates.io)\n- GitHub stars:\n  - `lance-format/lance`\n  - `lancedb/lancedb`\n  - `lance-format/lance-graph`\n  - `lance-format/lance-context`\n\n## Prerequisites\n\n- Python managed with `uv`\n- Frontend managed with `npm`\n- A running **LanceDB Enterprise** cluster\n\n## Environment\n\nCreate `.env` in the repo root (or update existing):\n\n```bash\nLANCEDB_API_KEY=...\nLANCEDB_HOST_OVERRIDE=https://\u003cyour-enterprise-host\u003e\nLANCEDB_REGION=us-east-1\n\n# Strongly recommended for scheduled ingestion:\nGITHUB_TOKEN=...\n```\n\n`GITHUB_TOKEN` should stay configured on the machine running scheduled updates.\n\n## LanceDB Storage\n\nTables:\n- `metrics`: metric definitions\n- `stats`: daily observations keyed by `(metric_id, period_end)`\n- `history`: ingestion run logs\n\nDaily row semantics in `stats`:\n- `period_start == period_end`\n- routine provenance: `api_daily`\n- recompute provenance: `recomputed`\n- download `source_window`: `1d`\n- star `source_window`: `cumulative_snapshot`\n\n## Ingestion Jobs (EC2 / Private Host)\n\nAll writes happen directly through `LanceDBStore`.\nNo FastAPI/uvicorn runtime is required.\n\n### Clean-Slate Bootstrap\n\n```bash\nuv run python -m community_metrics.jobs.bootstrap_tables\nuv run python -m community_metrics.jobs.update_all --lookback-days 90\n```\n\n### Routine Refresh\n\n```bash\nuv run python -m community_metrics.jobs.daily_refresh\n```\n\nFor ad-hoc correction windows:\n\n```bash\nuv run python -m community_metrics.jobs.daily_refresh --lookback-days 7\n```\n\nOne-time star-history backfill for newly added GitHub repos:\n\n```bash\nuv run python -m community_metrics.jobs.update_daily_stars --lookback-days 180\n```\n\n### Suggested Cron (EC2)\n\nRun daily at **09:00 UTC**:\n\n```cron\n0 9 * * * cd /path/to/community-metrics \u0026\u0026 /usr/bin/env -S bash -lc 'uv run python -m community_metrics.jobs.daily_refresh \u003e\u003e /var/log/community-metrics/daily_refresh.log 2\u003e\u00261'\n```\n\n## Frontend (Next.js + Vercel)\n\nThe dashboard lives in `src/dashboard` and fetches:\n- `GET /api/v1/dashboard/daily?days=180`\n- Google SSO (restricted to `@lancedb.com` accounts)\n\n### Local frontend dev\n\n```bash\ncd src/dashboard\nnpm install\nnpm run dev\n```\n\nSet these frontend env vars in `src/dashboard/.env.local` (local) or Vercel project settings (deployment):\n\n```bash\nGOOGLE_CLIENT_ID=...\nGOOGLE_CLIENT_SECRET=...\nNEXTAUTH_SECRET=...\nNEXTAUTH_URL=http://127.0.0.1:3000\n```\n\nGoogle OAuth app setup must include this callback URI:\n\n```bash\nhttp://127.0.0.1:3000/api/auth/callback/google\n```\n\n### Vercel env vars\n\nSet these in the Vercel project:\n\n```bash\nLANCEDB_API_KEY=...\nLANCEDB_HOST_OVERRIDE=https://\u003cyour-enterprise-host\u003e\nLANCEDB_REGION=us-east-1\nGOOGLE_CLIENT_ID=...\nGOOGLE_CLIENT_SECRET=...\nNEXTAUTH_SECRET=...\nNEXTAUTH_URL=https://\u003cyour-dashboard-domain\u003e\n```\n\nThe route is read-only by code path and only queries bounded dashboard windows.\nIf/when available, use a dedicated read-scoped key for Vercel.\n\n### Frontend metric semantics\n\n- Download chart points are monthly totals.\n- Download card headline values are the last full-month totals.\n- Through `2025-11-30`, download points come from seeded discrete snapshots.\n- From `2025-12-01` onward, monthly download points are aggregated from daily rows.\n- Star charts remain daily cumulative series.\n- Total stars combine all tracked GitHub star repos.\n\n## Which Job To Run\n\n| Job | Use this for | Command |\n| --- | --- | --- |\n| `daily_refresh` | Normal daily updates (scheduled) | `uv run python -m community_metrics.jobs.daily_refresh` |\n| `update_all` | Recompute/backfill a full lookback window | `uv run python -m community_metrics.jobs.update_all --lookback-days 90` |\n| `bootstrap_tables` | Destructive reset/recreate before rebuild | `uv run python -m community_metrics.jobs.bootstrap_tables` |\n\n## Debug helper\n\n`debug.py` reads LanceDB Enterprise tables directly (no REST API required):\n\n```bash\nuv run debug.py metrics\nuv run debug.py stats --metric-id downloads:lance:python --days 30\nuv run debug.py history --start-date 2026-01-01 --end-date 2026-12-31 --limit 200\nuv run debug.py all\n```\n\n## Development\n\nFormat and lint Python:\n\n```bash\nuv run ruff format .\nuv run ruff check --fix --select I .\n```\n\nRun tests:\n\n```bash\nuv run pytest -q\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flancedb%2Fcommunity-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flancedb%2Fcommunity-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flancedb%2Fcommunity-metrics/lists"}