A serverless GitHub statistics dashboard that displays your contribution metrics and activity graph.
- Real-time contribution data from GitHub API
- Current and longest streak tracking
- 90-day activity graph
- Auto-updating every 4 hours
- Automatic dark/light theme switching
- Install dependencies
npm install-
Get GitHub Token (recommended)
- Go to https://github.com/settings/tokens
- Generate new token (classic)
- Select
read:userscope - Copy the token
-
Deploy to Vercel
npm i -g vercel
vercel- Add environment variable
- Go to Vercel Dashboard → Your Project → Settings → Environment Variables
- Add:
GITHUB_TOKENwith your token value - Redeploy
https://your-project.vercel.app/api/stats?username=YOUR_USERNAME
CHANGE your-project to specific vercel project name
CHHANGE YOUR_USERNAME to your username
If you get a 404 error:
- Ensure
api/stats.jsis in the correct location - Check URL format:
/api/stats?username=... - Verify deployment logs in Vercel dashboard
- Fetches data from GitHub GraphQL API
- Calculates streaks by analyzing contribution history
- Generates SVG with embedded CSS for theme switching
- Caches for 4 hours to reduce API calls
- Without token: 60 requests/hour
- With token: 5,000 requests/hour