https://github.com/yashab-cyber/gitrank
Real-time GitHub ranking badge generator - Generate dynamic SVG badges that show your GitHub ranking based on stars, forks, followers, or commits!
https://github.com/yashab-cyber/gitrank
coder developer git github
Last synced: 6 days ago
JSON representation
Real-time GitHub ranking badge generator - Generate dynamic SVG badges that show your GitHub ranking based on stars, forks, followers, or commits!
- Host: GitHub
- URL: https://github.com/yashab-cyber/gitrank
- Owner: yashab-cyber
- License: mit
- Created: 2025-08-11T23:42:58.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-08-12T00:51:45.000Z (8 months ago)
- Last Synced: 2025-08-12T02:37:51.964Z (8 months ago)
- Topics: coder, developer, git, github
- Language: JavaScript
- Homepage: https://www.zehrasec.com
- Size: 89.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-HACKER.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
- Support: SUPPORT.md
Awesome Lists containing this project
README
# GitRank Live - Hacker Edition โก

[](LICENSE)
[](https://nodejs.org)
### ๐จ **Real-time GitHub ranking badges with hacker-style design**
*Generate dynamic SVG badges that show your GitHub ranking with neon colors, rounded corners, and the iconic Octocat*
---
## ๐ฅ **What's New in Hacker Edition**
- **๐จ Dark Theme**: Sleek hacker-style badges with neon green/cyan accents
- **โ๏ธ Light Theme**: Clean light mode for versatile usage
- **๐ง JSON API**: RESTful endpoint for developers to fetch raw ranking data
- **โก Enhanced Design**: Rounded corners, GitHub Octocat icon, improved typography
- **๐ป Monospace Fonts**: Terminal-friendly font stack for that authentic hacker look
---
## ๐ **Quick Start**
### ๐ **Embed Your GitHub Rank**
```markdown




```
### ๐จ **Badge Styles Showcase**
| Style | Dark Theme | Light Theme |
|-------|------------|-------------|
| **flat** | `?style=flat&theme=dark` | `?style=flat&theme=light` |
| **flat-square** | `?style=flat-square&theme=dark` | `?style=flat-square&theme=light` |
| **for-the-badge** | `?style=for-the-badge&theme=dark` | `?style=for-the-badge&theme=light` |
| **plastic** | `?style=plastic&theme=dark` | `?style=plastic&theme=light` |
---
## ๐ **Developer API**
### ๐ **JSON Endpoint**
Get raw ranking data for your applications:
```bash
# Badge Generation (SVG)
curl "https://gitrank.zehrasec.com/api/badge?user=USERNAME&metric=stars&theme=dark"
# Raw Data (JSON)
curl "https://gitrank.zehrasec.com/api/rank?user=USERNAME&metric=stars"
# User Stats
curl "https://gitrank.zehrasec.com/api/stats/USERNAME"
# System Health
curl "https://gitrank.zehrasec.com/health"
```
```json
{
"user": {
"login": "octocat",
"name": "The Octocat",
"avatar_url": "https://github.com/images/error/octocat_happy.gif"
},
"metric": {
"name": "stars",
"value": 8123,
"formatted": "8.1K"
},
"ranking": {
"percentile": 95,
"description": "Top 5%",
"tier": "expert",
"badge_color": "#ff8500"
},
"benchmarks": {
"next_tier": {
"name": "Top 1%",
"value": 10000,
"needed": 1877
}
},
"all_metrics": {
"stars": 8123,
"forks": 2543,
"followers": 4567,
"commits": 1234
}
}
```
### ๐ ๏ธ **API Endpoints**
| Endpoint | Description | Response |
|----------|-------------|-----------|
| `GET /api/badge` | Generate SVG badge | `image/svg+xml` |
| `GET /api/rank` | Get ranking data | `application/json` |
| `GET /api/stats/:user` | Get user statistics | `application/json` |
| `GET /health` | Health check | `application/json` |
---
## โ๏ธ **Parameters**
### ๐ฏ **Badge Generation**
```
GET /api/badge?user={username}&metric={metric}&style={style}&theme={theme}
```
| Parameter | Required | Options | Default | Description |
|-----------|----------|---------|---------|-------------|
| `user` | โ
| Any GitHub username | - | Target GitHub user |
| `metric` | โ | `stars`, `forks`, `followers`, `commits` | `stars` | Ranking metric |
| `style` | โ | `flat`, `flat-square`, `for-the-badge`, `plastic` | `flat` | Badge style |
| `theme` | โ | `dark`, `light` | `dark` | Color theme |
| `country` | โ | Country name | - | Regional ranking |
### ๐ **JSON API**
```
GET /api/rank?user={username}&metric={metric}
```
---
## ๐จ **Design Features**
### ๐ **Dark Theme (Hacker Style)**
- **Background**: Deep space black (`#0d1117`)
- **Accents**: Neon green (`#00ff7f`) and cyan (`#00ffff`)
- **Typography**: Monospace fonts for terminal aesthetic
- **Effects**: Subtle glowing borders and text shadows
### โ๏ธ **Light Theme**
- **Background**: Clean white (`#ffffff`)
- **Accents**: GitHub blue (`#0969da`)
- **Typography**: Same monospace fonts for consistency
- **Effects**: Subtle shadows and clean borders
### ๐ฏ **Visual Elements**
- **๐ Octocat Icon**: Positioned on the left side of each badge
- **๐ Metric Display**: Clear metric name and ranking
- **๐ข Value Formatting**: Smart number formatting (1.2K, 5.6M)
- **๐ Tier Colors**: Color-coded ranking tiers
---
## ๐ **Ranking System**
| Tier | Percentile | Color (Dark) | Color (Light) | Requirements |
|------|------------|--------------|---------------|--------------|
| **Top 1%** | 99th |  Neon Pink |  Red | โญ10K+ stars, ๐ฅ5K+ followers |
| **Top 5%** | 95th |  Neon Orange |  Orange | โญ2K+ stars, ๐ฅ1K+ followers |
| **Top 10%** | 90th |  Cyan |  Blue | โญ500+ stars, ๐ฅ300+ followers |
| **Top 25%** | 75th |  Neon Green |  Green | โญ100+ stars, ๐ฅ50+ followers |
| **Top 50%** | 50th |  Purple |  Purple | โญ20+ stars, ๐ฅ10+ followers |
---
## ๐ **Installation & Deployment**
### ๐ป **Local Development**
```bash
# 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
# Add your GitHub token (optional but recommended)
# Start development server
npm run dev
```
### ๐ณ **Docker**
```bash
# Build and run
docker build -t gitrank .
docker run -p 3000:3000 --env-file .env gitrank
# Or use Docker Compose
docker-compose up
```
### โ๏ธ **Cloud Deployment**
#### **Vercel** (Recommended)
[](https://vercel.com/new/clone?repository-url=https://github.com/yashab-cyber/gitrank)
#### **Railway**
[](https://railway.app/new/template?template=https://github.com/yashab-cyber/gitrank)
#### **Render**
1. Connect your GitHub repository
2. Set build command: `npm install`
3. Set start command: `npm start`
4. Add environment variables
---
## ๐ **Usage Examples**
### ๐ **Personal Profile README**
```markdown
# Hi there! I'm [Your Name] ๐
## ๐ My GitHub Rankings



*Real-time rankings updated every 12 hours*
```
### ๐ข **Repository Badges**
```markdown
## ๐จโ๐ป Maintainer Stats
[](https://github.com/maintainer)
[](https://github.com/maintainer)
```
### ๐ **HTML Integration**
```html
```
---
## ๐ง **Configuration**
### ๐ **Environment Variables**
```bash
# Required
PORT=3000 # Server port
NODE_ENV=production # Environment
# Optional (Recommended)
GITHUB_TOKEN=your_token # Personal access token for higher rate limits
CACHE_TTL=43200 # Cache duration (12 hours)
RATE_LIMIT_WINDOW=3600000 # Rate limit window (1 hour)
RATE_LIMIT_MAX=1000 # Max requests per window
```
### โก **Performance**
- **Caching**: 12-hour intelligent caching reduces API calls by 95%
- **Rate Limiting**: 1000 requests/hour per IP
- **CDN Ready**: Perfect for global deployment with edge caching
- **Response Time**: Sub-500ms response times with caching
---
## ๐งช **Testing**
```bash
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific tests
npm test tests/ranking.test.js
```
---
## ๐ค **Contributing**
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
1. **Fork** the repository
2. **Create** a feature branch: `git checkout -b feature/amazing-feature`
3. **Commit** your changes: `git commit -m 'Add amazing feature'`
4. **Push** to the branch: `git push origin feature/amazing-feature`
5. **Open** a Pull Request
---
## ๐ **API Rate Limits**
| Authentication | Requests/Hour | GitHub API Limit |
|----------------|---------------|------------------|
| **No Token** | 60 | GitHub's IP-based limit |
| **With Token** | 5,000 | GitHub's authenticated limit |
| **Cached Responses** | Unlimited | Served from cache |
---
## ๐ **Showcase**
### ๐ฏ **Live Examples**




---
## ๐ **License**
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## ๐ **Acknowledgments**
- **GitHub** for the excellent API and Octocat mascot
- **Open Source Community** for inspiration and feedback
- **Terminal Culture** for the hacker aesthetic inspiration
- **Contributors** who make this project better
---
## ๐ **Support & Community**
### ๐ **Star this repo if it helped you!**
[](https://github.com/yashab-cyber/gitrank/stargazers)
[](https://github.com/yashab-cyber/gitrank/network/members)
**[๐ฌ Discussions](https://github.com/yashab-cyber/gitrank/discussions) โข [๐ Issues](https://github.com/yashab-cyber/gitrank/issues) โข [โจ Feature Requests](https://github.com/yashab-cyber/gitrank/discussions)**
---
**Made with โก by hackers, for hackers**
*Keep coding, keep ranking* ๐