ML-powered assistant coach for football play-calling. Enter venue, matchup, and game situation to get top play recommendations with success probability.
You need two terminals: one for the backend API, one for the frontend. Run both from the repo root.
- Python 3.10+ (for backend)
- Node.js 18+ and npm (for frontend)
From the repo root:
# Create and use a virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r backend/requirements.txt
# Start the API server
uvicorn backend.main:app --reloadBackend runs at http://127.0.0.1:8000.
Model files: The backend loads .pkl files from the models/ folder. If you pulled the repo and that folder contains the trained artifacts, you’re set. If not, train the model first (see Training below).
In a second terminal, from the repo root:
cd frontend
npm install
npm run devFrontend runs at http://localhost:5173.
- Open http://localhost:5173 in your browser.
- Setup: Enter city (and click Fetch for weather), surface, roof, your team name, and opponent. Fill in your QB/RB/WR stats, then click Start game.
- Game: Choose Offense or Defense. On offense, enter drive stats (scores, timeouts, starting yard line) and save. Use the clock (Play / Stop); when you press Stop on offense, enter yards gained for the play. Use Get top 3 plays to see recommendations.
- Use ← Setup to return to the setup screen (you’ll be asked to confirm so you don’t quit the game by mistake).
The frontend proxies /api requests to the backend, so no CORS or port configuration is needed as long as both servers are running.
| Folder | Contents |
|---|---|
backend/ |
API server and predictor (loads from models/) |
frontend/ |
React app |
models/ |
Trained .pkl artifacts (used by the backend) |
data/ |
CSV data for training pipeline (e.g. train_with_stats.csv, merged.csv) |
scripts/ |
Training and data pipeline (e.g. train_model.py, merger.py, merged2.py, filter.py) |
docs/ |
Data dictionary, previews, scenario output |
If the model artifacts are missing or you want to retrain:
-
Place your training data as
data/train_with_stats.csv(or run the pipeline:merger.py→filter.py→merged2.pyto build it from raw data). -
From the repo root:
python scripts/train_model.py
-
This writes
.pklfiles intomodels/. Restart the backend if it’s already running.
| What | URL / command |
|---|---|
| Frontend | http://localhost:5173 |
| Backend API | http://127.0.0.1:8000 |
| API docs | http://127.0.0.1:8000/docs |
| Backend | uvicorn backend.main:app --reload |
| Frontend | cd frontend && npm run dev |