Backend service for HeatCode — an online code execution & judging platform.
This repository contains the API server, background workers, and database migration setup.
⚠ Current Status: This repository is a work in progress. The currently deployed version runs without workers — only the API server is active.
You can still fully test the system by following this guide to run it locally with workers enabled.
- FastAPI – REST API framework
- Docker – Containerization
- PostgreSQL – Database
- Alembic – Database migrations
- RabbitMQ + Workers – Task processing (submission & execution)
git clone https://github.com/Naman-0206/code-judge-backend
cd code-judge-backend/setup
.\run_backend_dev.bat
./run_backend_dev.sh
Run all commands from the
setup/
directory. ⚠ Make sure you are logged in to Docker Hub before pushing.
docker build -t heatcode_backend ../server
docker tag heatcode_backend naman0206/heatcode_backend:latest
docker push naman0206/heatcode_backend:latest
docker build -t submission-worker ../workers/submission_worker
docker tag submission-worker naman0206/submission-worker:latest
docker push naman0206/submission-worker:latest
docker build -t execution-worker ../workers/execution_worker
docker tag execution-worker naman0206/execution-worker:latest
docker push naman0206/execution-worker:latest
Workers are currently not deployed in production.
Make sure the .env
file is correctly configured.
docker run -d --name submission-worker --env-file .env naman0206/submission-worker:latest
docker run -d --name execution-worker --env-file .env naman0206/execution-worker:latest
Ensure sqlalchemy.url
in alembic.ini
points to the dev database.
alembic upgrade head
alembic revision --autogenerate -m "your message here"
alembic upgrade head
- Change
sqlalchemy.url
inalembic.ini
to production DB URL. - If DB is out of sync:
alembic upgrade head
alembic revision -m "first migration"