A minimalist, open-source coding judge with secure Docker sandboxing and instant AI code analysis using a local Ollama LLM (Phi-4-mini).
- Secure code execution in Docker containers (no network, memory/time limits)
- Automatic code analysis and optimization feedback after every run
- Streaming AI chat about your code
- Multi-language: Python, C++, C, Java, JavaScript, Go
- Modern React frontend with Monaco editor
git clone <repo-url>
cd AlgoJudge# Install Ollama from https://ollama.ai
ollama serve &
ollama pull phi4-minidocker pull python:3.11-slim
docker pull gcc:latest
docker pull node:latest
docker pull golang:latest
docker pull eclipse-temurin:latestcp backend/.env.example backend/.env
# Edit backend/.env with your settingsdocker compose up --build- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Frontend: Next.js, Tailwind CSS, Monaco Editor
- Backend: FastAPI, SQLAlchemy, JWT Auth
- AI: Ollama (local) with Phi-4-mini (3.8B) — no API keys needed
- Sandbox: Docker (per-language containers, no network, memory/time limited)
- Database: PostgreSQL
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register |
Register user |
| POST | /auth/login |
Login, get JWT |
| POST | /submit |
Run code, returns execution result immediately |
| GET | /ai-result/{id} |
Poll for AI analysis result |
| POST | /chat |
Streaming AI chat about your code |
| GET | /dashboard |
List submissions |
| GET | /healthz |
Health check |
- All user code runs inside isolated Docker containers
- No network access inside sandbox containers
- Memory and time limits enforced
- JWT authentication on all endpoints
- Passwords bcrypt-hashed in PostgreSQL
print("Hello, AlgoJudge!")a, b = map(int, input().split())
print(a + b)Input: 3 5 → Expected: 8
n = int(input())
a, b = 0, 1
for _ in range(n):
print(a, end=" ")
a, b = b, a + bInput: 7 → Expected: 0 1 1 2 3 5 8
n = int(input())
nums = list(map(int, input().split()))
target = int(input())
for i in range(len(nums)):
for j in range(i+1, len(nums)):
if nums[i] + nums[j] == target:
print(i, j)
breakInput: 4\n2 7 11 15\n9 → Expected: 0 1
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> v(n);
for(auto &x : v) cin >> x;
sort(v.begin(), v.end());
for(auto x : v) cout << x << " ";
}Input: 5\n3 1 4 1 5 → Expected: 1 1 3 4 5
# Backend
cd backend && pytest
# Frontend
cd frontend && npm test