A web application for analyzing MLB pitching statistics and key performance indicators, focusing on the San Diego Padres' July 2024 games.
This project includes a .env file in the backend folder for simplicity and good practice. The file contains configuration values necessary to run the project, but it does not contain sensitive data.
Feel free to modify the values in the .env file if needed for your setup.
Before starting, you'll need to install:
-
Node.js and npm:
- Download and install from: https://nodejs.org/
- This will install both Node.js and npm
- After installation, verify with: node --version npm --version
-
Python and pip:
- Download and install from: https://www.python.org/downloads/
- Make sure to check "Add Python to PATH" during installation
- After installation, verify with: python --version pip --version
- Clone the repository (choose one option):
HTTPS: git clone https://github.com/skezsoftware/padres-project.git
cd padres-project
SSH: git clone git@github.com:skezsoftware/padres-project.git
cd padres-project
- Navigate to the frontend directory:
cd frontend
- Install dependencies:
npm install
- Start the development server:
npm run dev
The frontend will run on http://localhost:5173
- Navigate to the backend directory:
cd backend
- Create and activate a virtual environment:
Windows:
python -m venv venv
.\venv\Scripts\activate
macOS/Linux:
python3 -m venv venv
source venv/bin/activate
- Copy the .env.example file to .env:
cp .env.example .env
- Install required Python packages:
pip install -r requirements.txt
- Start the backend server:
uvicorn app.main:app --reload
The backend API will run on http://localhost:8000
- Open your web browser and navigate to http://localhost:5173
- You'll see the team grid with the Padres centered
- Click on any team to view their pitching analytics:
- Select Padres to see their pitching staff performance
- Select other teams to see how their pitchers performed against Padres hitters
- Comprehensive pitching statistics
- Interactive heat maps
- Pitcher leaderboards
- Key performance indicators including:
- Strikeout percentage
- Walk percentage
- First pitch strike percentage
- Fielding Independent Pitching (FIP)
- Pitch-specific metrics
If you encounter any issues:
- Ensure both frontend and backend servers are running
- Note: The BACKEND_CORS_ORIGINS value in the .env file is formatted as a string representation of a list (e.g., ['http://localhost:5173']). This is intended for the application to parse correctly.
- Verify that ports 5173 and 8000 are available on your system
- Make sure all dependencies are properly installed
- Common solutions:
- If npm install fails, try deleting node_modules folder and package-lock.json, then run npm install again
- If Python packages fail to install, ensure you're using Python 3.8 or higher
- If ports are in use, you may need to kill existing processes or use different ports
Frontend:
- npm install (Install dependencies)
- npm run dev (Start development server)
- npm run build (Build for production)
Backend:
- pip install -r requirements.txt (Install Python dependencies)
- uvicorn app.main:app --reload (Start development server)