CodeNexus is a modern, multi-tenant, and multi-role online judge and competitive programming platform tailored for educational institutions. It provides a secure, sandboxed environment for compiling and executing student submissions in runtime-configurable programming languages, offering a comprehensive experience for students, teachers, and administrators.
ββββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββββ
β Frontend β REST β API Server β Redis β Judge Worker β
β React + Vite ββββββββΊβ Axum + domains ββββββββΊβ cgroups + seccomp β
β Port 5173 / 80 β WS β Port 3000 β HTTP β Compile & run β
ββββββββββββββββββββ ββββββββββ¬ββββββββββ ββββββββββββββββββββββ
β
ββββββββββββββΌβββββββββββββ
β β β
βββββββΌββββββ ββββββΌββββββ ββββββΌβββββββββββββ
βPostgreSQL β β Redis 7 β β Feature Gateway β
β16 β β Queue β β Port 3001 β
βββββββββββββ ββββββββββββ ββββββ¬βββββββββββββ
β
ββββββββΌβββββββ
β LLM Worker β
β AI analysis β
βββββββββββββββ
Core Data Flow: Users submit code via the frontend, the API server publishes judge tasks to Redis Streams, the Judge Worker consumes these tasks and compiles/runs them inside a secure Linux sandbox, and then posts the results back to the API server, which pushes real-time updates to the frontend via WebSocket.
- Runtime-Configurable Languages β The judge supports language runtimes through per-language settings; deployments can enable only the compilers/interpreters installed in the worker image.
- Secure Sandboxing β Three layers of isolation using Linux
cgroups(CPU/memory limits),chroot(filesystem isolation), andseccomp(system call filtering) to ensure security and prevent hostile executions. - Multi-Tenant & Multi-Role β Built for multi-campus operations. Features a 6-level role hierarchy (
Root,CampusAdmin,GradeAdmin,Teacher,TeachingAssistant,Student) with strict RBAC boundary checks. - Real-Time Updates β Real-time push notifications, submission status, leaderboard updates, and contest chatrooms using WebSocket.
- Contest Subsystem β Create contests with custom problems, real-time leaderboards (with configurable freeze periods), and live chatrooms.
- Classroom & Homework β Teachers can create classes, manage student enrollment, assign homework, and review comprehensive submission reports.
- Discussions & Blogs β Problem-specific discussion areas, community technical blogs, and nested comment systems.
- Code Plagiarism Detection β Integrated plagiarism scanner analyzing code similarity, configurable from the admin control panel.
- Direct Messaging β One-to-one conversations with message history, sending, and unread badge indicators.
- Feature Gateway & AI Worker β Runtime feature flags control optional capabilities such as LLM-assisted analysis, teaching cards, recommendations, and plagiarism graph features.
- Learning Roadmap β Student-facing knowledge topology that links visible skill nodes back into problem discovery.
- Full-Text Search β Global search indexing across problems, discussions, blogs, and users.
- Import/Export β Batch problem ZIP and user CSV import/export for seamless library migration and user provisioning.
| Component | Technology | Version |
|---|---|---|
| Frontend Framework | React + TypeScript + Vite | React 19, TypeScript 5.9, Vite 7 |
| Styling / Icons | Tailwind CSS v4 + shadcn + Lucide Icons | β |
| State Management | Zustand (Client) + TanStack React Query (Server) | β |
| Form Validation | React Hook Form + Zod | β |
| Code Editors | Monaco Editor (Code submission) + CodeMirror (Markdown) | β |
| API Server | Rust + Axum + SQLx | Rust 2021 Edition, Axum 0.7, SQLx 0.8 |
| Feature Gateway | Rust + Axum + SQLx | Scoped feature flags, standalone service |
| LLM Worker | Rust worker | AI task processing behind feature flags |
| Judge Worker | Rust + Redis Streams + cgroups/seccomp | Rust 2021 Edition |
| Database | PostgreSQL | 16 |
| Cache & Message Broker | Redis | 7 |
| Containerization | Docker Compose | β |
Online_Judge/
βββ backend/ # Rust Workspace (14 crates)
β βββ Cargo.toml # Workspace Root Config
β βββ rust-toolchain.toml # Toolchain Lock (Rust 1.90.0)
β β
β βββ api/ # API Server (Axum HTTP & WebSockets Entry)
β βββ api-infra/ # Shared Infrastructure Crate (Middleware, Auth, WS, Helpers)
β βββ shared/ # Shared Models (Claims, Role, Permission, User)
β β
β βββ domain-users/ # User domain (Authentication, Registration, Profiles, Roles)
β βββ domain-problems/ # Problem domain (CRUD, Test cases, Visibility)
β βββ domain-submissions/ # Submission domain (Submissions, Retests, Verdicts)
β βββ domain-contests/ # Contest domain (Lifecycle, scoreboards, registration)
β βββ domain-classes/ # Classroom domain (Grades, Classes, Homework)
β βββ domain-community/ # Social domain (Discussions, Blogs, Comments)
β βββ domain-leaderboard/ # Ranking domain (Global/Contest/Class rankings)
β βββ domain-search/ # Search domain (Full-text search integration)
β βββ domain-imex/ # Import/Export domain (Problem ZIP & User CSV)
β β
β βββ judge-worker/ # Independent Judge Worker (Redis Streams Consumer & Sandbox)
β βββ migration-tool/ # Database Migration Tool (MySQL β PostgreSQL)
β
βββ frontend/ # React Frontend Application
β βββ src/
β β βββ pages/ # Page components
β β βββ components/ # Shared UI elements
β β βββ services/ # API Service Layer
β β βββ store/ # Zustand Stores
β βββ Dockerfile # Nginx deployment config
β
βββ docker-compose.yml # Full-stack orchestrator
βββ scripts/ # Bootstrap & utility scripts
βββ LICENSE # Private License
For detailed step-by-step instructions, please read GETTING-STARTED.md.
docker compose up -d --buildLoad demo seeds:
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/online_judge \
./scripts/bootstrap_demo.shService links:
| Service | URL |
|---|---|
| Frontend | http://localhost:5173 |
| API Server | http://localhost:3000 |
| Health Check | http://localhost:3000/health |
| Guide | Description |
|---|---|
| GETTING-STARTED.md | Local environment preparation, installation, and first run. |
| ARCHITECTURE.md | Technical architecture, domain boundaries, and data flow details. |
| DEVELOPMENT.md | Backend and frontend local development guidelines. |
| TESTING.md | Unit, integration, E2E testing framework, and guidelines. |
| API.md | Complete REST API endpoint reference. |
| CONFIGURATION.md | Environment variables and runtime configurations. |
| DEPLOYMENT.md | Production-grade deployment and operations guide. |
This project is licensed under a Private License. See LICENSE for details. Unauthorized use, copying, modification, or distribution is strictly prohibited.
