How souvik-dey-2029/iplmind works
IPLMind is an adaptive IPL-player guessing game: a player thinks of someone, answers staged questions, and the system narrows candidates before making up to three guesses. The server session manager coordinates question selection, answer evaluation, and feedback; Bayesian probabilities and semantic constraints support the inference. Documented branches include Gemini/OpenRouter adaptive questions, Firestore-backed global learning and leaderboard metrics, and themed game interfaces. Edges are limited to README statements and source-index references or excerpts; UI-to-API wiring is not established by the sampled files.
Main entry points: sessionManager.js Session coordinator · IPLStadiumGameClient.js Game interface · questionEngine.js Question selection · probabilityEngine.js Bayesian scoring
Components 29
Game experience
- Game interface
src/components/IPLStadiumGameClient.js - Home experience
src/components/IPLStadiumHome.js - Theme controls
src/components/ThemeSwitcher.js - Guess explanation
src/components/GuessExplanationCard.js - Post-game summary
src/components/PostGameSummary.js - Leaderboard view
src/components/LeaderboardClient.js
Server API
- Start session
src/app/api/session/start/route.js - Submit answer
src/app/api/session/answer/route.js - Guess endpoint
src/app/api/session/guess/route.js - Feedback endpoint
src/app/api/session/feedback/route.js - Undo endpoint
src/app/api/session/undo/route.js - Leaderboard endpoint
src/app/api/leaderboard/route.js - Health endpoint
src/app/api/system/health/route.js
Inference engine
- Session coordinator
src/lib/sessionManager.js - Question selection
src/lib/questionEngine.js - Bayesian scoring
src/lib/probabilityEngine.js - Answer evaluation
src/lib/answerEvaluator.js - Reasoning phases
src/lib/reasoningPhaseManager.js - Semantic constraints
src/lib/semanticConstraints.js - Semantic inference
src/lib/semanticInference.js - Guess explanations
src/lib/reasoningEngine.js
Learning and metrics
- Global learning memory
src/lib/learningMemory.js
Player data and AI
- Adaptive AI provider
src/lib/aiProvider.js - IPL player profiles
src/data/players.js - Player normalization
src/lib/playerNormalizer.js
Other components
- Player
- Firebase Firestore
- Google Gemini
- OpenRouter
Connections 35
- Player → Game interface: plays
README.md - Game interface → Start session: starts game
- Game interface → Submit answer: answers questions
- Game interface → Feedback endpoint: submits feedback
- Game interface → Theme controls: uses themes
src/components/IPLStadiumGameClient.js - Start session → Session coordinator: starts session
src/app/api/session/start/route.js - Submit answer → Session coordinator: records answer
src/app/api/session/answer/route.js - Guess endpoint → Session coordinator: handles guess
src/app/api/session/guess/route.js - Feedback endpoint → Session coordinator: records feedback
src/app/api/session/feedback/route.js - Undo endpoint → Session coordinator: undoes step
src/app/api/session/undo/route.js - Session coordinator → IPL player profiles: loads candidates
src/lib/sessionManager.js - IPL player profiles → Player normalization: normalizes profiles
src/data/players.js - Session coordinator → Bayesian scoring: updates probabilities
src/lib/sessionManager.js - Session coordinator → Answer evaluation: evaluates answers
src/lib/sessionManager.js - Session coordinator → Question selection: selects questions
src/lib/sessionManager.js - Session coordinator → Adaptive AI provider: requests adaptive questions
src/lib/sessionManager.js - Session coordinator → Global learning memory: uses learning
src/lib/sessionManager.js - Question selection → Bayesian scoring: scores candidates
src/lib/questionEngine.js - Question selection → Reasoning phases: applies phase rules
src/lib/questionEngine.js - Question selection → Semantic constraints: checks contradictions
src/lib/questionEngine.js - Question selection → Semantic inference: scores semantic utility
src/lib/questionEngine.js - Bayesian scoring → Global learning memory: loads player priors
src/lib/probabilityEngine.js - Semantic inference → Bayesian scoring: normalizes probabilities
src/lib/semanticInference.js - Guess explanations → Bayesian scoring: ranks candidates
src/lib/reasoningEngine.js - Adaptive AI provider → Google Gemini: generates questions
README.md - Adaptive AI provider → OpenRouter: fallback provider
README.md - Global learning memory → Firebase Firestore: persists learning
README.md - Feedback endpoint → Firebase Firestore: stores game sessions
src/app/api/session/feedback/route.js - Leaderboard endpoint → Firebase Firestore: reads metrics
src/app/api/leaderboard/route.js - Leaderboard endpoint → IPL player profiles: resolves player names
src/app/api/leaderboard/route.js - Leaderboard endpoint → Semantic inference: scores difficulty
src/app/api/leaderboard/route.js - Leaderboard view → Leaderboard endpoint: loads standings
- Health endpoint → Adaptive AI provider: checks provider
src/app/api/system/health/route.js - Game interface → Guess explanation: shows rationale
- Game interface → Post-game summary: shows game summary