Real-time GitHub ranking badge generator - Generate dynamic SVG badges that show your GitHub ranking based on stars, forks, followers, or commits!
- π Real-time GitHub ranking - Compare your stats against millions of developers
- π Multiple metrics - Stars, forks, followers, and commits
- π¨ Customizable badges - 4 different styles (flat, flat-square, for-the-badge, plastic)
- π Country-based ranking - Optional regional comparisons
- β‘ Lightning fast - Responds in under 500ms with smart caching
- π Rate-limited - Respects GitHub API limits with intelligent caching
- π Zero-config deployment - Ready for Vercel, Railway, or Docker

# Clone the repository
git clone https://github.com/yashab-cyber/gitrank.git
cd gitrank
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env and add your GitHub token (optional but recommended)
# Start the server
npm run dev# Build and run with Docker
docker build -t gitrank .
docker run -p 3000:3000 --env-file .env gitrank
# Or use Docker Compose
docker-compose upGET /api/badge?user={username}&metric={metric}&style={style}&country={country}
Parameters:
user(required): GitHub usernamemetric(optional):stars|forks|followers|commits(default:stars)style(optional):flat|flat-square|for-the-badge|plastic(default:flat)country(optional): Country name for regional ranking
Response: SVG badge with caching headers
GET /api/stats/{username}
Returns detailed user statistics in JSON format.
GET /api/ranking-info
Returns information about ranking algorithms and percentiles.
GitRank Live calculates percentiles based on these benchmarks:
| Metric | Top 1% | Top 5% | Top 10% | Top 25% | Top 50% |
|---|---|---|---|---|---|
| Stars | 10,000+ | 2,000+ | 500+ | 100+ | 20+ |
| Forks | 2,000+ | 500+ | 100+ | 25+ | 5+ |
| Followers | 5,000+ | 1,000+ | 300+ | 50+ | 10+ |
| Commits | 2,000+ | 500+ | 200+ | 50+ | 20+ |
Add country-specific rankings by including the country parameter:

Supported countries: United States, China, India, Germany, United Kingdom, Canada, France, Japan, Brazil, Russia, and more.
- Smart caching: User data cached for 12 hours
- Rate limiting: 1000 requests per hour per IP
- GitHub API optimization: Efficient pagination and data fetching
- CDN ready: Perfect for global deployment
- Fork this repository
- Connect to Vercel
- Add environment variables:
GITHUB_TOKEN: Your GitHub personal access token (optional)
- Deploy!
- Connect your GitHub repository
- Set build command:
npm install - Set start command:
npm start - Add environment variables
docker build -t gitrank .
docker run -p 3000:3000 -e GITHUB_TOKEN=your_token gitrank# Required
PORT=3000 # Server port
NODE_ENV=production # Environment
# Optional
GITHUB_TOKEN=your_token # GitHub personal access token (recommended)
CACHE_TTL=43200 # Cache duration in seconds (12 hours)
RATE_LIMIT_WINDOW=3600000 # Rate limit window in ms (1 hour)
RATE_LIMIT_MAX=1000 # Max requests per window# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test file
npm test tests/api.test.js## π My GitHub Stats



## Team Rankings

GitRank Live handles GitHub API rate limits intelligently:
- Without token: 60 requests/hour per IP (GitHub limit)
- With token: 5,000 requests/hour (GitHub limit)
- Caching: 12-hour cache reduces API calls by 95%
- Smart batching: Efficient data fetching strategies
We welcome contributions! Please see our Contributing Guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- β¨ Initial release
- π GitHub ranking system
- π Four metrics: stars, forks, followers, commits
- π¨ Four badge styles
- π Country-based rankings
- β‘ Performance optimizations
- π Multi-platform deployment support
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub for providing the excellent API
- The open-source community for inspiration
- All contributors and users of GitRank Live
GitRank Live is created and maintained by Yashab Alam, Founder & CEO of ZehraSec.
- π» GitHub: @yashab-cyber
- πΈ Instagram: @yashab.alam
- πΌ LinkedIn: Yashab Alam
- π Website: www.zehrasec.com
- πΈ Instagram: @_zehrasec
- π Facebook: ZehraSec Official
- π¦ X (Twitter): @zehrasec
- πΌ LinkedIn: ZehraSec Company
- π¬ WhatsApp: Business Channel
Love GitRank Live? Your support helps maintain and improve this project!
π View Donation Options - Multiple payment methods available including crypto and PayPal
- π Bug reports: GitHub Issues
- π‘ Feature requests: GitHub Discussions
- π§ Email: support@gitrank.live
- π¬ Twitter: @GitRankLive
π Star this repository if you found it helpful!
Made with β€οΈ by Yashab Alam (@ZehraSec)