A web platform built with Next.js (App Router) + NextAuth + Firebase Firestore that authenticates users via GitHub and displays a real-time ranking based on actual contribution data.
- 🔐 GitHub OAuth login (NextAuth)
- 🔎 Real-time contribution tracking via GitHub API:
- Commits
- Pull Requests
- Issues
- Code Reviewsa
- Project Diversity
- Active Days
- 📊 Automatic score calculation based on weighted criteria
- 🏆 Real-time public leaderboard
- 👤 Private profile page with user-specific stats
- 🔄 Auto-sync every 24 hours + manual sync (up to 3x/day)
- Next.js 13+ (App Router)
- Tailwind CSS
- Firebase Firestore
- NextAuth.js (GitHub OAuth)
- GitHub REST API v3
- Clone the repository:
git clone https://github.com/your-username/github-ranking.git
cd github-ranking- Create
.env.localand add:
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
NEXTAUTH_SECRET=your_secret
NEXTAUTH_URL=http://localhost:3000
NEXT_PUBLIC_FIREBASE_API_KEY=...
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=...
NEXT_PUBLIC_FIREBASE_PROJECT_ID=...
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=...
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=...
NEXT_PUBLIC_FIREBASE_APP_ID=...- Install dependencies and start dev server:
npm install
npm run dev- 📅 User data is updated automatically once every 24 hours
- 🔘 Users can trigger up to 3 manual updates per day
- 🔒 All data is cached in Firestore to avoid GitHub API overuse
├── app/
│ ├── profile/
│ ├── ranking/
├── lib/
│ ├── firestore-user.ts ← leaderboard logic + syncing
│ ├── github/
│ │ └── getUserStats.ts ← GitHub API integration
├── components/ ← UI components
| Criteria | Weight (%) |
|---|---|
| Commits | 40% |
| Pull Requests | 25% |
| Issues | 15% |
| Code Reviews | 10% |
| Project Diversity | 5% |
| Active Days | 3% |
| Streak (coming) | 2% |
- 🧩 Contribution streak tracking
- 🕒 CRON-based background sync (Firebase Functions)
- 📈 Personal dashboard with history
This project is licensed under the MIT License.