Explore star growth trajectory, measure release impact, compare repositories side-by-side, and preserve private traffic analytics beyond GitHub's 14-day limit.
βΆ Try Live Demo Β· Docs Β· Compare Repositories Β· β Star this Repo
Analyze any public GitHub repository directly in your browser:
- vercel/next.js β Star trajectory, 7d/30d run-rate, and release impact
- facebook/react β Recent growth curves and milestone timeline
- astral-sh/ruff β Velocity acceleration and stargazer momentum
- Compare Trajectories β Multi-repository side-by-side comparison
Add a real-time, edge-cached growth card to your repository's README.md. It displays your repository's stars, 30-day growth, momentum score, and latest release:
[](https://github-traffic-analytics.ali-ammari.workers.dev/repo/owner/repo)Use the default metric card or add a recent star-growth sparkline:
[](https://github-traffic-analytics.ali-ammari.workers.dev/repo/owner/repo)Add ?theme=<name> to the image URL. Themes also work with style=sparkline:
github-dark(default)github-lighttransparentdraculanordcatppuccin
[](https://github-traffic-analytics.ali-ammari.workers.dev/repo/owner/repo)For repositories that have crossed a supported public star threshold, the report offers a verified milestone card. The endpoint refuses milestone values the repository has not reached:
[](https://github-traffic-analytics.ali-ammari.workers.dev/repo/owner/repo)You can also embed the classic total views badge that counts traffic accumulated beyond GitHub's 14-day limit:
[](https://github-traffic-analytics.ali-ammari.workers.dev/repo/you/your-repo)| Feature | GitHub Traffic Analytics | GitHub Built-in Insights | Repobeats | star-history |
|---|---|---|---|---|
| Instant public analysis (no login) | β Yes | β No (requires auth) | β No | β Yes |
| Star velocity & run-rate calculation | β 7d/30d run-rate | β None | β Partial | β Cumulative only |
| Release impact window analysis | β 14d before vs. 14d after | β None | β None | β None |
| Multi-repository comparison | β
Side-by-side (/compare) |
β Single repo only | β None | β Stars only |
| Embeddable README growth card | β
Dynamic SVG (/api/card) |
β None | β Activity card | β Stars chart |
| Preserves traffic beyond 14 days | β Captured D1 history | β 14-day API window | β Images only | β No traffic |
| Deterministic non-causal math | β Pure TypeScript unit-tested | β None | β None | β None |
| Contextual AI interpretation | β Precomputed telemetry briefs | β None | β None | β None |
| 100% Free & Self-Hostable | β MIT Licensed | β Built-in | β SaaS pricing | β Free tool |
Enter any repository name or URL (vercel/next.js, https://github.com/facebook/react) to immediately inspect:
- Total stargazers & forks
- 7-day star growth & daily run-rate
- 30-day star trajectory
- Weekly velocity change percentage
- Transparent 0β100 repository momentum score
Releases are mapped directly over the star trajectory chart. A windowed comparison analyzes activity 14 days before vs. 14 days after each release with strictly non-causal temporal association language:
v2.1.0
14 days before: +520 stars (~37/day)
14 days after: +1,840 stars (~131/day)
Star velocity: +254%
Status: Growth accelerated around this release.
Turn a release window into a public report that compares 14 days before vs. 14 days after the release, shows star-velocity change, marks the release on the trajectory, and provides a shareable URL. The report uses non-causal language by design.
Compare between 2 and 4 repositories simultaneously. Trajectories are visualized side-by-side with shareable URL state (/compare?repos=vercel/next.js,nuxt/nuxt,sveltejs/svelte).
For two repositories, copy an embeddable comparison card directly from the Compare page:
[](https://github-traffic-analytics.ali-ammari.workers.dev/compare?repos=vercel%2Fnext.js%2Cnuxt%2Fnuxt)GitHub's traffic API returns a recent 14-day window. After a maintainer enables tracking, a daily Cloudflare Cron Worker saves views and clones into D1 from that point forward. It also captures GitHub's rolling top-referrer and popular-path lists, so later reports can compare observed source patterns. Retention depends on the deployment's D1 storage.
Owners can preview a deterministic weekly report, export their stored traffic as CSV or JSON, and opt into a Monday email to their verified primary GitHub address when the deployment has email delivery configured. Missing days remain unavailable rather than appearing as zero.
Installing the GitHub App and selecting repositories starts daily traffic archiving automatically. Scheduled collection then uses short-lived installation tokens scoped to those repositories; manual OAuth tracking remains available to deployments without an App.
Maintainers can also opt into weekly or monthly reports posted as a GitHub Issue or Discussion. They choose the Discussion category when applicable. On public repositories, those posts expose the included traffic counts, so this delivery is always an explicit opt-in.
Slack and Discord incoming webhook alerts can notify maintainers about observed star milestones, acceleration, slowdowns, referrer changes, and completed release windows. The webhook URL is encrypted before storage and alerts are sent only after an explicit opt-in.
Prefer a self-hosted workflow? GitHub Traffic Analytics Lite is a standalone Action that archives complete traffic days as JSON and CSV to a dedicated data branch, with no hosted database.
The public analytics API v1 exposes compact repository growth, observed star history, release comparisons, anomalies, and multi-repository comparison for developer integrations.
gh traffic brings those public metrics and locally authenticated owner traffic into the terminal.
The analytics MCP server offers focused growth and traffic tools to coding agents through a local stdio connection.
The Raycast extension delivers keyboard-driven repository growth lookup, comparison, and README card copying on macOS and Windows.
Maintainers can also download verified, shareable SVG milestone certificates directly from the repository report.
No generic AI chatbots. Maintainers can trigger contextual briefings:
- Explain this growth
- Explain this release period
- What changed?
- Summarize my traffic
AI receives precomputed structured numbers and explains trends without calculating math.
flowchart TD
subgraph PublicFlow["Public Intelligence Engine (No Login)"]
A[Developer enters owner/repo] --> B[Public GitHub API Service]
B --> C[Edge In-Memory LRU Cache]
C --> D[Deterministic Analytics Engine]
D --> E[Star History & Velocity Calculation]
D --> F[14d Release Impact Comparison]
D --> G[Repository Momentum Score]
E & F & G --> H["Public Web UI (/repo/[owner]/[repo])"]
E & F & G --> I["README SVG Card (/api/card/[owner]/[repo])"]
E & F & G --> J["OpenGraph Social Card (/repo/.../opengraph-image)"]
end
subgraph AuthenticatedFlow["Owner Retention Engine (OAuth Required)"]
K[Maintainer Signs in with GitHub] --> L[Encrypted httpOnly Session Cookie]
L --> M[Private Traffic API Proxy]
M --> N[Views, Clones, Referrers, Paths]
O[Daily Cloudflare Cron Worker] --> P[Cloudflare D1 SQLite Database]
P --> Q[Multi-Month Historical Charts]
end
- Node.js 20+
- pnpm 10+ (
npm install -g pnpm)
# 1. Clone the repository
git clone https://github.com/aliammari1/github-traffic-analytics.git
cd github-traffic-analytics
# 2. Install dependencies
pnpm install
# 3. Configure environment
cp .env.example .env.local
# 4. Start local development server
pnpm dev
# App will be running at http://localhost:3000| Variable | Required | Description |
|---|---|---|
NEXTAUTH_SECRET |
Yes | Session encryption secret (openssl rand -base64 32) |
NEXTAUTH_URL |
Yes | Web application URL (http://localhost:3000 locally) |
GITHUB_CLIENT_ID |
Yes | GitHub OAuth App Client ID |
GITHUB_CLIENT_SECRET |
Yes | GitHub OAuth App Client Secret |
GITHUB_PUBLIC_TOKEN |
Recommended for public deployments | Server-only read-only token that raises GitHub API capacity for public analysis; never sent to the browser |
ANTHROPIC_API_KEY |
Optional | Enables contextual AI explanations (claude-haiku-4-5) |
Note: Public repository intelligence works without OAuth. For a public deployment, configure
GITHUB_PUBLIC_TOKENso the analyzer does not rely on GitHub's small unauthenticated API quota. OAuth is only needed for owner features such as private traffic and tracking.
The application runs on Cloudflare Workers with a D1 database:
- Workers: Next.js 16 via
@opennextjs/cloudflare - D1 Database: Serverless SQLite for long-term daily snapshots
- Cron Worker: Daily capture and hourly timezone-aware digest checks (
worker/snapshot.ts)
Build with pnpm cf:build, then deploy with pnpm exec opennextjs-cloudflare deploy.
Create D1, set Worker secrets, and deploy the separate snapshot Worker as described
in the deployment guide.
Detailed step-by-step setup guides can be found in docs/.
pnpm lint # ESLint CLI
pnpm typecheck # TypeScript compilation check
pnpm test:coverage # Vitest unit/component tests (80% minimum coverage gate)
pnpm test:e2e # Playwright end-to-end tests (MSW-mocked)
pnpm build # Next.js production buildWe welcome community contributions! Please read our Contributing Guide to understand our codebase structure, how to add new metrics, and how to create new growth card themes.
MIT Β© Ali Ammari.