This project always reads/writes a remote LanceDB Enterprise cluster.
Architecture split:
- Write jobs run from a private machine (for example EC2 + cron).
- Frontend runs as a Next.js app in
src/dashboardand serves a read-only dashboard API route.
cd /Users/prrao/code/community-metrics
uv sync --extra dev
cd src/dashboard && npm install && cd ../..Required:
LANCEDB_API_KEY=...
LANCEDB_HOST_OVERRIDE=https://<your-enterprise-host>
LANCEDB_REGION=us-east-1Recommended for GitHub rate limits:
GITHUB_TOKEN=...uv run python -m community_metrics.jobs.bootstrap_tables
uv run python -m community_metrics.jobs.update_all --lookback-days 90What this does:
bootstrap_tables: dropsmetrics,stats,history; recreates all three tables; seedsmetrics.update_all: assumes tables already exist; seeds older historical points fromseed_data/, fetches recent API windows, writesstats, and writes one refresh-run record tohistory.
Single-command alternative:
uv run python -m community_metrics.jobs.update_all --reset-tables --lookback-days 90uv run python -m community_metrics.jobs.daily_refreshOptional correction window:
uv run python -m community_metrics.jobs.daily_refresh --lookback-days 7One-time star-history backfill for newly added GitHub repos:
uv run python -m community_metrics.jobs.update_daily_stars --lookback-days 180cd /Users/prrao/code/community-metrics/src/dashboard
npm run devAdd these frontend env vars in src/dashboard/.env.local:
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...
NEXTAUTH_SECRET=...
NEXTAUTH_URL=http://127.0.0.1:3000In Google Cloud Console, configure this OAuth callback URL:
http://127.0.0.1:3000/api/auth/callback/googleOpen http://127.0.0.1:3000.
curl "http://127.0.0.1:3000/api/v1/dashboard/daily?days=30"Usage:
# Metrics table view
uv run debug.py metrics
# Stats table view (for one metric)
uv run debug.py stats --metric-id downloads:lance:python --days 30
# History table errors view
uv run debug.py history --start-date 2026-01-01 --end-date 2026-12-31 --limit 200
# All three at once (sample stats metric + recent history errors)
uv run debug.py all