Skip to content

PATILYASHH/githubstats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ“Š 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

  • πŸ”— Shareable profile pages β€” every user gets a clean URL (/username) with a dynamic OG image, so pasted links auto-unfurl into a rich stats card on Twitter / LinkedIn / WhatsApp
  • πŸͺͺ Dev Card β€” one combined hero card (avatar + rank + key stats + mini heatmap) with 5 gradient themes, made to share as a single image
  • πŸ₯· Developer rank β€” a fun tier (Code Explorer β†’ Open-Source Legend) computed from your stats
  • πŸ… Achievements & badges β€” 23 unlockable badges with a rarity system (common β†’ legendary). Each badge has its own shareable link (/badge/username/id) that unfurls into a sticker image, Holopin-style
  • 🎯 Missions β€” locked achievements shown as goals with live progress bars
  • πŸ“ˆ Charts β€” a languages donut and a monthly "contribution trend" area chart
  • βš”οΈ Compare two developers side by side with a winner β€” shareable via link (/compare?a=…&b=…)
  • 🟩 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
  • πŸ“… When you code β€” your contribution rhythm across the week
  • πŸ† Top repositories β€” your top 5 repos ranked by commits (all-time with a token, recent activity otherwise)
  • πŸ”’ Total contributions, account age, active days %, streaks, followers, repos & stars
  • 🧩 Top languages with the official GitHub color palette
  • πŸ–ΌοΈ Share any card as an image β€” native share sheet on supported devices, crisp 2Γ— PNG download everywhere else
  • ✨ Polished, interactive UI β€” count-up numbers, animated bars, hover effects, a confetti burst πŸŽ‰ and copy-link sharing
  • πŸŒ™ GitHub dark theme, 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

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors