A self-hosted GitHub Pages hackathon platform that lets you conduct a hackathon on your project with charts, leaderboards, and prizes!
- π Real-time Leaderboards - Automatically track and rank contributors based on merged pull requests
- π Activity Charts - Visualize pull request activity over time with beautiful charts
- π Prize Management - Showcase prizes and awards for top contributors
- π€ Sponsor Display - Highlight your hackathon sponsors
- π± Responsive Design - Works perfectly on desktop and mobile devices
- π Zero Backend - Runs entirely on GitHub Pages using GitHub API
- β‘ Easy Setup - Just edit a config file and deploy!
git clone https://github.com/OWASP-BLT/BLT-Hackathon.git
cd BLT-HackathonEdit js/config.js and customize the following:
const HACKATHON_CONFIG = {
name: "Your Hackathon Name",
description: "Your hackathon description...",
startTime: "2024-01-01T00:00:00Z",
endTime: "2024-01-31T23:59:59Z",
github: {
token: "", // Optional: Add a GitHub token to avoid rate limits
repositories: [
"owner/repo1",
"owner/repo2"
]
},
prizes: [
{
position: 1,
title: "First Place",
description: "Amazing prize!",
value: "500"
}
// Add more prizes...
]
};- Push your changes to GitHub
- Go to your repository Settings β Pages
- Under "Source", select the branch you want to deploy (usually
main) - Your hackathon dashboard will be live at:
https://your-username.github.io/BLT-Hackathon/
name: "My Awesome Hackathon"
description: "Join us for an exciting coding competition!"
startTime: "2024-01-01T00:00:00Z" // ISO 8601 format
endTime: "2024-01-31T23:59:59Z" // ISO 8601 formatgithub: {
token: "", // Optional but recommended
repositories: [
"facebook/react",
"microsoft/vscode"
]
}GitHub Token (Recommended):
- Go to GitHub Settings β Tokens
- Create a new token with
public_reposcope - Add it to the config to avoid API rate limits (60 requests/hour without token, 5000 with token)
prizes: [
{
position: 1, // 1, 2, 3, or 4 (special prize)
title: "First Place",
description: "Cash prize and swag!",
value: "500" // Optional: display monetary value
}
]sponsors: [
{
name: "Company Name",
level: "gold", // platinum, gold, silver, bronze, or partner
logo: "images/sponsor-logo.png",
website: "https://example.com"
}
]display: {
showRepoStats: true,
maxLeaderboardEntries: 10,
showPRsInLeaderboard: true
}Replace the gradient banner with a custom image by modifying index.html:
<div class="relative rounded-lg overflow-hidden mb-8 h-64"
style="background-image: url('images/banner.jpg'); background-size: cover;">The dashboard uses Tailwind CSS. Main brand colors can be changed by replacing red-600 and red-700 classes with your preferred color:
red-600βblue-600,green-600,purple-600, etc.red-700βblue-700,green-700,purple-700, etc.
The dashboard uses Tailwind CSS via CDN for simplicity. For production, you can optimize by:
- Installing Tailwind CLI:
npm install -D tailwindcss - Creating a
tailwind.config.jsfile - Building a custom CSS file with only used classes
- Replacing the CDN link with your custom CSS
This can reduce the CSS from ~3MB to ~10KB.
- Create an
imagesfolder in your repository - Add sponsor logo files
- Reference them in the config:
logo: "images/sponsor-logo.png"
- GitHub API Integration: The dashboard fetches pull request data from specified repositories using the GitHub REST API
- Client-Side Processing: All data processing happens in the browser - no backend needed!
- Real-Time Updates: Data is cached for 5 minutes to balance freshness with API rate limits
- Leaderboard Logic: Ranks contributors by the number of merged pull requests during the hackathon period
- β Pull requests created during the hackathon period
- β Pull requests merged during the hackathon period
- β Unique contributors (excludes bots)
- β Daily PR activity
- β Per-repository statistics
To run multiple hackathons:
- Create separate branches for each hackathon
- Configure GitHub Pages to deploy from different branches
- Each branch gets its own URL:
your-repo.github.io/branch-name/
- Add a
CNAMEfile to your repository with your domain - Configure DNS settings with your domain provider
- Enable custom domain in GitHub Pages settings
Add Google Analytics or other tracking by inserting the code before the closing </head> tag in index.html.
Simply open index.html in a web browser, or use a local server:
# Using Python 3
python -m http.server 8000
# Using Node.js
npx serve
# Visit http://localhost:8000BLT-Hackathon/
βββ index.html # Main HTML file
βββ js/
β βββ config.js # Hackathon configuration
β βββ github-api.js # GitHub API integration
β βββ main.js # Dashboard logic
βββ images/ # Optional: images and logos
βββ README.md
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Inspired by OWASP BLT hackathon functionality.
- Set Up GitHub Token: Avoid rate limits by using a personal access token
- Test Before Launch: Run a test hackathon with a short duration to verify everything works
- Communicate Rules Clearly: Use the rules section to set expectations
- Promote Your Hackathon: Share your hackathon dashboard link on social media
- Monitor Activity: Check the dashboard regularly during the hackathon
- Plan Prize Distribution: Have a clear plan for contacting winners
Q: How often does the leaderboard update?
A: Data is cached for 5 minutes. Refresh the page to get the latest updates.
Q: Can I track private repositories?
A: Yes, but you'll need a GitHub token with appropriate permissions.
Q: What counts as a valid contribution?
A: Only merged pull requests created or merged during the hackathon period are counted.
Q: Are bot accounts excluded?
A: Yes, accounts with "bot" in the name are automatically filtered out.
Q: Can I customize the design?
A: Absolutely! The HTML and CSS are fully customizable.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with β€οΈ by the OWASP BLT community