Skip to content
Β 
Β 

Repository files navigation

πŸ“Š GitHubStats

Showcase and share your GitHub story β€” as beautiful, downloadable images.

Enter any GitHub username to reveal contributions, account age, active days, streaks, top languages and more. Every card can be shared or exported as an image.

Live License: MIT Next.js React TypeScript PRs Welcome

Live demo Β· Report a bug Β· Request a feature


Table of contents

Features

  • 🟩 Contribution graph β€” full account history, GitHub-style heatmap with a year selector dropdown
  • πŸ“Š Contribution breakdown β€” view your activity year / month / week / day wise with a toggle
  • πŸ† Top repositories β€” your top 5 repos ranked by commits (all-time with a token, recent activity otherwise)
  • πŸ”’ Total contributions across commits, PRs, issues & reviews
  • πŸ“… Account age β€” years and exact days since the account was created
  • πŸ”₯ Active days β€” how many days actually had contributions (the "green" days), shown as a percentage
  • ⚑ Streaks β€” longest and current streak, plus your busiest day ever
  • πŸ‘₯ Followers, repos & total stars earned across public repositories
  • 🧩 Top languages with the official GitHub color palette and a proportional bar
  • πŸ–ΌοΈ Share any card as an image β€” native share sheet on supported devices, crisp 2Γ— PNG download everywhere else
  • πŸŒ™ GitHub dark theme UI, fully responsive
  • πŸ”“ No login, no database β€” works with zero secrets

Screenshots

Add screenshots or a GIF here once deployed.

docs/screenshot-dashboard.png
docs/screenshot-card.png

How it works

The data is fetched server-side in a Next.js Route Handler and cached at the edge, so repeat lookups are fast and rate-limit friendly.

Tech stack

Layer Choice
Framework Next.js 15 (App Router)
UI React 19, TypeScript, plain CSS (GitHub dark)
Data GitHub REST API + github-contributions-api
Image export html-to-image
Hosting Vercel

Getting started

Prerequisites

  • Node.js 18.18 or newer
  • npm (ships with Node)

Installation

# 1. Clone
git clone https://github.com/PATILYASHH/githubstats.git
cd githubstats

# 2. Install dependencies
npm install

# 3. Start the dev server
npm run dev

Open http://localhost:3000 and enter a username.

Scripts

Command Description
npm run dev Start the development server
npm run build Create a production build
npm start Run the production build
npm run lint Lint the codebase

Configuration

The app works with no environment variables. The only optional setting raises GitHub's unauthenticated rate limit (~60 requests/hour per IP):

Variable Required Description
GITHUB_TOKEN No A GitHub token (no scopes needed) to raise the API rate limit.

Create a .env.local file for local development:

GITHUB_TOKEN=ghp_your_personal_access_token

A classic token with no scopes (public data only) is enough.

Deploy

This is a standard Next.js App Router project. Deploy to Vercel in a few clicks:

  1. Push your fork to GitHub.
  2. Import the repository at vercel.com/new.
  3. (Optional) add GITHUB_TOKEN under Project β†’ Settings β†’ Environment Variables.
  4. Deploy. πŸŽ‰

Deploy with Vercel

API

A single JSON endpoint powers the dashboard.

GET /api/stats?username=<github-username>

Example

curl "https://githubstatss.vercel.app/api/stats?username=torvalds"

Response (truncated)

{
  "user": { "login": "torvalds", "name": "Linus Torvalds", "createdAt": "2011-09-03T..." },
  "contributions": {
    "total": 37404,
    "activeDays": 5109,
    "trackedDays": 5844,
    "accountAgeDays": 5407,
    "longestStreak": 98,
    "currentStreak": 0,
    "days": [{ "date": "2011-09-03", "count": 0, "level": 0 }]
  },
  "languages": [{ "name": "C", "count": 8, "percentage": 88.9, "color": "#555555" }],
  "totalStars": 248732
}

Errors return { "error": "message" } with an appropriate status (400, 404, 403, 500).

Project structure

githubstats/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/stats/route.ts     # JSON endpoint (server-side GitHub fetch)
β”‚   β”œβ”€β”€ globals.css            # GitHub dark theme styles
β”‚   β”œβ”€β”€ layout.tsx             # Root layout + metadata
β”‚   └── page.tsx               # Home page + dashboard
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ContributionGraph.tsx  # Heatmap + year selector
β”‚   β”œβ”€β”€ ShareCard.tsx          # Card wrapper + share-as-image
β”‚   └── icons.tsx              # Inline SVG icons
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ colors.ts              # Language & heatmap color palettes
β”‚   β”œβ”€β”€ github.ts              # Data fetching & aggregation
β”‚   └── types.ts               # Shared TypeScript types
└── ...

Roadmap

  • Light theme toggle
  • Per-card theme/color customization
  • Compare two users side by side
  • OG image generation for shared profile links
  • More cards (top repos, commit-time heatmap)

See open issues for the full list.

Contributing

Contributions are what make open source great. Please read CONTRIBUTING.md and our Code of Conduct before opening a PR.

  1. Fork the project
  2. Create your branch (git checkout -b feature/amazing-card)
  3. Commit your changes (git commit -m 'Add amazing card')
  4. Push (git push origin feature/amazing-card)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for details.

Acknowledgements


Built with ❀️ by Yash Patil · githubstatss.vercel.app

About

πŸ“Š Showcase and share your GitHub story β€” contribution graph, account age, active days, streaks & top languages, exportable as images. Live: githubstatss.vercel.app

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages