MCPcopy Index your code
hub / github.com/JatinOO7-py/Online-Judge

github.com/JatinOO7-py/Online-Judge @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
84 symbols 217 edges 43 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

My Online Judge

An Online Judge platform where users can submit code in multiple languages (C++, Java, Python), get it compiled and evaluated, and view results — just like LeetCode, HackerRank, or Codeforces.

This project features:

- 👨‍💻 Code editor with syntax highlighting for multiple languages

- 📤 Code submission and execution engine

- 📊 Evaluation based on predefined test cases

- 🔐 User roles (admin, user) and secure login/signup

- 🌐 Full-stack architecture (MongoDB + Node.js + React + Docker)

📽️ Demo

👉 Watch Demo Video

🧱 Project Structure

project-root/
│
├── BackEnd/                   # Node.js backend with code execution logic
│   ├── index.js
│   ├── Dockerfile
│   └── .env                   # For MongoDB URI, ports, etc.
│
├── FrontEnd/
│   └── onlinejudge/           # Vite + React frontend
│       ├── Dockerfile
│       ├── vite.config.js
│       └── src/
│
├── docker-compose.yml         # Spin up MongoDB, backend, and frontend
└── README.md

🚀 Features

Feature Description
✍️ Code Editor Built with @uiw/react-codemirror and CodeMirror syntax support
⚙️ Language Support C++, Java, Python (compiled and executed in backend container)
📡 API Backend Express-based backend connected to MongoDB
📚 User Management Signup/Login with roles and secure password hashing
🐳 Dockerized Fully containerized using Docker Compose
💾 Persistent DB Data stored in Docker volumes and preserved across restarts

🔧 Manual Local Setup (without Docker)

> Only if you don't want Docker

🖥️ Backend

cd BackEnd

npm install

npm start

- Backend runs on: http://localhost:3002

Ensure you have MongoDB running locally or update the .env with your connection string.

💻 Frontend

cd FrontEnd/onlinejudge

npm install

npm run dev

- Frontend runs on: http://localhost:5173

🐳 Docker Setup (Recommended)

Prerequisites

- Docker & Docker Compose installed

🧪 Quick Start

From the root of the project

docker-compose up --build

⛓️ Ports Used

Component Container Port Host Port URL
Backend 3002 3001 http://localhost:3001
Frontend 80 5173 http://localhost:5173
MongoDB 27017 27017 mongodb://localhost:27017

🗃️ MongoDB Data Persistence

MongoDB uses Docker volumes so that your data is safe even after shutdown:

volumes:
  mongo-data:

You can explore it using MongoDB Compass:

📬 API Endpoints

Method Endpoint Description
POST /signUp Register a new user
POST /login Authenticate a user
POST /submit Submit code for testing
GET /results Fetch results

⚖️ License

MIT License. See LICENSE file for details.

Core symbols most depended-on inside this repo

handleExampleChange
called by 3
FrontEnd/onlineJudge/src/components/AddProblem.jsx
getProblemById
called by 3
FrontEnd/onlineJudge/src/services/problemService.js
getUserProfile
called by 3
FrontEnd/onlineJudge/src/services/userService.js
handleTestCaseChange
called by 2
FrontEnd/onlineJudge/src/components/UpdateProblem.jsx
handlePageChange
called by 2
FrontEnd/onlineJudge/src/components/HomePage.jsx
handlePageChange
called by 2
FrontEnd/onlineJudge/src/components/Profile.jsx
languageMode
called by 2
FrontEnd/onlineJudge/src/components/CodeEditor.jsx
handleTestCaseChange
called by 2
FrontEnd/onlineJudge/src/components/AddProblem.jsx

Shape

Function 84

Languages

TypeScript100%

Modules by API surface

FrontEnd/onlineJudge/src/components/CodeEditor.jsx8 symbols
FrontEnd/onlineJudge/src/components/UpdateProblem.jsx7 symbols
BackEnd/controllers/problems.js6 symbols
FrontEnd/onlineJudge/src/services/problemService.js5 symbols
FrontEnd/onlineJudge/src/services/authService.js5 symbols
FrontEnd/onlineJudge/src/services/codeService.js4 symbols
FrontEnd/onlineJudge/src/components/Profile.jsx4 symbols
FrontEnd/onlineJudge/src/components/HomePage.jsx4 symbols
FrontEnd/onlineJudge/src/components/EditProfile.jsx4 symbols
FrontEnd/onlineJudge/src/components/AddProblem.jsx4 symbols
FrontEnd/onlineJudge/src/components/SignUpPage.jsx3 symbols
FrontEnd/onlineJudge/src/components/OnlineCompiler.jsx3 symbols

Datastores touched

ProblemCollection · 1 repos
UserCollection · 1 repos
UserCodeCollection · 1 repos
(mongodb)Database · 1 repos

For agents

$ claude mcp add Online-Judge \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact