A public leaderboard tracking all-time commit contributions across GitHub. Connect your GitHub account to see where you rank among developers worldwide.
Official Instance: ghcommits.com
GitHub Commits Leaderboard aggregates commit contribution data from connected GitHub accounts and ranks developers by their all-time commit count. The project uses GitHub's GraphQL API to fetch contribution data, including both public and private repository commits (with user consent).
- All-time commit tracking from GitHub account creation to present
- Public and private repository commit counting
- Organization contribution support
- Cursor-based paginated leaderboard (50 users per page)
- User search by GitHub username
- Public REST API with rate limiting
- Automatic score refresh every 3 days
- Built with GitHub's Primer design system
The easiest way to participate is to use the official instance at ghcommits.com.
- Visit ghcommits.com
- Click "Connect GitHub"
- Review the data access agreement
- Authorize the application on GitHub
- Grant access to organizations you want commits counted from
- Your profile will appear on the leaderboard after processing
Your commit count is refreshed automatically every 3 days.
Once you're on the leaderboard, you can generate an embeddable badge showing your rank:
[](https://ghcommits.com)Visit ghcommits.com to generate your badge with the correct embed code.
While we encourage using the official instance at ghcommits.com to maintain a unified global leaderboard, you can host your own private instance for organizations, teams, or research purposes.
- Node.js 20+
- A Neon PostgreSQL database (free tier available)
- A Cloudflare account (for Workers deployment)
- A GitHub OAuth App
Create a .env.local file:
DATABASE_URL=postgresql://user:password@host/database
GITHUB_CLIENT_ID=your_github_oauth_client_id
GITHUB_CLIENT_SECRET=your_github_oauth_client_secret
TOKEN_ENCRYPTION_KEY=32_byte_hex_string_for_aes_encryption
SESSION_SECRET=random_secret_for_session_signing
APP_URL=http://localhost:3000
CRON_SECRET=secret_for_manual_refresh_endpoint# Install dependencies
npm install
# Run database migrations
node scripts/migrate.mjs
# Start development server (uses .env.local)
npm run devFor local development with wrangler dev (testing the Worker locally), create a .dev.vars file:
DATABASE_URL=postgresql://user:password@host/databaseThe application automatically uses DATABASE_URL when the Hyperdrive binding is not available.
If you use Hyperdrive with Wrangler-based commands, Wrangler also accepts a binding-specific local fallback connection string via CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE.
- Go to GitHub Settings > Developer settings > OAuth Apps
- Create a new OAuth App
- Set the callback URL to
https://yourdomain.com/api/oauth/callback - Request scopes:
read:user read:org - Copy the Client ID and Client Secret to your environment variables
Step 1: Create a Hyperdrive configuration (this securely stores your database credentials with Cloudflare):
npx wrangler login
npx wrangler hyperdrive create neon-leaderboard --connection-string="postgres://USER:PASS@HOST/DB"Step 2: Copy the returned Hyperdrive ID to wrangler.jsonc (replace <YOUR_HYPERDRIVE_ID>)
Step 3: Set secrets:
npx wrangler secret put GITHUB_CLIENT_ID
npx wrangler secret put GITHUB_CLIENT_SECRET
npx wrangler secret put TOKEN_ENCRYPTION_KEY
npx wrangler secret put SESSION_SECRET
npx wrangler secret put CRON_SECRETStep 4: Set a direct Postgres connection string for Wrangler's Hyperdrive bootstrap in local/CI environments.
For local wrangler dev, add this to .dev.vars or your shell:
CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE=postgresql://user:password@host/databaseFor Cloudflare Workers Builds / CI deploys, add the same variable as an environment variable or secret in the Cloudflare dashboard. OpenNext's deploy flow calls Wrangler's platform proxy before the real remote deploy, and Wrangler requires this local Hyperdrive fallback even when the target deployment is production.
Step 5: Deploy:
npm run deployFull API documentation is available at /api on any running instance. Available at this link for the official docs.
| Endpoint | Description | Rate Limit |
|---|---|---|
GET /api/leaderboard |
Paginated leaderboard | 60/min, 1000/day |
GET /api/user/{login} |
Lookup user by username | 20/min, 200/day |
GET /api/rank/{n} |
Get user at rank N | 20/min, 200/day |
GET /api/badge/{login} |
SVG rank badge (.svg optional) |
20/min, 200/day |
{
"version": 8,
"generatedAt": "2026-03-02T14:00:00.000Z",
"startingRank": 1,
"nextCursor": "eyJjb21taXRzIjoxMjM0LCJnaXRodWJJZCI6NDJ9",
"data": [
{
"rank": 1,
"githubId": 12345,
"login": "octocat",
"name": "The Octocat",
"avatarUrl": "https://avatars.githubusercontent.com/u/12345",
"profileUrl": "https://github.com/octocat",
"allTimeCommits": 15234,
"lastUpdatedAt": "2026-03-01T12:00:00.000Z"
}
]
}- Frontend: Next.js 15 with React 19, GitHub Primer UI components
- Backend: Next.js API routes running on Cloudflare Workers
- Database: PostgreSQL (Neon) with Hyperdrive connection pooling
- Authentication: GitHub OAuth with encrypted token storage
- Scheduling: Cloudflare Workers Cron Triggers for automatic refresh
- On first connection, the system computes all-time commits by querying GitHub's GraphQL API in yearly windows from account creation to present
- Both
totalCommitContributions(public) andrestrictedContributionsCount(private) are summed - Subsequent refreshes only query the delta since the last check
- Organization commits require explicit OAuth grant from the user
src/
app/ # Next.js App Router pages
api/ # API routes and documentation page
connect/ # OAuth consent page
components/ # React components
lib/ # Core business logic
db.ts # Database operations
github.ts # GitHub API integration
crypto.ts # Token encryption
scripts/
migrate.mjs # Database migration runner
refresh-user.ts # Manual user refresh utility
db/
migrations/ # SQL migration files
Anonymized, aggregate data from the official leaderboard may be used for research purposes. Individual contribution counts are public by nature of the leaderboard, but no personally identifiable information beyond public GitHub profile data is collected or shared.
If you are a researcher interested in collaboration, please open an issue.
Contributions are welcome. Please read the Contributing Guidelines before submitting a pull request.
This project is licensed under the MIT License. See LICENSE for details.
For security concerns, please review our Security Policy and report vulnerabilities responsibly.