A fully decentralized platform for organizing, managing, and participating in blockchain-based hackathons
Features β’ Architecture β’ Installation β’ Usage β’ Smart Contracts β’ Contributing
- Overview
- Key Features
- Technology Stack
- Architecture
- Prerequisites
- Installation
- Project Structure
- Smart Contracts
- Frontend
- Configuration
- Development
- Testing
- Deployment
- Usage Guide
- Contributing
- License
HACKX is a revolutionary decentralized hackathon platform built on blockchain technology that brings transparency, fairness, and automation to the world of hackathons. It eliminates centralized control, ensures fair judging through a multi-faceted scoring system, and provides verifiable proof of participation through NFTs.
The platform combines:
- Smart Contracts for transparent hackathon management
- GitHub Integration for developer verification and project submissions
- Multi-Layered Judging combining judges, participant voting, and AI scoring
- NFTs for participation proof and achievements
- Soulbound Voting Tokens for democratic project evaluation
- Automated Reward Distribution based on performance
-
π Decentralized Hackathon Creation & Management
- Create hackathons with customizable parameters
- Set judging panels, timelines, and team constraints
- Automated lifecycle management (sponsorship β hacking β judging β rewards)
- Refundable creation fees based on participation thresholds
-
π₯ Team Formation & Management
- Create teams with metadata (name, description, image)
- Secure join codes for team privacy
- Support for teams of up to 6 members
- Team registration and staking system
-
π° Sponsorship System
- Open sponsorship periods for community funding
- Minimum sponsorship thresholds
- Transparent fund tracking
- Automated distribution to winners and organizers
-
π GitHub Verification (EIP-712)
- Cryptographic verification of GitHub accounts
- One-to-one wallet-to-GitHub binding
- Prevents Sybil attacks
- Verifiable developer identity
-
π Multi-Faceted Scoring System
- 40% Judge Score: Expert panel evaluation
- 35% Participant Vote: Democratic community voting
- 25% AI Score: Automated code quality analysis
- Transparent, weighted final scores
- Ranking system for prize distribution
-
π³οΈ Soulbound Voting Tokens
- Non-transferable ERC20 tokens for voting
- Equal voting power for all participants
- Prevents vote buying/selling
- Burned after voting completion
-
π¨ Participation NFTs
- ERC721 tokens with full metadata
- Include final scores and rankings
- Permanent proof of participation
- Shareable achievements
-
πΈ Automated Reward Distribution
- 80% to winners (proportional to scores)
- 15% to organizers
- 5% platform fee
- Stake refunds for all participants
- Modern UI/UX with Next.js 16 and React 19
- Dark/Light Mode support with theme-aware color system
- Responsive Design for all screen sizes
- Real-time Updates with optimistic UI patterns
- Wallet Integration via ThirdWeb
- GitHub OAuth for seamless verification
- IPFS Integration for decentralized metadata storage
- AI-Powered Analysis using Google Gemini
- Solidity ^0.8.20 - Smart contract language
- Hardhat 2.19 - Development environment
- OpenZeppelin Contracts 5.4 - Secure contract libraries
- EIP-712 - Typed structured data signing
- zkSync Era - Layer 2 scaling support
- Next.js 16 - React framework with App Router
- React 19 - UI library
- TypeScript 5 - Type safety
- Tailwind CSS 4 - Styling
- ThirdWeb SDK 5 - Web3 integration
- Better Auth 1.4 - Authentication
- Zustand 5 - State management
- Framer Motion 12 - Animations
- React Hook Form 7 - Form management
- Zod 4 - Schema validation
- IPFS/Pinata - Decentralized file storage
- Google Gemini AI - Code analysis
- Ethereum/Sepolia - Blockchain networks
- GitHub OAuth - Developer authentication
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js) β
β ββββββββββββββββ¬βββββββββββββββ¬βββββββββββββββββββββββββββ β
β β Pages β Components β Hooks & Utils β β
β β β’ Home β β’ Landing β β’ useGitHubVerification β β
β β β’ Hackathon β β’ Forms β β’ useTeamManagement β β
β β β’ Teams β β’ Modals β β’ Web3 Integration β β
β β β’ Profile β β’ UI β β’ IPFS Upload β β
β ββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββββββββββββββ β
ββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββ
β
β API Routes
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API Layer (Next.js) β
β β’ /api/auth/[...all] - Authentication β
β β’ /api/verify/* - GitHub verification β
β β’ /api/teams/* - Team management β
β β’ /api/analyze - AI code analysis β
β β’ /api/github/* - GitHub integration β
ββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββ
β
β Web3 Calls
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Smart Contracts (Solidity) β
β ββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββββββββββββ β
β β GLYTCHCore β GitHubVerifier β GLYTCHVotingToken β β
β β β’ Hackathons β β’ EIP-712 β β’ Soulbound β β
β β β’ Teams β β’ Verification β β’ Voting β β
β β β’ Submissions β β’ Nonce β β’ Distribution β β
β β β’ Scoring β β β β
β β β’ Rewards β β β β
β ββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β GLYTCHParticipationNFT (ERC721) β β
β β β’ Minting with metadata β β
β β β’ Scores and rankings β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Organizer β β Teams β β Judges β
β β β β β β
ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ
β β β
β 1. Create β β
β Hackathon β β
β β β
β β 2. Create Team β
β β & Register β
β β β
β β 3. Stake ETH β
β β β
β β 4. Receive β
β β Voting Tokens β
β β β
β β 5. Submit Project β
β β (AI Score) β
β β β
β β β 6. Submit
β β β Judge Scores
β β β
β β 7. Vote on Projects β
β β (Participant) β
β β β
β β β
β 8. Calculate Final Scores & Rankings β
β β
β 9. Distribute Rewards β
β β
β β 10. Mint NFTs β
β β β
βΌ βΌ βΌ
Complete Winners Participation
Get Rewards Proof NFT
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn or pnpm
- Git
- MetaMask or other Web3 wallet
- Ethereum Testnet ETH (Sepolia)
Optional:
- Hardhat knowledge for smart contract development
- IPFS/Pinata account for metadata storage
- GitHub OAuth app credentials
- Google Gemini API key for AI analysis
git clone https://github.com/GIT-Pushers/Devs.git
cd Devsnpm install
# or
yarn installcd contracts
npm install
cd ..cd frontend
npm install
cd ..cd contracts
cp .env.example .envEdit contracts/.env:
# Private key for deployment (without 0x prefix)
PRIVATE_KEY=your_private_key_here
# RPC URLs
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/your_api_key
# Etherscan API key for verification
ETHERSCAN_API_KEY=your_etherscan_api_keyCreate frontend/.env.local:
# GitHub OAuth
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
NEXT_PUBLIC_GITHUB_CLIENT_ID=your_github_client_id
# Pinata (IPFS)
NEXT_PUBLIC_PINATA_JWT=your_pinata_jwt
# Google Gemini AI
NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_api_key
# Better Auth
BETTER_AUTH_SECRET=generate_random_secret_key
BETTER_AUTH_URL=http://localhost:3000
# Contract Addresses (after deployment)
NEXT_PUBLIC_GLYTCH_CORE_ADDRESS=deployed_core_address
NEXT_PUBLIC_GITHUB_VERIFIER_ADDRESS=deployed_verifier_address
NEXT_PUBLIC_PARTICIPATION_NFT_ADDRESS=deployed_nft_address
# Network
NEXT_PUBLIC_CHAIN_ID=11155111Devs/
βββ contracts/ # Smart contracts
β βββ contracts/
β β βββ GLYTCHCore.sol # Main hackathon management
β β βββ GitHubVerifier.sol # GitHub verification with EIP-712
β β βββ GLYTCHVotingToken.sol # Soulbound voting tokens
β β βββ GLYTCHParticipationNFT.sol # Participation NFTs
β β βββ interfaces/
β β βββ IGLYTCHStructs.sol # Shared structs and events
β βββ scripts/
β β βββ deploy.js # Deployment script
β βββ test/
β β βββ GLYTCHPlatform.test.js # Comprehensive tests
β βββ hardhat.config.js # Hardhat configuration
β βββ package.json
β
βββ frontend/ # Next.js frontend
β βββ src/
β β βββ app/ # App Router pages
β β β βββ page.tsx # Landing page
β β β βββ home/ # Hackathon listings
β β β βββ Createhack/ # Create hackathon
β β β βββ CreateTeam/ # Create team
β β β βββ jointeam/ # Join team
β β β βββ submission/ # Submit project
β β β βββ sponsors/ # Sponsor hackathon
β β β βββ mint-nft/ # Mint participation NFT
β β β βββ profile/ # User profile
β β β βββ api/ # API routes
β β β βββ auth/ # Authentication
β β β βββ verify/ # GitHub verification
β β β βββ teams/ # Team management
β β β βββ analyze/ # AI analysis
β β β βββ github/ # GitHub integration
β β βββ components/ # React components
β β β βββ ui/ # shadcn/ui components
β β β βββ landing/ # Landing page sections
β β βββ hooks/ # Custom React hooks
β β β βββ useGitHubVerification.ts
β β β βββ useTeamManagement.ts
β β βββ lib/ # Utility libraries
β β βββ store/ # Zustand stores
β β βββ types/ # TypeScript types
β β βββ utils/ # Helper functions
β βββ public/ # Static assets
β βββ COLOR_SYSTEM.md # Theme documentation
β βββ IMPLEMENTATION_GUIDE.md # Feature implementation guide
β βββ next.config.ts
β βββ tailwind.config.js
β βββ package.json
β
βββ package.json # Root package.json
βββ README.md # This file
The core contract manages the entire hackathon lifecycle.
Key Functions:
createHackathon()- Create a new hackathonsponsorHackathon()- Sponsor a hackathoncreateTeam()- Create a teamjoinTeam()- Join existing teamregisterTeam()- Register team for hackathonstakeForTeam()- Stake ETH to participatemintVotingTokens()- Receive voting tokenssubmitProject()- Submit project with GitHub reposubmitJudgeScore()- Judges submit scoresvoteForProject()- Participants votecalculateFinalScore()- Calculate weighted final scoredistributeRewards()- Distribute prize poolmintParticipationNFT()- Mint achievement NFT
Constants:
MIN_CREATION_FEE = 0.02 ether
TOKENS_PER_PARTICIPANT = 100 * 10^18
PARTICIPANT_THRESHOLD_FOR_REFUND = 100
MIN_JUDGES = 5
MAX_TEAM_MEMBERS = 6
// Score weights
JUDGE_WEIGHT = 40%
PARTICIPANT_WEIGHT = 35%
AI_WEIGHT = 25%
// Distribution
WINNERS_PERCENTAGE = 80%
ORGANIZER_PERCENTAGE = 15%
PLATFORM_PERCENTAGE = 5%Handles cryptographic verification of GitHub accounts using EIP-712.
Key Functions:
verifyGitHub()- Verify GitHub with signaturegetNonce()- Get current nonceisVerified()- Check verification status
EIP-712 Domain:
name: "GLYTCH"
version: "1"Soulbound ERC20 token for participant voting.
Features:
- Non-transferable (soulbound)
- Can only be minted and burned
- Equal voting power
- Prevents vote manipulation
ERC721 NFT representing hackathon participation.
Features:
- Includes final scores and rankings
- IPFS metadata
- Unique for each participant per hackathon
- Permanent achievement proof
GLYTCHCore: 0x1e483933e7e95Fbe51A579060b0F648Cd3f6ABc2
GitHubVerifier: (deployed address)
ParticipationNFT: (deployed address)
/- Landing page with features and how it works/home- Browse all hackathons/home/[id]- Hackathon details and dashboard/Createhack- Create new hackathon/CreateTeam- Create new team/jointeam- Join existing team/my-teams- View your teams/submission/[hackathonId]- Submit project/participants/[id]- View participants and vote/results/[hackathonId]- View results and rankings/sponsors- Browse sponsors/sponsor/[id]- Sponsor a hackathon/mint-nft/[hackathonId]- Mint participation NFT/profile- User profile and verification/login- Authentication
The frontend uses a comprehensive semantic color system:
- Success (Green): Completed actions, verified status
- Warning (Yellow): Pending states, stake required
- Info (Blue): Informational content, neutral states
- Destructive (Red): Errors, failed states
- Primary (Brand Blue): Main actions, CTAs
See frontend/COLOR_SYSTEM.md for details.
useGitHubVerification
const { initiateGitHubLogin, isVerified, isLoading } = useGitHubVerification();useTeamManagement
const { createTeam, joinTeam, isLoading } = useTeamManagement();- Create a GitHub OAuth App at https://github.com/settings/developers
- Set Authorization callback URL:
http://localhost:3000/api/auth/github/callback - Copy Client ID and Client Secret to
.env.local
- Sign up at https://pinata.cloud
- Generate JWT token
- Add to
.env.localasNEXT_PUBLIC_PINATA_JWT
- Get API key from https://ai.google.dev/
- Add to
.env.localasNEXT_PUBLIC_GEMINI_API_KEY
cd contracts
npx hardhat testcd contracts
npx hardhat node # Terminal 1
# Terminal 2
npx hardhat run scripts/deploy.js --network localhostcd contracts
npx hardhat run scripts/deploy.js --network sepoliacd frontend
npm run devcd frontend
npm run build
npm run startcd frontend
npm run lintThe test suite covers:
- Contract deployment
- GitHub verification (EIP-712)
- Hackathon creation and lifecycle
- Team creation and management
- Sponsorship system
- Staking and token minting
- Project submission and AI scoring
- Judge scoring
- Participant voting
- Final score calculation and ranking
- Reward distribution
- NFT minting
- Edge cases and security
Run tests:
cd contracts
npx hardhat testWith gas reporting:
npx hardhat test --reporter gasWith coverage:
npx hardhat coveragecd frontend
npm run test # If tests are configured-
Set up environment variables in
contracts/.env -
Deploy to Sepolia:
cd contracts
npx hardhat run scripts/deploy.js --network sepolia- Verify contracts:
npx hardhat verify --network sepolia <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS>- Update frontend with deployed addresses in
frontend/.env.local
- Push code to GitHub
- Import project in Vercel
- Set environment variables
- Deploy
cd frontend
npm run build
npm run start-
Create Hackathon
- Navigate to
/Createhack - Fill in details (name, dates, judges, prizes)
- Pay creation fee (0.02 ETH)
- Set sponsorship threshold and team limits
- Navigate to
-
Manage Hackathon
- Monitor registrations
- Track sponsorships
- View submissions
- Calculate final scores
- Distribute rewards
-
Settle Fees
- If 100+ participants, get full refund
- Otherwise, fee goes to platform
-
Verify GitHub Account
- Connect wallet
- Sign in with GitHub
- Sign EIP-712 message
- Link GitHub to wallet
-
Create or Join Team
- Create team with name, description, image
- Share join code with members
- Or join existing team with code
-
Register for Hackathon
- Browse hackathons at
/home - Register your team
- Stake required ETH
- Receive voting tokens
- Browse hackathons at
-
Submit Project
- Go to
/submission/[hackathonId] - Enter GitHub repo URL
- AI analyzes and scores code
- Submit project
- Go to
-
Vote on Projects
- View all projects at
/participants/[id] - Use voting tokens to vote
- Support best projects
- View all projects at
-
Claim Rewards & NFT
- After judging completes
- Stake refunded automatically
- Winners receive prize share
- Mint participation NFT at
/mint-nft/[hackathonId]
- Score Projects
- Access hackathon dashboard
- Review all submissions
- Submit scores (0-100)
- Scores contribute 40% to final
- Sponsor Hackathon
- Navigate to
/sponsors - Choose hackathon
- Add sponsorship details (name, logo)
- Send ETH to prize pool
- Navigate to
We welcome contributions! Here's how you can help:
- π Report bugs
- π‘ Suggest features
- π Improve documentation
- π§ Submit pull requests
- β Star the repository
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Commit your changes
git commit -m "Add amazing feature" - Push to your branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow existing code patterns
- Use TypeScript for frontend
- Add comments for complex logic
- Write tests for new features
- Run linters before committing
Use conventional commits:
feat:New featuresfix:Bug fixesdocs:Documentationstyle:Code style changesrefactor:Code refactoringtest:Testschore:Maintenance
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenZeppelin - Secure smart contract libraries
- Hardhat - Ethereum development environment
- Next.js - React framework
- ThirdWeb - Web3 SDK
- shadcn/ui - UI components
- Vercel - Deployment platform
- GitHub Issues: Report bugs or request features
- Discussions: Join the conversation
- β Core hackathon management
- β GitHub verification
- β Multi-layered scoring
- β NFT participation proof
- β Reward distribution
- π Multi-chain support (Polygon, Arbitrum, Optimism)
- π DAO governance for platform decisions
- π Advanced analytics dashboard
- π Mobile app (iOS/Android)
- π Integration with more Git providers (GitLab, Bitbucket)
- π Video submission support
- π Live streaming integration
- π Mentorship program
- π Skill-based matching for teams
- π Recurring hackathons
- π Custom prize tracks
- Smart Contract Lines: ~1,200+ lines of Solidity
- Test Coverage: Comprehensive test suite
- Networks Supported: Ethereum, Sepolia, zkSync Era
- Max Team Size: 6 members
- Minimum Judges: 5 judges
- Score Distribution: 40% Judges, 35% Participants, 25% AI
Built with β€οΈ by the HackX Team