A premium full-stack AI-powered cricket analytics platform for IPL data analysis, visualization, and tactical insights.
- Frontend Application: https://ai-powered-cricket-analytics-studio.vercel.app
- Backend REST API: https://ai-powered-cricket-analytics-studio-phi.vercel.app
graph TD
subgraph Frontend [Next.js Web Client]
A[Dashboard & Charts] -->|JWT Auth & Upload| B[REST Client]
A -->|Render Recharts| C[Interactive Dashboard]
end
subgraph Backend [Express.js REST API]
B -->|HTTP Requests| D[JWT Middleware & Rate Limiter]
D -->|CSV Parser / Ingestion| E[In-Memory Cache & Metrics Engine]
E -->|PDFKit| F[PDF/CSV Report Generator]
end
subgraph PythonEngine [Python Analytics Engine]
G[cleaner.py] --> H[features.py]
H --> I[analytics.py]
I --> J[visualizer.py]
K[(matches.csv & deliveries.csv)] --> G
J -->|Output PNG Charts| L[output/plots/]
I -->|Output CSV Summaries| M[output/stats/]
end
IPL InsightX is an advanced AI-powered cricket analytics studio that transforms raw ball-by-ball delivery logs and match scoreboards into actionable, tactical summaries. Built for coaches, analysts, and cricket enthusiasts.
- Total Matches, Teams, Runs, Wickets KPI cards
- Highest Team Score & Average Match Score
- Season Run Trends, Team Win Distribution, Toss Impact charts
- Top 10 Batters & Bowlers charts
- Strike Rate Scatter Analysis
- Match Phase (Powerplay / Middle / Death Overs) run rate chart
- Dismissal Methods Distribution
- Venue Performance Analysis
- Auto-generated cricket insights from data
- Hidden pattern detection
- Tactical co-pilot summaries
- Analytical Match Ledger with pagination
- Exportable PDF reports (PDFKit)
- CSV data export
- PNG chart exports
- JWT Authentication (Register / Login / Logout)
- bcrypt password hashing
- File validation middleware
- Rate limiting
| Technology | Version |
|---|---|
| React | 19 |
| Next.js | 16 (Turbopack) |
| Tailwind CSS | v4 |
| Recharts | v3 |
| Framer Motion | v12 |
| TypeScript | v5 |
| Technology | Version |
|---|---|
| Node.js | LTS |
| Express.js | v4 |
| JWT (jsonwebtoken) | v9 |
| Multer | v1 |
| PDFKit | v0.15 |
| csv-parser | v3 |
| TypeScript | v5 |
- Pandas, NumPy, Matplotlib
- Data cleaning, feature engineering, visualizations
ai-powered-cricket-analytics-studio/
โโโ frontend/ # Next.js React App
โ โโโ src/
โ โ โโโ app/ # Pages (Home, Dashboard, Analytics, Reports, About, Profile)
โ โ โโโ components/ # Navbar, Sidebar, Charts, Filters, Footer, etc.
โ โ โโโ context/ # Auth, Analytics, Toast contexts
โ โ โโโ utils/ # Mock data, helpers
โ โโโ package.json
โ
โโโ backend/ # Express.js REST API
โ โโโ src/
โ โ โโโ controllers/ # Auth, Analytics, Dataset, Report controllers
โ โ โโโ routes/ # API route definitions
โ โ โโโ middleware/ # Auth, logging, rate limiter, cache, upload
โ โ โโโ services/ # analyticsService, pdfService
โ โ โโโ server.ts # Express app entry point
โ โโโ package.json
โ
โโโ python_engine/ # Python Data Processing
โโโ data_cleaning/
โโโ feature_engineering/
โโโ analytics/
โโโ visualizations/
To run the full-stack system locally, configure the following environment files in their respective folders:
PORT=5000
JWT_SECRET=ipl_insightx_super_secret_key_2026
FRONTEND_URL=http://localhost:3000NEXT_PUBLIC_API_URL=http://localhost:5000The platform processes and validates custom datasets uploaded by administrators. Ensure your .csv files match the following header schemas:
| Column Header | Type | Description |
|---|---|---|
id / match_id / ID |
Integer | Unique identifier of the match |
season / Season |
String | IPL Season Year (e.g., 2024) |
city / City |
String | Host City |
date / Date |
String | Date of the match |
team1 / Team1 |
String | Home Team Name |
team2 / Team2 |
String | Away Team Name |
toss_winner |
String | Winner of the toss |
toss_decision |
String | Toss decision (field or bat) |
winner / Winner |
String | Winning Team Name |
win_by_runs |
Integer | Win margin in runs |
win_by_wickets |
Integer | Win margin in wickets |
venue / Venue |
String | Stadium venue name |
| Column Header | Type | Description |
|---|---|---|
match_id / ID |
Integer | Matches key linking to matches.csv |
inning / Innings |
Integer | Inning count (1 or 2) |
batting_team |
String | Batting team name |
bowling_team |
String | Bowling team name |
over / overs |
Integer | Over number (0-indexed, 0 to 19) |
ball / balls |
Integer | Ball number within the over (1 to 6) |
batter / striker |
String | Batsman facing delivery |
bowler |
String | Bowler delivering ball |
runs_off_bat |
Integer | Runs scored off the bat |
extra_runs |
Integer | Extra runs conceded (wides, noballs) |
total_runs |
Integer | Total runs in the delivery (runs_off_bat + extra_runs) |
player_dismissed |
String | Name of player out (if wicket fell) |
dismissal_kind |
String | Dismissal category (e.g., caught, bowled, run out) |
The user interface is built on Next.js with app-router-based file routing. Subsystems are modularly decoupled into layouts, contexts, and presentation components.
| Route | Access | Key Rendered Components | Purpose & Interactions |
|---|---|---|---|
/ |
Public | Hero Showcase, Auth Modals | Portal landing, application branding, login/registration trigger |
/dashboard |
Authenticated | Navbar, Sidebar, FiltersSection, ChartsSection |
Core KPI overview cards (Matches, Runs, Average, Highest scores) & Season/Wins trends charts |
/analytics |
Authenticated | Navbar, Sidebar, FiltersSection, AIInsightCards |
Detailed top batter/bowler charts, Strike Rate scatter analysis, match phase metrics, and tactical insights |
/reports |
Authenticated | Navbar, Sidebar, DatasetUpload |
Match ledger analytical grid, CSV data exports, interactive PDF Kit compilation |
/profile |
Authenticated | Navbar, Sidebar, User Metadata Log |
Account profiling and dynamic database upload history tracker |
/about |
Public | Markdown Profile Card | Documentation and project credits page |
graph TD
Layout[src/app/layout.tsx] --> App[src/app/page.tsx]
Layout --> AuthCtx[AuthContext Provider]
Layout --> AnalyticsCtx[AnalyticsContext Provider]
AuthCtx --> Dashboard[src/app/dashboard/page.tsx]
AnalyticsCtx --> Dashboard
Dashboard --> Nav[Navbar.tsx]
Dashboard --> Side[Sidebar.tsx]
Dashboard --> Filters[FiltersSection.tsx]
Dashboard --> Charts[ChartsSection.tsx]
Dashboard --> AI[AIInsightCards.tsx]
- Node.js >= 18
- npm >= 9
- Python 3.10+ (for python_engine)
git clone https://github.com/VIJAYAPANDIANT/ai-powered-cricket-analytics-studio.git
cd ai-powered-cricket-analytics-studiocd backend
npm install
npm run devcd frontend
npm install
npm run devhttp://localhost:3000
The python_engine performs offline batch analytics, custom feature extraction, and high-fidelity Matplotlib visualization rendering.
- Mock Data Generation (
mock_generator.py): Automatically constructs valid mock files underpython_engine/data/if datasets are missing. - Ingestion & Data Cleaning (
cleaner.py): Standardizes team nomenclature, cleans invalid venue strings, and normalizes column headers. - Feature Engineering (
features.py): Configures overs phase categories (Powerplay, Middle, Death) and calculates cumulative batter and bowler metrics. - Calculations (
analytics.py): Aggregates toss impact win ratios, season runs averages, venue bias, and dismissal distributions. - Visualization (
visualizer.py): Generates high-res PNG plots for team wins, run trends, scatter plots, and wicket distributions.
cd python_engine
# Install analytical libraries
pip install -r requirements.txt
# Run pipeline processing
python src/main.pyOutput summaries are exported to python_engine/output/stats/ (as CSV tables) and graphs to python_engine/output/plots/ (as PNGs).
The backend REST API implements strict industry-standard middleware layers to protect, rate-limit, and optimize data serving.
flowchart TD
Req[Incoming HTTP Request] --> CORS[CORS Middleware]
CORS --> Limit[Rate Limiter Middleware]
Limit --> Auth{Auth Required?}
Auth -- Yes --> JWT[JWT Verification Middleware]
Auth -- No --> Cache{Cache Available?}
JWT --> Cache
Cache -- Yes (Hit) --> ResCache[Return Cached JSON]
Cache -- No (Miss) --> Process[Execute Service Route Handler]
Process --> WriteCache[Update In-Memory Cache]
WriteCache --> Res[Return HTTP Response]
- JWT Verification Middleware (
authMiddleware.ts): Secures data and reporting endpoints. Inspects HTTP Headers forAuthorization: Bearer <token>, decrypts and signs claims usingjsonwebtokenagainst the server'sJWT_SECRET. - CORS Security Middleware (
server.ts): Restricts requests to the verifiedFRONTEND_URLenvironment configuration, blocking cross-origin requests from unauthorized web agents. - Express Rate Limiting (
rateLimiter): Prevents brute force and API abuse. Configured to permit a maximum of 100 requests per 15-minute window per IP address. - File Validation Middleware (
uploadMiddleware.ts): Integratesmulterfile-system pipelines. Intercepts CSV file uploads, verifying.csvMIME types, maximum 10MB sizes, and matching tabular column headers. - In-Memory Cache Layer (
cacheMiddleware.ts): Speeds up API response latency to< 15ms. Saves parsed analytics calculations. Caches are automatically flushed when a newmatches.csvordeliveries.csvdataset is uploaded.
Creates a new administrative or standard user account.
- Request Header:
Content-Type: application/json - Request Body:
{ "username": "cricket_analyst", "email": "analyst@iplinsightx.com", "password": "StrongPassword123" } - Success Response (201 Created):
{ "success": true, "message": "User registered successfully.", "user": { "id": "usr_902183", "username": "cricket_analyst", "email": "analyst@iplinsightx.com" } }
Authenticates user and returns a signed JWT.
- Request Body:
{ "email": "analyst@iplinsightx.com", "password": "StrongPassword123" } - Success Response (200 OK):
{ "success": true, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "user": { "username": "cricket_analyst", "email": "analyst@iplinsightx.com" } }
Uploads and parses a new matches.csv dataset.
- Headers:
Authorization: Bearer <token>,Content-Type: multipart/form-data - Multipart Field:
matches(File attachment) - Success Response (200 OK):
{ "success": true, "message": "Matches CSV uploaded and validated successfully.", "metadata": { "filename": "matches-171680193.csv", "fileType": "matches", "sizeBytes": 140280, "rowCount": 950, "uploadedAt": "2026-05-27T00:15:00.000Z", "status": "valid" } }
Retrieves logs of all currently ingested datasets.
- Headers:
Authorization: Bearer <token> - Response (200 OK):
{ "success": true, "metadata": [ { "filename": "matches-171680193.csv", "fileType": "matches", "sizeBytes": 140280, "rowCount": 950, "uploadedAt": "2026-05-27T00:15:00.000Z", "status": "valid" } ] }
All analytics endpoints support search query parameters:
season(e.g.2024)team(e.g.Mumbai Indians)venue(e.g.Wankhede Stadium)batter(e.g.Virat Kohli)bowler(e.g.Jasprit Bumrah)
Fetches high-level aggregated KPIs.
- Query Parameters:
?season=2024 - Response (200 OK):
{ "success": true, "data": { "totalMatches": 74, "totalTeams": 10, "totalRuns": 24203, "totalWickets": 890, "highestTeamScore": 277, "averageMatchScore": 178 } }
Retrieves AI co-pilot observations derived from the active datasets.
- Response (200 OK):
{ "success": true, "insights": [ "Teams winning the toss win the match in 56.4% of encounters under these parameters.", "Chasing bias detected: Teams batting second have won 58.1% of matches. Captains should opt to field first.", "At Wankhede Stadium, winning the toss increases match victory probability by 62.0%." ] }
Streams the dynamically generated A4 Executive PDF Report.
- Query Parameters:
?season=2024&team=Chennai+Super+Kings - Response: Binary Stream (
Content-Type: application/pdf,Content-Disposition: attachment; filename="IPL_InsightX_Report.pdf")
- Predictive ML Copilot: Integrate a machine learning model to predict match outcomes and run trajectories based on live situations.
- Real-Time Data Ingestion: Setup Websocket-based live data feeds for ongoing IPL matches.
- Head-to-Head Visualizer: Provide interactive comparisons between two specific players.
- Advanced Pitch Analysis: Incorporate weather and boundary distance into venue calculations.
| Field | Value |
|---|---|
| Name | Vijayapandian T |
| vijayapandian112007@gmail.com | |
| Role | Platform Administrator |
This project is licensed under the MIT License - see the LICENSE file for details.
ยฉ 2026 IPL InsightX โ AI Powered Cricket Analytics Studio.