Skip to content

pnaskardev/PubJudge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

49 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PubJudge πŸ§‘β€βš–οΈ

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.


πŸš€ Project Goals

  • βš™οΈ 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

πŸ“ Tech Stack

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)

☸️ Kubernetes-Native Deployment

PubJudge is cloud-native and optimized for Kubernetes:

🧩 Microservices as Independent Pods

  • 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

πŸ” Secrets & Config

  • Kubernetes Secrets for credentials
  • ConfigMaps for service-wide settings

πŸ“ˆ Autoscaling

  • HPA is configured for each pod group
  • Easily customizable for memory or CPU utilization thresholds

πŸ“¦ Containerization

  • Dockerfiles for all services with multi-stage builds
  • Clean separation of app and runtime for optimized image size

🧭 Architecture Overview

  • Gateway β†’ Accepts API calls β†’ Validates & enqueues jobs
  • Worker β†’ Subscribed to Redis β†’ Runs user code in sandboxed environments
  • DB β†’ Stores user info, submissions, results

πŸ§ͺ Running Locally

git clone https://github.com/pnaskardev/pubjudge.git
cd pubjudge
go run main.go

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages