Merge or Reject is an open source game powered by Convex where developers test their code review skills against OpenAI generated code snippets. Players must decide whether to merge or reject code based on their analysis.
- No login required to play the game
- Anonymous users are created only when starting a game
- Clerk authentication for admin access
- Admin dashboard with comprehensive controls
- User scores and progress tracked anonymously
- Customizable display names after game completion
- Real-time code snippet validation
- Multiple programming languages supported:
- TypeScript
- JavaScript
- Python
- Java
- C++ (cpp)
- Rust
- Three difficulty levels set in the admin dashboard
- Easy
- Medium
- Hard
- Volume-based progression system
- AI-generated code snippets using GPT-4 with:
- Language-specific best practices
- Contextual hints in explanations
- Difficulty-appropriate challenges
- Security and performance considerations
- Smart tagging system
- Instant feedback and detailed explanations
- Skip option for challenging snippets
- Visual effects and celebrations
- Anonymous user creation
- Persistent scores and statistics
- Personal best tracking per language
- Language-specific progress
- Dark/light mode preference
- Share scores on social media
- Global leaderboards
- Recent games feed
- Comprehensive dashboard
- Game statistics monitoring
- Code snippet management
- AI generation controls:
- Valid/Invalid ratio adjustment
- Max snippets per generation
- Min snippets threshold
- Language-specific volume control
- Difficulty-based generation
- Pre-generation system for reliability
- Volume and difficulty settings
- Snippet editing capabilities
- User role management
- React 18 with TypeScript
- Vite for build tooling
- Tailwind CSS with custom theme
- Lucide icons for React
- Canvas Confetti
- PowerGlitch effects
- Convex for server-side backend
- Real-time data sync
- OpenAI GPT-4 integration
- Clerk authentication
- Public API endpoints
- Convex's built-in database
- Real-time subscriptions
- Optimized indexes
- Automatic scaling
convex/
├── schema.ts # Database schema
├── game.ts # Game logic
├── games.ts # Game management
├── scores.ts # Leaderboards
├── users.ts # User management
├── snippets.ts # Code snippets
├── admin.ts # Admin controls
├── settings.ts # Configuration
├── init.ts # Setup
├── auth.ts # Authentication
└── clerk.ts # Clerk webhooks
src/
├── App.tsx
├── components/
│ ├── GameContainer.tsx
│ ├── GameResult.tsx
│ ├── ScoresPage.tsx
│ ├── CodeDisplay.tsx
│ ├── Timer.tsx
│ ├── HomePage.tsx
│ ├── AdminDashboard.tsx
│ ├── Header.tsx
│ └── Footer.tsx
└── types/
└── index.ts
-
Clone the repository:
git clone https://github.com/yourusername/merge-or-reject.git cd merge-or-reject
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env
Add your OpenAI API key and Clerk credentials.
-
Start the development server:
npm run dev
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
This project is open source and available under the MIT License.
- OpenAI for GPT-4 API
- Convex for backend infrastructure
- Clerk for authentication
- React and Vite teams
- All contributors and players!