How krishna752006/ipl-prediction-system works
IPL Project is a full-stack IPL analysis and match-prediction application. Users register or log in, then access protected prediction, schedule, points-table, history, statistics, and team-analysis views. The backend’s documented ball-by-ball simulator builds match context and features, blends model predictions with heuristics, and returns innings results; authentication and prediction history use MongoDB. Separately, the repository includes an ML inference service and an offline data-preparation pipeline. Frontend page capabilities are documented by routes and filenames, but their detailed data wiring was not sampled.
Main entry points: App.tsx Web routes · match_engine.py Match simulator · authApi.ts API client · run_pipeline.py Data pipeline
Components 28
Web application
- Web routes
frontend/src/App.tsx - Login and register
frontend/src/pages/Login.tsx - Predictions
frontend/src/pages/Predictions.tsx - Analysis views
frontend/src/pages/Statistics.tsx - Schedule and table
frontend/src/pages/Schedule.tsx - Prediction history
frontend/src/pages/PredictionHistory.tsx - Auth state
frontend/src/store/authStore.ts - API client
frontend/src/api/authApi.ts
Application backend
- FastAPI application
backend/main.py - Prediction endpoint
backend/routers/predict.py - History endpoint
backend/routers/prediction_history.py - Match simulator
backend/services/match_engine.py - Ball features
backend/services/feature_builder.py - Match embeddings
backend/services/embeddings.py - Historical form
backend/services/historical_form.py - Bowler selection
backend/services/bowler_selector.py - Model runner
backend/services/model_runner.py - MongoDB
backend/database.py
Model inference
- ML prediction route
ml-service/app/routes.py - Prediction inference
ml-service/app/inference.py - Model loading
ml-service/core/model_loader.py - Model bundle
ml-service/core/model_bundle.py
Data preparation
- Data pipeline
data-service/run_pipeline.py - Clean matches
data-service/pipeline/clean_matches.py - Clean deliveries
data-service/pipeline/clean_deliveries.py - Offline statistics
data-service/pipeline/generate_offline_stats.py - Build features
data-service/pipeline/build_features.py
Other components
- User
Connections 28
- User → Web routes: uses
- Web routes → Login and register: routes to
- Web routes → Predictions: routes to
- Web routes → Analysis views: routes to
- Web routes → Schedule and table: routes to
- Web routes → Prediction history: routes to
- Login and register → API client: sends requests
- API client → Auth state: reads token
- Predictions → API client: uses client
- Prediction history → API client: uses client
- API client → FastAPI application: HTTP requests
- FastAPI application → Prediction endpoint: mounts router
- FastAPI application → History endpoint: mounts router
- FastAPI application → MongoDB: reads and writes users
- Prediction endpoint → Match simulator: runs simulation
- History endpoint → MongoDB: reads and writes history
- Match simulator → Ball features: builds features
- Match simulator → Match embeddings: builds context
- Match simulator → Historical form: gets player form
- Match simulator → Bowler selection: selects bowler
- Match simulator → Model runner: predicts balls
- ML prediction route → Prediction inference: runs prediction
- Prediction inference → Model loading: loads model
- Model loading → Model bundle: loads bundle
- Data pipeline → Clean matches: cleans matches
- Data pipeline → Clean deliveries: cleans deliveries
- Data pipeline → Offline statistics: generates stats
- Data pipeline → Build features: builds features