The Hyperswitch Leaderboard System is an advanced platform designed to recognize and incentivize external contributors by tracking their GitHub contributions in real-time. This dynamic system automates contribution tracking, assigns points, and provides comprehensive insights into community engagement.
- Automated GitHub Contribution Tracking
- Real-Time Leaderboard Updates
- Customizable Contributor Filtering
- Detailed User Profiles
- Admin Management Dashboard
- Frontend: React.js, Tailwind CSS
- Backend: Node.js, Express.js
- Database: Redis, Airtable
- Authentication: GitHub OAuth
- Containerization: Docker
Hyperswitch-Leaderboard/
│
├── Frontend/
│ ├── src/
│ │ ├── Components/
│ │ ├── Pages/
│ │ ├── App.jsx
│ │ └── main.jsx
│
├── Backend/
│ ├── config/
│ │ ├── airtableConfig.js
│ │ └── PassportConfig.js
│ ├── Controllers/
│ │ ├── LeaderboardController.js
│ │ └── UserController.js
│ ├── Routes/
│ │ ├── LeaderboardRoute.js
│ │ └── UserRoute.js
│ └── index.js
│
└── docker-compose.yaml
- Node.js (v14+)
- Docker & Docker Compose
- GitHub Personal Access Token
- Airtable Account
- Clone the repository
git clone https://github.com/Rushhaabhhh/Hyperswitch-Leaderboard.git
cd Hyperswitch-Leaderboard
- Build and start containers
docker-compose up --build
- Run the application
- Frontend: http://localhost:5173
- Backend: http://localhost:5000
Create a .env
file in the Backend directory with the following variables:
PORT=5000
REDIS_URL=redis://localhost:6379
AIRTABLE_API_KEY=your_airtable_api_key
AIRTABLE_BASE_ID=your_airtable_base_id
GITHUB_TOKEN=your_github_token
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
SESSION_SECRET=your_session_secret
Create a .env
file in the Frontend directory:
REACT_APP_API_BASE_URL=http://localhost:5000
REACT_APP_GITHUB_OWNER=your_github_owner
REACT_APP_GITHUB_REPO=your_github_repo
-
Fetch Repository Data
- GET
/leaderboard/:owner/:repo/:userType
- Query Parameters:
startDate
,endDate
,sort
- GET
-
Update User Points
- PATCH
/leaderboard/points/:username
- Request Body:
{ "points": 50 }
- PATCH
-
GitHub Login
- GET
/user/github
- GET
-
Get User Profile
- GET
/user/profile
- GET
-
Update User Profile
- PUT
/user/profile
- PUT
-
Get Admins
- GET
/auth/get-admin
- GET
-
Assign Admin Role
- POST
/auth/assign-admin
- Request Body:
{ "username": "user123" }
- POST
-
Remove Admin Role
- DELETE
/auth/remove-admin
- Request Body:
{ "username": "user123" }
- DELETE
- GithubId: Unique GitHub identifier
- Username: Contributor username
- Profile Link: GitHub profile URL
- Role: User role (Admin/Contributor)
- Username: User's username
- UserType: User type
- ContributionType: Contribution category
- Points: Awarded points
- Date: Contribution date