A GitHub repository activity analyzer built with Python, TypeScript, and JavaScript.
Collects PR, commit, and review data from the GitHub API and visualizes it in a browser dashboard.
GitHub API → Python collector → SQLite → TypeScript API → JavaScript dashboard
git clone https://github.com/heki1224/github-activity-analyzer.git
cd github-activity-analyzer
cp .env.example .env
# Edit .env: set GITHUB_TOKENcd collector
uv run python main.py --org YOUR_ORG --repo YOUR_REPO --days 90cd api
npm install
npm run dev
# API running at http://localhost:3001open dashboard/index.htmlRun scripts/collect.sh daily via crontab to keep data up to date.
# 1. Set target org/repo in your shell profile or crontab
export COLLECT_ORG=your-org
export COLLECT_REPO=your-repo
export COLLECT_DAYS=30 # optional, default: 30
# 2. Make sure .env has GITHUB_TOKEN set
cp .env.example .env
# Edit .env: set GITHUB_TOKEN
# 3. Add to crontab (runs every day at 08:00)
crontab -eAdd this line to crontab:
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
0 8 * * * COLLECT_ORG=your-org COLLECT_REPO=your-repo /path/to/github-activity-analyzer/scripts/collect.sh
Logs are written to logs/collect.log (auto-rotated at 1MB).
Note: cron does not run while Mac is asleep. If you need guaranteed daily execution, use
launchdinstead.
| Method | Path | Description |
|---|---|---|
| GET | /api/summary |
PR count, commit count, avg lead time |
| GET | /api/timeseries |
Weekly commits, reviewer activity |
| GET | /api/heatmap |
Commit counts by day-of-week × hour |
| GET | /api/pr-distribution |
PR lead time distribution (0-4h … 7d+) |
| GET | /api/review-turnaround |
Avg hours from PR creation to first review |
| GET | /api/code-churn |
Weekly additions/deletions |
| GET | /api/contributors |
Commit/PR/review counts per contributor |
cd collector && uv run pytest tests/ -vcd api && npm test| Layer | Technology |
|---|---|
| Collector | Python 3.14 (uv), requests, pytest |
| Database | SQLite |
| API | TypeScript 5, Express 4, better-sqlite3, Vitest |
| Dashboard | Vanilla JavaScript, Chart.js |
MIT