How sannjaay/ipl-llm works
This repository appears to be an IPL fan application: users browse match, player-comparison, standings, and statistics views, and can open match details. A separate Express backend exposes season-match and commentary endpoints; commentary retrieval combines stored match data and commentary text with Gemini generation. The tree also contains a scraper and Python/LLM code, but their runtime connections are not established by the excerpts. Frontend-to-backend wiring and several page data sources are likewise unverified, so those edges are omitted.
Main entry points: App.jsx Application router · ragCommentaryService.js Commentary retrieval and generation · index.js Express server · MatchesPage.jsx Matches list
Components 24
Fan application
- Application router
frontend/src/App.jsx - Navigation
frontend/src/components/Navbar.jsx - Home
frontend/src/pages/Home.jsx - Matches list
frontend/src/pages/MatchesPage.jsx - Match card
frontend/src/pages/MatchCard.jsx - Match details
frontend/src/pages/MatchDetails.jsx - Commentary view
frontend/src/components/CommentarySection.jsx - Player comparison
frontend/src/pages/PlayerComparisonPage.jsx - Standings table
frontend/src/pages/TablePage.jsx - Statistics
frontend/src/pages/StatisticsPage.jsx - Sample IPL data
frontend/src/data/index.js - Fan chatbot
frontend/src/components/ChatBot.jsx
Match data API
- Express server
backend/index.js - Season match endpoint
backend/routes/matchRoutes.js - Match model
backend/models/Match.js
AI commentary
- Commentary endpoint
backend/routes/ragRoutes.js - Commentary retrieval and generation
backend/services/ragCommentaryService.js - Gemini API
Data and ML
- IPL scraper
ipl-scraper/scraper.js - LLM integration
ml/llmintegration.js - Python RAG
ml/rag/main.py - Flask app
backend/app.py - Mongo integration
backend/database.py
Other components
- IPL fan
Connections 20
- IPL fan → Application router: uses
- Application router → Navigation: renders
frontend/src/App.jsx - Application router → Home: routes to
frontend/src/App.jsx - Application router → Matches list: routes to
frontend/src/App.jsx - Application router → Match details: routes to
frontend/src/App.jsx - Application router → Player comparison: routes to
frontend/src/App.jsx - Application router → Standings table: routes to
frontend/src/App.jsx - Application router → Statistics: routes to
frontend/src/App.jsx - Application router → Fan chatbot: opens
frontend/src/App.jsx - Matches list → Match card: renders
frontend/src/pages/MatchesPage.jsx - Matches list → Match details: uses
frontend/src/pages/MatchesPage.jsx - Match details → Commentary view: renders
frontend/src/pages/MatchDetails.jsx - Statistics → Sample IPL data: reads
frontend/src/pages/StatisticsPage.jsx - Season match endpoint → Match model: queries
backend/routes/matchRoutes.js - Commentary endpoint → Commentary retrieval and generation: calls
backend/routes/ragRoutes.js - Commentary retrieval and generation → Match model: loads match
backend/services/ragCommentaryService.js - Commentary retrieval and generation → Gemini API: generates answer
backend/services/ragCommentaryService.js - Express server → Season match endpoint: registers
backend/index.js - Express server → Commentary endpoint: registers
backend/index.js - Express server → Commentary retrieval and generation: initializes
backend/index.js