# Python + pip
sudo apt update
sudo apt install python3 python3-pip -y
# Install Flask, dotenv and requests
cd ~/contest-platform
pip3 install flask python-dotenv requests --break-system-packages
Judge0 runs in Docker. Your laptop is the server.
# Install Docker if not already installed
sudo apt install docker.io docker-compose -y
sudo usermod -aG docker $USER
newgrp docker
# Download Judge0
cd ~
wget https://github.com/judge0/judge0/releases/download/v1.13.1/judge0-v1.13.1.zip
unzip judge0-v1.13.1.zip
cd judge0-v1.13.1
# Fix Docker credential error (if it appears)
# Edit ~/.docker/config.json and replace entire contents with: {}
# Start Judge0
docker-compose up -d db redis
sleep 15
docker-compose up -d
# Verify Judge0 is running (should return JSON)
curl http://localhost:2358/system_info
Judge0 takes ~2 minutes to fully start the first time.
Open .env and change these lines near the top:
JUDGE0_URL=
ADMIN_PASSWORD=
CONTEST_DURATION_SECONDS=
DB_PATH=
SECRET_KEY=
ip addr show | grep "inet " | grep -v 127
Your IP will look like 192.168.1.42 or 10.0.0.5.
This is the address participants will open in their browser.
cd routes/ && mvn spring-boot:run &
cd ~/contest_platform
python3 app.py
The server starts on port 5000.
http://localhost:5000/admin on YOUR PChttp://YOUR_LAPTOP_IP:5000 on any lab PCEdit data/problems.json to change problems, test cases, or boilerplate code.
Structure per problem:
title, subtitle, description — displayed to participantsrequired_complexity — shown as a hint chipvisible_test_cases — shown to participantshidden_test_cases — run on submit, not shownboilerplate — the wrong code shown in editor per languagehidden_main — injected invisibly for execution| Language | ID | Version |
|---|---|---|
| Python | 71 | Python 3.8 |
| C++ | 54 | GCC 9.2 (C++17) |
| C | 50 | GCC 9.2 |
| Java | 62 | OpenJDK 13 |
Judge0 not responding:
cd ~/judge0-v1.13.1
docker-compose ps # Check all containers are Up
docker-compose logs worker # Check for errors
Port 5000 blocked on LAN:
sudo ufw allow 5000
Participants can’t reach your IP:
# Make sure you're on the same network/switch as lab PCs
# Try pinging your laptop from a lab PC:
ping YOUR_LAPTOP_IP
Reset database (clear all participants):
rm contest.db
python3 app.py # Auto-recreates fresh DB
contest_platform/
├── app.py
├── .env
├── .gitignore
├── requirements.txt
│
├── core/
│ ├── __init__.py
│ ├── config.py
│ ├── database.py
│ └── problems.py
│
├── routes/
│ ├── __init__.py
│ ├── participant.py
│ ├── admin.py
│ └── judge.py
│
├── templates/
│ ├── register.html
│ ├── contest.html
│ ├── admin.html
│ ├── admin_login.html
│ └── ended.html
│
├── static/
│ ├── css/
│ │ ├── register.css
│ │ ├── contest.css
│ │ ├── admin.css
│ │ ├── admin_login.css
│ │ └── ended.css
│ └── js/
│ ├── register.js
│ ├── contest.js
│ ├── admin.js
│ └── admin_login.js
│
└── data/
└── problems.json