Git Stats

A highly customizable GitHub & LeetCode Git Stats generator

Enter and Generate

Choose which platform you want

Fetching your GitHub stats...

Add to Your GitHub Profile

Copy and paste the markdown code below to your GitHub profile README:

GitHub Stats

![GitHub Stats](https://git-stats.harikrishnan.tech/api/github-status?username=YOUR_USERNAME)

LeetCode Stats

![LeetCode Stats](https://git-stats.harikrishnan.tech/api/leetcode-status?username=YOUR_USERNAME)

Replace YOUR_USERNAME with your actual username for each platform

About Git Stats

Everything you need to know about this project

Features

Real-time Data

Fetches live GitHub user data using the GitHub GraphQL API and LeetCode stats via public API

Highly Customizable

Generate SVG images with custom color schemes, configurations, and animated elements

Comprehensive Metrics

Displays commits, language usage, repositories, stars for GitHub and problems solved, ranking for LeetCode

Consistent Algorithm

Uses the same ranking algorithm as anuraghazra/github-readme-stats for standardized results

Fast & Lightweight

Optimized SVG generation for quick loading

Multiple Themes

Support for various color themes and styles for both platforms

Deployment

Since the GitHub API only allows 5k requests per hour, the public API provided by this repo could possibly hit the rate limiter. You can host your own instance of this repo on Vercel to avoid rate limiting issues. LeetCode stats use public API with no rate limits.

Manual Deployment

1. Fork and Prepare the Repository

  • Fork this repository to your GitHub account
  • Create a Personal Access Token (PAT)
    • Set the token name (e.g., "git-stats")
    • Select scopes: repo and user
    • Copy the generated token (you won't see it again so save it!)

2. Deploy to Vercel

  • Visit Vercel
  • Sign up/Log in with your GitHub account
  • From your Vercel dashboard:
    • Click Add New...Project
    • Select the forked repository
    • Click Import

3. Configure Environment Variables

  • In the project configuration screen:
    • Expand the Environment Variables section
    • Add a new variable:
      • Name: GITHUB_TOKEN
      • Value: Your GitHub PAT from step 1
  • Click Deploy

4. Using Your Instance

Once deployed, Vercel will provide you with a domain (e.g., your-project.vercel.app)

https://your-project.vercel.app/api/github-status?username=YOUR_GITHUB_USERNAME
https://your-project.vercel.app/api/leetcode-status?username=YOUR_LEETCODE_USERNAME

Customization Options

You can customize the appearance of both GitHub and LeetCode SVGs by modifying query parameters of the config.js file.

Available Endpoints

  • /api/github-status - GitHub user statistics
  • /api/leetcode-status - LeetCode user statistics

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Areas for Contribution

  • New themes and color schemes
  • Additional statistics and metrics
  • Performance improvements
  • Bug fixes and optimizations

Rank Calculator

Understanding how GitHub user ranks are calculated

How Ranking Works

The ranking algorithm uses a weighted combination of various GitHub metrics to calculate a user's percentile rank. Each metric is normalized using statistical functions and then weighted according to its importance.

Metric Weights & Medians

Commits

Weight: 2
Median: 250 (or 1000 if all commits included)

Pull Requests

Weight: 3
Median: 50

Stars

Weight: 4
Median: 50

Issues

Weight: 1
Median: 25

Reviews

Weight: 1
Median: 2

Followers

Weight: 1
Median: 10

Repositories

Weight: 1
Median: 3

Calculate Your Rank

Enter your GitHub stats to see what rank you would get:

Rank: C
Percentile: 0.0%

Algorithm Implementation

The ranking calculation uses two key statistical functions:

Exponential CDF

function exponential_cdf(x) { return 1 - 2 ** -x; }

Used for: Commits, Pull Requests, Issues, and Reviews

Log Normal CDF

function log_normal_cdf(x) { // approximation return x / (1 + x); }

Used for: Stars, Followers, and Repositories

Rank Levels

Based on percentile thresholds:

  • A++: Top 1%
  • A+: Top 12.5%
  • A: Top 25%
  • A-: Top 37.5%
  • B+: Top 50%
  • B: Top 62.5%
  • B-: Top 75%
  • C+: Top 87.5%
  • C: Bottom 12.5%