Skip to content

zroberson165/NextDown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NextDown

ML-powered assistant coach for football play-calling. Enter venue, matchup, and game situation to get top play recommendations with success probability.


Run locally (for demos)

You need two terminals: one for the backend API, one for the frontend. Run both from the repo root.

Prerequisites

  • Python 3.10+ (for backend)
  • Node.js 18+ and npm (for frontend)

1. Backend

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 --reload

Backend 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).

2. Frontend

In a second terminal, from the repo root:

cd frontend
npm install
npm run dev

Frontend runs at http://localhost:5173.

3. Use the app

  1. Open http://localhost:5173 in your browser.
  2. 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.
  3. 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.
  4. 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.


Project layout

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

Training (optional)

If the model artifacts are missing or you want to retrain:

  1. Place your training data as data/train_with_stats.csv (or run the pipeline: merger.pyfilter.pymerged2.py to build it from raw data).

  2. From the repo root:

    python scripts/train_model.py
  3. This writes .pkl files into models/. Restart the backend if it’s already running.


Quick reference

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

About

Winning hackathon project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors