A secure, scalable online judge platform for running untrusted code in isolated environments.
CodeSpace is a production-ready online judge and code execution platform. Users submit code that runs securely in isolated Docker containers, with real-time feedback and support for multiple programming languages.
Tech Stack: FastAPI (API) → Celery (Task Queue) → Docker (Sandbox) + PostgreSQL (Database) + Next.js (Frontend)
- 🔒 Secure Sandboxing — Rootless Docker containers with seccomp restrictions and network isolation
- ⚡ Asynchronous Execution — Non-blocking task queue powered by Celery and Redis
- 🛰️ Real-Time Results — WebSocket integration for instant submission feedback
- 🌍 Multi-Language Support — Python, C++, Java, Node.js (easily extensible)
- 🛡️ Rate Limiting — Built-in protection against abuse
- 📦 Scalable Architecture — Horizontal scaling with multiple workers
accepted_execution_flow.mp4
wrong_execution_flow.mp4
ai_usage_flow.mp4
- Python 3.10+
- Node.js 20+
- Docker 24.x+
- Docker Compose (included with Docker Desktop)
- Clone & Setup Backend
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"- Setup Frontend
cd frontend
npm install- Build Sandbox Images
bash scripts/build_images.sh- Seed Database (Optional)
python scripts/seed_db.py- Start Services
docker-compose up --buildThe API will be available at http://localhost:8000, Frontend at http://localhost:3000
- Technical Requirements Document — System design, architecture, deployment
- Database Schema (ERD) — Visual entity-relationship diagram
- CodeSpace System Design — High-level architecture diagram
MIT License — see LICENSE for details.