An AI-powered cricket intelligence dashboard built for the Agentic Premier League vibe coding challenge.
This project does more than show a scorecard. It watches a live cricket match, turns raw match data into readable intelligence, and layers multiple agents on top of the stream to generate:
- live score awareness
- win probability
- projected score
- AI commentary
- fan sentiment
- tactical strategy suggestions
The result is a demo-first control room for cricket, where the user can understand not just what is happening, but what it means.
Most cricket apps stop at score updates.
This one adds an agentic layer:
- a
Live Match Agentfetches the real match state - a
Prediction Agentestimates outcome probability and projected score - a
Commentary Agentconverts match context into natural language - a
Sentiment Agentsummarizes the emotional state around the game - a
Strategy Agentsuggests what the batting side should do next
Everything is orchestrated into a single dashboard so the experience feels like a live AI-powered match room, not a collection of disconnected widgets.
ReactViteTailwind CSS
Node.jsExpress
Gemini APIfor commentary, sentiment, and strategy generation- deterministic local fallback logic when Gemini is unavailable
- live Cricbuzz page parsing for real match score sync
- automatic fallback to an internal mock simulator if the live source fails
node --testfor lightweight validation of prediction and parsing logic
The app displays the current match state with:
- teams
- score
- wickets
- overs
- innings state
- live source indicator
If the live score feed is available, the dashboard reflects the actual match. If the live source drops, the system gracefully falls back to simulated updates so the demo never breaks.
The prediction engine uses rule-based cricket logic instead of relying on an LLM for math-sensitive output.
It looks at:
- current score
- wickets in hand
- overs bowled
- current run rate
- required run rate
It then calculates:
- projected total
- win probability
This keeps the numbers fast, stable, and explainable.
The commentary agent turns live match context into short broadcast-style commentary.
It uses structured match state, recent events, and pressure context to generate language that feels:
- readable
- energetic
- stadium-ready
- demo-friendly
If Gemini is not configured, the app still generates sensible local commentary so the dashboard stays useful.
The sentiment module estimates the mood around the match.
It produces:
- a sentiment label like
Confident,Tense, orAnxious - a short fan mood summary
- a reaction stream that makes the interface feel socially alive
The strategy agent answers the practical question:
What should the batting side do next?
It produces short tactical guidance based on:
- pressure situation
- wickets remaining
- current vs required scoring rate
This helps the app feel agentic rather than purely descriptive.
- The backend tries to fetch the live match state from Cricbuzz.
- If live fetch succeeds, the real score is normalized into app-friendly JSON.
- If live fetch fails, the system falls back to the internal match simulator.
- The orchestrator passes the match context into:
- the predictor
- the commentary generator
- the sentiment generator
- the strategy generator
- The frontend dashboard polls the backend and renders the combined insight feed.
The frontend is a single-page React dashboard designed for demo impact.
It contains:
- hero match header
- score card
- victory pulse card
- projected score card
- commentary feed
- sentiment meter
- strategy panel
- fan reaction stream
The backend exposes lightweight APIs for:
- current match state
- insights
- full dashboard payload
- optional manual simulator stepping
It acts as the orchestration layer between live data, rule-based prediction, and LLM output.
GET /api/healthGET /api/match-stateGET /api/insightsGET /api/dashboardPOST /api/match-step
server/
fanReactions.js Fan sentiment context
gemini.js Gemini integration + fallback outputs
index.js Express server and API routes
liveMatch.js Live Cricbuzz fetch + parsing
matchSimulator.js Mock live match fallback engine
orchestrator.js Combines data and agent outputs
predictor.js Win probability and projection logic
src/
App.jsx Dashboard UI
index.css Tailwind entry styles
main.jsx React entry point
test/
predictor.test.js Prediction and parsing tests
npm installCreate a .env file from .env.example.
Available variables:
GEMINI_API_KEYPORTLIVE_MODECRICBUZZ_MATCH_URL
npm run dev- frontend:
http://localhost:5173 - backend:
http://localhost:3001
npm run devstarts frontend and backend togethernpm run buildcreates a production buildnpm run previewpreviews the built frontendnpm testruns backend tests
This project was built for a live demo environment, so reliability mattered as much as features.
Key reliability choices:
- real live score first, simulator fallback second
- rule-based numeric prediction instead of LLM-only prediction
- Gemini used only for language-heavy tasks
- safe fallback commentary, sentiment, and strategy if Gemini fails
This means the app remains presentable even if:
- the live source changes
- Gemini is unavailable
- the network becomes unstable
Use this if someone asks what the project does:
Agentic Premier League is a live cricket intelligence dashboard. It consumes the current match, then multiple agents analyze it in real time. One predicts the game, one generates commentary, one reads fan sentiment, and one suggests strategy. So instead of only seeing the score, the user gets live AI-powered match intelligence.
- It is not just a score app, it is an agent-driven decision layer on top of live cricket.
- Live data is fetched in real time when available.
- Predictions are stable because math is rule-based.
- Gemini is used where LLMs add the most value: language, sentiment, and insight.
- The app is built to survive demo risk through graceful fallback behavior.
These checks were used while building:
npm test
npm run build- over-by-over historical charts
- player-specific commentary
- Hindi and English commentary toggle
- richer strategy recommendations
- fantasy cricket assistant mode
- support for more leagues and match sources
Build with AI: Agentic Premier League
Watch the game. Ship the agent. Master the play.