PubJudge is a distributed, scalable online code judging system inspired by platforms like LeetCode, HackerRank, and Codeforces. It leverages Go (Fiber), MongoDB, Redis, Docker, and Kubernetes to achieve horizontal scalability, real-time code evaluation, and microservice isolation.
- βοΈ Run and evaluate code submissions asynchronously using isolated judge workers
- π§΅ Event-driven architecture with Redis Pub/Sub and Streams
- π οΈ Auto-scalable Kubernetes deployments with HPA (Horizontal Pod Autoscaler)
- π³ Fully containerized microservices for reproducible builds
- π Secure JWT-based authentication and authorization
- πΎ Use MongoDB for users and submissions, Redis for job/event transport
- π§± Clean and modular Go codebase for easier onboarding and collaboration
| Layer | Technology |
|---|---|
| API Layer | Go (Fiber) |
| Worker Engine | Go + Redis Sub/Pub |
| Message Queue | Redis Streams |
| Database | MongoDB |
| Authentication | JWT |
| Container | Docker |
| Orchestration | Kubernetes + HPA |
| Autoscaling | Kubernetes HPA |
| DevOps | GitHub Actions (planned) |
PubJudge is cloud-native and optimized for Kubernetes:
-
Gateway Service
- REST API server exposed via Ingress or LoadBalancer
- Auto-scalable via CPU/memory metrics
-
Judge Worker Pods
- Stateless services subscribed to job queue
- Can scale up to meet submission demand
-
Redis & MongoDB
- Support both managed (e.g., Redis Cloud, MongoDB Atlas) or Helm-deployed local versions
- Kubernetes Secrets for credentials
- ConfigMaps for service-wide settings
- HPA is configured for each pod group
- Easily customizable for memory or CPU utilization thresholds
- Dockerfiles for all services with multi-stage builds
- Clean separation of app and runtime for optimized image size
- Gateway β Accepts API calls β Validates & enqueues jobs
- Worker β Subscribed to Redis β Runs user code in sandboxed environments
- DB β Stores user info, submissions, results
git clone https://github.com/pnaskardev/pubjudge.git
cd pubjudge
go run main.go