A real-time competitive coding platform where developers race to solve AI-generated programming challenges. Built with Java Spring Boot, React, and OpenAI.
- AI-Powered Problems: Generates unique algo problems using OpenAI (GPT-4/3.5).
- Real-Time Multiplayer: Race against friends with live status updates via WebSockets.
- Code Execution: Secure, sandboxed code execution using Piston API.
- Languages: Python, Java, C++, JavaScript.
- Security: Google OAuth2, JWT authentication, OWASP sanitization.
Backend
- Java 17 & Spring Boot 3.2.0
- PostgreSQL (Data) & Flyway (Migrations)
- Spring WebSocket (STOMP)
- Spring Security (OAuth2, JWT)
Frontend
- React 18 & Vite
- Tailwind CSS
- Monaco Editor
- Java 17, Node.js 18+, PostgreSQL
- Clone:
git clone https://github.com/yogyam/CodeDuel.git - Database: Create a Postgres DB named
codeduel.
Backend (backend/.env):
SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/codeduel
SPRING_DATASOURCE_USERNAME=postgres
SPRING_DATASOURCE_PASSWORD=password
OPENAI_API_KEY=sk-...
OPENAI_API_URL=https://api.openai.com/v1/chat/completions
JWT_SECRET=your_secret
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENT_ID=...
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENT_SECRET=...
CORS_ALLOWED_ORIGINS=http://localhost:5173Frontend (frontend/.env):
VITE_BACKEND_URL=http://localhost:8080Backend:
cd backend && mvn spring-boot:runFrontend:
cd frontend && npm install && npm run devMIT License - see LICENSE.

