How krish-mittal1/codearena works
CodeArena is a competitive coding platform with individual practice and real-time 1v1 battles. Users authenticate in the frontend, browse problems or enter matchmaking, submit code, and receive judge results; battle outcomes also update ratings and history. The graph includes documented practice, company sets, OTP, AI feedback, statistics, and mock interviews. Some feature modules are unsampled, so their connections are based on README documentation; detailed internal call paths are shown only where the excerpts or source index support them.
Main entry points: router.py HTTP API · match_service.py Match lifecycle · judge_worker.py Judge worker · matchmaking_service.py Matchmaking
Components 27
Frontend experience
- Application shell
frontend/src/App.jsx - Login and registration
frontend/src/pages/Login.jsx - Practice interface
frontend/src/pages/Practice.jsx - Battle screen
frontend/src/pages/Battle.jsx - Profile and stats
frontend/src/pages/Dashboard.jsx - Auth state
frontend/src/stores/authStore.js - WebSocket client
frontend/src/ws/WebSocketManager.js
Identity and API
- HTTP API
backend/api/router.py - Authentication
backend/services/auth_service.py - OTP login
backend/api/otp_auth.py
Practice and judging
- Problem and practice APIs
backend/api/practice.py - Problem catalog
backend/services/problem_service.py - Submission handling
backend/api/submissions.py - Judge worker
backend/workers/judge_worker.py - Verdict evaluation
backend/services/judge_service.py - Code sandbox
backend/execution/sandbox.py - AI feedback
backend/services/ai_service.py
Live battles
- Matchmaking
backend/services/matchmaking_service.py - Match lifecycle
backend/services/match_service.py - WebSocket handlers
backend/websocket/handlers.py - Connection manager
backend/websocket/manager.py
State and integrations
- Ratings and statistics
backend/services/rating_service.py - PostgreSQL
- Redis
- External LLM
- Email OTP service
Other components
- User
Connections 39
- User → Application shell: uses
- Application shell → Login and registration: routes to
frontend/src/App.jsx - Application shell → Practice interface: routes to
frontend/src/App.jsx - Application shell → Battle screen: routes to
frontend/src/App.jsx - User → Login and registration: signs in
- Login and registration → Auth state: updates
frontend/src/App.jsx - Auth state → HTTP API: requests
- HTTP API → Authentication: routes auth
- HTTP API → OTP login: routes OTP
backend/api/router.py - OTP login → Email OTP service: sends code
- Practice interface → HTTP API: requests problems
- HTTP API → Problem and practice APIs: routes practice
backend/api/router.py - Problem and practice APIs → Problem catalog: loads problems
- Problem catalog → PostgreSQL: reads catalog
- Practice interface → Submission handling: submits code
- HTTP API → Submission handling: routes submissions
backend/api/router.py - Submission handling → PostgreSQL: stores submission
- Submission handling → Judge worker: queues submission
- Judge worker → Code sandbox: executes code
backend/workers/judge_worker.py - Judge worker → Verdict evaluation: evaluates output
backend/workers/judge_worker.py - Judge worker → PostgreSQL: saves verdict
- Practice interface → AI feedback: requests feedback
- AI feedback → External LLM: gets analysis
- User → Matchmaking: joins queue
- HTTP API → Matchmaking: routes matchmaking
backend/api/router.py - Matchmaking → Redis: uses queue
- Matchmaking → Match lifecycle: creates match
- Match lifecycle → PostgreSQL: persists match
- Match lifecycle → Redis: tracks active state
- Battle screen → WebSocket client: connects live
- WebSocket client → WebSocket handlers: sends events
- WebSocket handlers → Connection manager: dispatches events
backend/websocket/handlers.py - Matchmaking → Connection manager: notifies players
- Judge worker → Match lifecycle: completes match
backend/workers/judge_worker.py - Match lifecycle → Ratings and statistics: updates ratings
backend/services/match_service.py - Match lifecycle → Connection manager: broadcasts results
- Profile and stats → HTTP API: loads stats
- HTTP API → Ratings and statistics: serves statistics
- Ratings and statistics → PostgreSQL: reads match history