How arudhrabalaji3-cyber/online-coding-judge works
Online Coding Judge provides authenticated problem practice, code execution and submission evaluation, progress tracking, and real-time collaborative editing. Users enter through the React routes, browse problems or open a problem workspace, then run or submit code; backend controllers evaluate submissions, call Judge0, and retain history for dashboard views. Authentication and problem browsing are distinct supporting workflows. The README documents collaboration via Yjs and Socket.IO; the server implementation is sampled, but the collaboration page’s client-side wiring is not, so that relationship is documented rather than traced through its client code.
Main entry points: App.tsx Page routing · app.js HTTP API · executionController.js Evaluation and stats · executionRoutes.js Execution routes
Components 27
Web application
- Page routing
client/src/App.tsx - Sign in
client/src/pages/login.tsx - Registration
client/src/pages/register.tsx - Route guard
client/src/components/ProtectedRoute.tsx - Problem browser
client/src/pages/ProblemsPage.tsx - Problem workspace
client/src/pages/ProblemDetailsPage.tsx - Progress dashboard
client/src/pages/DashboardPage.tsx - Submission history
client/src/pages/SubmissionHistoryPage.tsx - Collaboration room
client/src/pages/CollaboratePage.tsx - Problem service
client/src/services/problemService.ts - Execution service
client/src/services/executionService.ts
Identity and access
- Auth routes
server/src/routes/authRoutes.js - Auth controller
server/src/controllers/authController.js - JWT middleware
server/src/middleware/authMiddleware.js - User records
server/src/models/User.js
Problem and judging
- HTTP API
server/src/app.js - Problem routes
server/src/routes/problemRoutes.js - Problem catalog
server/src/controllers/problemController.js - Problem records
server/src/models/Problem.js - Execution routes
server/src/routes/executionRoutes.js - Evaluation and stats
server/src/controllers/executionController.js - Submission records
server/src/models/Submission.js - Judge0
- MongoDB connection
server/src/config/db.js
Live collaboration
- Socket.IO rooms
server/src/server.js
Other components
- Learner
- Room participants
Connections 38
- Learner → Page routing: uses
README.md - Page routing → Sign in: routes to
client/src/App.tsx - Page routing → Registration: routes to
client/src/App.tsx - Page routing → Route guard: guards
client/src/App.tsx - Page routing → Problem browser: routes to
client/src/App.tsx - Page routing → Problem workspace: routes to
client/src/App.tsx - Page routing → Progress dashboard: routes to
client/src/App.tsx - Page routing → Submission history: routes to
client/src/App.tsx - Page routing → Collaboration room: routes to
client/src/App.tsx - Sign in → Auth routes: authenticates
README.md - Registration → Auth routes: registers
README.md - Auth routes → Auth controller: dispatches
server/src/routes/authRoutes.js - Auth controller → User records: reads and writes
server/src/controllers/authController.js - Route guard → JWT middleware: requires token
README.md - Problem browser → Problem service: fetches problems
client/src/pages/ProblemsPage.tsx - Problem workspace → Problem service: fetches problem
client/src/pages/ProblemDetailsPage.tsx - Problem workspace → Execution service: runs or submits
client/src/pages/ProblemDetailsPage.tsx - Progress dashboard → Execution service: requests statistics
client/src/pages/DashboardPage.tsx - Submission history → Execution service: requests history
client/src/pages/SubmissionHistoryPage.tsx - Problem service → Problem routes: requests catalog
client/src/services/problemService.ts - Execution service → Execution routes: requests execution
client/src/services/executionService.ts - HTTP API → Auth routes: mounts
server/src/app.js - HTTP API → Problem routes: mounts
server/src/app.js - HTTP API → Execution routes: mounts
server/src/app.js - Problem routes → Problem catalog: dispatches
server/src/routes/problemRoutes.js - Execution routes → JWT middleware: protects
server/src/routes/executionRoutes.js - Execution routes → Evaluation and stats: dispatches
server/src/routes/executionRoutes.js - Problem catalog → Problem records: queries
server/src/controllers/problemController.js - Evaluation and stats → Problem records: loads test cases
server/src/controllers/executionController.js - Evaluation and stats → Judge0: executes code
server/src/controllers/executionController.js - Evaluation and stats → Submission records: stores and reads
server/src/controllers/executionController.js - Auth controller → JWT middleware: issues verified tokens
README.md - Collaboration room → Socket.IO rooms: collaborates via sockets
README.md - Room participants → Collaboration room: joins rooms
README.md - Socket.IO rooms → User records: looks up participants
server/src/server.js - Socket.IO rooms → Room participants: synchronizes rooms
server/src/server.js - Learner → Problem browser: browses
README.md - HTTP API → MongoDB connection: connects
server/src/server.js