Code like you're racing for pole position! 🏁
CodePrix is a high-octane, racing-themed competitive programming platform. It features live coding contests, an isolated remote code execution engine, real-time leaderboards, and an AI assistant to help you debug perfectly through the chicanes.
- 🏁 Live Contests (Races): Participate in timed, multiplayer coding competitions with real-time WebSocket leaderboards.
- 🤖 Pit Crew AI: A context-aware AI assistant (powered by Groq) that sees your code and gives you hints without spoiling the solution.
- ⚡ AlgoForge Judge Engine: A secure, robust, Dockerized execution engine supporting C++, Python, Java, and JavaScript. Features generic test harnesses and limits for Time/Memory configurations.
- 🏎️ Telemetry Dashboard: Track your performance with visual gauges, submission heatmaps, and target goals.
- 🎨 Immersive Racing UI: A beautiful, neo-brutalist theme built using React, Tailwind CSS, shadcn-ui, and Framer Motion.
CodePrix is built using a microservice-oriented architecture to ensure scalability and reliability during intense coding races:
client/apex-code-arena/: The React+Vite frontend SPA.server/: The main Express API gateway handling user auth, problems, and submission proxying.judge-main/(AlgoForge Judge): The core code execution engine utilizing Docker and BullMQ for secure, queued, sandboxed evaluations.leaderboard-main/: A dedicated WebSocket service managing live rank lists during active contests.
Frontend:
- React (Vite)
- TypeScript
- Tailwind CSS
- Framer Motion (Animations)
- shadcn/ui
Backend & Microservices:
- Node.js & Express
- MongoDB & Mongoose
- Socket.io (Real-time leaderboards)
- BullMQ & Redis (Job queues for code execution)
- Docker & Dockerode (Sandboxing unsafe code limit environments)
- Groq LLM API (Pit Crew AI)
- Node.js (v18+)
- MongoDB (Local or Atlas URL)
- Docker (Must be running for the Judge container sandboxing)
- Redis (For BullMQ Judge Queue)
git clone https://github.com/4bdu114h/CodePrix.git
cd CodePrixYou need to set up .env files in multiple directories.
Main Server (server/.env):
PORT=8000
MONGO_URI=mongodb://localhost:27017/codeprix
JWT_SECRET=your_super_secret_jwt_key
LEADERBOARD_URL=http://localhost:5001
JUDGE_URL=http://localhost:3000
ADMIN_EMAIL=admin@yourdomain.com
ADMIN_PASSWORD=admin_passwordJudge Service (judge-main/.env):
PORT=3000
REDIS_URL=redis://localhost:6379Client (client/apex-code-arena/.env.local):
VITE_GROQ_API_KEY=your_groq_api_key(Note: Never commit your real .env files to the repository)
You will need multiple terminal windows (or you can use PM2).
Start the Main Server:
cd server
npm install
npm run seed:problems # Optional: Seeds the database with mock racing problems
npm startStart the Judge Service:
cd judge-main
npm install
npm run devStart the Leaderboard Service:
cd leaderboard-main
npm install
npm startStart the Client:
cd client/apex-code-arena
npm install
npm run dev- Open your browser and navigate to
http://localhost:8080(or whichever port Vite assigned). - Create an account and sign in.
- Head to the Problems section or join an upcoming Contest.
- Write your solution in the code editor, test it with Run, and hit Submit to send it to the AlgoForge Judge.
- If you hit a roadblock, click the Pit Crew AI button for debugging assistance!
This project is licensed under the ISC License. See the LICENSE file for more details.
Created with ❤️ by the CodePrix Team.