A self-hosted GitHub Pages hackathon platform that lets you conduct a hackathon on your project with charts, leaderboards, and prizes!
- π― Multiple Hackathons - Host multiple hackathons with individual pages and a unified index
- π 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!
For a single hackathon, edit js/config.js:
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"
]
}
};Then open hackathon.html directly.
For multiple hackathons, edit js/hackathons-config.js:
const HACKATHONS_CONFIG = {
hackathons: [
{
slug: "hackathon-2024", // Unique identifier for URL
name: "Hackathon 2024",
description: "Description...",
startTime: "2024-01-01T00:00:00Z",
endTime: "2024-01-31T23:59:59Z",
github: {
token: "",
repositories: ["owner/repo1"]
}
},
// Add more hackathons...
]
};Your main page (index.html) will show all hackathons, and each hackathon will have its own page at hackathon.html?slug=hackathon-2024.
- Push your changes to GitHub
- Go to your repository Settings β Pages
- Under "Source", select the branch you want to deploy (usually
main) - Your hackathon platform 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"
]
}New: Organization Support
You can now track all repositories in a GitHub organization instead of listing them individually:
github: {
token: "",
organization: "OWASP-BLT", // Track all repos in this organization
repositories: [] // Can still add specific repos if needed
}When an organization field is specified, the system will automatically fetch all repositories from that organization and track them for the hackathon. You can combine this with explicit repositories if needed.
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
The platform now supports hosting multiple hackathons on a single deployment:
- Configure multiple hackathons in
js/hackathons-config.js - Each hackathon gets a unique slug used in the URL (e.g.,
hackathon.html?slug=blt-2024) - Main index page at
/lists all hackathons with filtering by status (ongoing, upcoming, ended) - Individual hackathon pages accessible via slug show full dashboard with stats and leaderboard
Example configuration:
const HACKATHONS_CONFIG = {
hackathons: [
{
slug: "winter-2024",
name: "Winter Hackathon 2024",
// ... other config
},
{
slug: "spring-2024",
name: "Spring Hackathon 2024",
// ... other config
}
]
};- 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 both index.html and hackathon.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 page listing all hackathons
βββ hackathon.html # Individual hackathon dashboard
βββ js/
β βββ config.js # Single hackathon configuration (legacy)
β βββ hackathons-config.js # Multiple hackathons configuration
β βββ index.js # Index page logic
β βββ 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