| title | CompiCode Arena |
|---|---|
| emoji | 🏟️ |
| colorFrom | red |
| colorTo | blue |
| sdk | docker |
| pinned | false |
A real-time, highly-interactive competitive programming platform featuring multiple dynamic contest modes, automated code execution, and live leaderboards.
- 🏆 Standard Mode: Traditional competitive programming format. Answer questions within a global time limit. Ranked by solve count and time penalty.
- ⏱️ Timed Mode: Every problem has its own independent countdown timer. Solve it before the clock runs out, or lose access permanently.
- 💀 Sudden Death: All participants are forced onto the same problem simultaneously. The first person to successfully pass all test cases claims the round, and the entire lobby is instantly advanced to the next problem.
- ⚡ Real-Time Execution: Connects to an external, sandboxed Python/C++ code executor API.
- 🏦 Global Problem Bank: A centralized repository to maintain programming challenges and hidden test cases.
- 📊 Live Leaderboard: Realtime, Codeforces-style standings driven by WebSockets and optimized polling.
- Frontend: React + Vite (Vanilla CSS styling, highly optimized, no heavy UI libraries)
- Backend: FastAPI (Python 3.11+) + Firebase (Firestore)
- Execution Engine: Hosted separately on a Hugging Face Space. The backend posts execution payloads to
https://sanjaymarathi-compicode-executor.hf.space/evaluateto safely evaluate untrusted user code.
- Node.js (v16+)
- Python 3.11+
- A valid
firebase-key.jsonservice account file placed in the project root.
# Install dependencies
pip install -r requirements.txt
# Run the FastAPI server
uvicorn main:app --host 0.0.0.0 --port 8000 --reloadcd frontend
# Install dependencies
npm install
# Start the Vite development server
npm run devYou can easily host this entire full-stack project (React Frontend + FastAPI Backend) on Hugging Face using a Docker Space.
- Create a new Space on Hugging Face.
- Select Docker as the Space SDK and choose the Blank template.
- Push this repository directly to the Hugging Face Space.
- Ensure your
firebase-key.jsonis securely provided (e.g., via Hugging Face Secrets mapped to files, or manually uploaded if private).
FROM python:3.11-slim
WORKDIR /app
# Install Node.js for frontend build
RUN apt-get update && apt-get install -y nodejs npm
# Copy project files
COPY . .
# Build Frontend
WORKDIR /app/frontend
RUN npm install
RUN npm run build
# Setup Backend
WORKDIR /app
RUN pip install -r requirements.txt
# Run Uvicorn server on port 7860 (Hugging Face default)
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]Note: In main.py, the built frontend static files are served automatically on the root path if frontend/dist exists, allowing you to run the entire application smoothly on a single port.
The UI is built with a premium, flat-dark aesthetic heavily inspired by top-tier developer platforms. It leverages glassmorphism, dynamic glows, smooth micro-animations, and high-contrast primary (#ff7b00) and secondary (#00f0ff) colors to create a modern and highly engaging workspace.