How bagadsrushti/ieee_onebrain works
One Brain is a real-time multiplayer clue-and-guessing game for college events. Players join a room, receive distinct clues, communicate to solve an answer, and can also compete in scheduled team events or head-to-head duels. The backend manages room gameplay, event queues and scoring, and duel rounds; the React app provides joining, play, audience, arena, leaderboard, and admin experiences. Socket.IO is the real-time boundary. Some subsystem details and client-server event pairings are not shown in the excerpts, so those links are omitted or marked unverified.
Main entry points: App.jsx App Routing · gameManager.js Room Gameplay · index.js HTTP and Socket Server · duelManager.js Duel Management
Components 22
Player and Admin App
- App Routing
frontend/src/App.jsx - Socket Context
frontend/src/SocketContext.jsx - Join and Create
frontend/src/pages/Landing.jsx - Room Experience
frontend/src/pages/Room.jsx - Room Lobby
frontend/src/components/Lobby.jsx - Duel Lobby
frontend/src/components/DuelLobby.jsx - Gameplay UI
frontend/src/components/Game.jsx - Admin Panel
frontend/src/pages/Admin.jsx - Event Arena
frontend/src/pages/Arena.jsx - Duel Audience
frontend/src/pages/DuelAudience.jsx - Leaderboard
frontend/src/pages/Leaderboard.jsx
Realtime Game Services
- HTTP and Socket Server
backend/index.js - Socket Event Routes
backend/socket.js - Room Gameplay
backend/gameManager.js
Events and Duels
- Duel Management
backend/duelManager.js - Event Management
backend/eventManager.js
Game Rules and Scoring
- Player-Count Rules
backend/config/gameRules.js - Challenge Categories
backend/config/categories.js - Clue Distribution
backend/utils/dealClues.js - Answer Matching
backend/utils/answerMatcher.js - Usage Tracking
backend/utils/usageTracker.js
Other components
- Players and Hosts
Connections 32
- Players and Hosts → App Routing: use app
README.md - App Routing → Join and Create: routes to
frontend/src/App.jsx - App Routing → Room Experience: routes to
frontend/src/App.jsx - App Routing → Admin Panel: routes to
frontend/src/App.jsx - App Routing → Event Arena: routes to
frontend/src/App.jsx - App Routing → Duel Audience: routes to
frontend/src/App.jsx - App Routing → Leaderboard: routes to
frontend/src/App.jsx - App Routing → Socket Context: provides context
frontend/src/App.jsx - Room Experience → Room Lobby: renders
frontend/src/pages/Room.jsx - Room Experience → Duel Lobby: renders
frontend/src/pages/Room.jsx - Room Experience → Gameplay UI: renders
frontend/src/pages/Room.jsx - Socket Context → HTTP and Socket Server: connects by Socket.IO
- HTTP and Socket Server → Socket Event Routes: initializes
backend/index.js - Socket Event Routes → Room Gameplay: routes gameplay
backend/socket.js - Socket Event Routes → Duel Management: routes duel actions
backend/socket.js - Socket Event Routes → Event Management: routes event actions
backend/socket.js - Duel Management → Room Gameplay: creates team rooms
backend/duelManager.js - Room Gameplay → Event Management: queries team rank
backend/gameManager.js - Room Gameplay → Player-Count Rules: loads rules
backend/gameManager.js - Room Gameplay → Challenge Categories: uses categories
backend/gameManager.js - Room Gameplay → Answer Matching: checks guesses
backend/gameManager.js - Room Gameplay → Clue Distribution: deals clues
backend/gameManager.js - Duel Management → Player-Count Rules: loads rules
backend/duelManager.js - Duel Management → Answer Matching: checks guesses
backend/duelManager.js - Duel Management → Clue Distribution: deals clues
backend/duelManager.js - HTTP and Socket Server → Usage Tracking: serves usage data
backend/index.js - Join and Create → Socket Context: uses socket actions
frontend/src/pages/Landing.jsx - Gameplay UI → Socket Context: uses game state
frontend/src/components/Game.jsx - Admin Panel → HTTP and Socket Server: uses admin APIs
- Event Arena → HTTP and Socket Server: loads event data
- Duel Audience → HTTP and Socket Server: loads duel state
- Leaderboard → HTTP and Socket Server: loads rankings