A lightweight web application for tracking minor league baseball statistics across multiple fantasy baseball teams. Track your prospects with professional-grade stats from FanGraphs and Baseball Savant.
- Track multiple fantasy teams with customizable rosters
- Real-time MiLB statistics from FanGraphs
- Statcast data for AAA and select leagues
- Time-based splits (Season, Last 7/14/30 days)
- Dark mode support
- Offline-capable progressive web app
- Automated stats updates via GitHub Actions
- React 18 + TypeScript
- Vite for build tooling
- Tailwind CSS for styling
- Zustand for state management
- Dexie.js for local storage (IndexedDB)
- TanStack Query for data fetching
- Python 3.11+ with pybaseball
- GitHub Actions for automated data updates
- GitHub Pages for hosting
- Node.js 20+
- Python 3.11+
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/MiLB-Tracker.git
cd MiLB-Tracker- Install frontend dependencies:
npm install- Install Python dependencies:
pip install -r scripts/requirements.txt- Start the development server:
npm run devThe app will be available at http://localhost:3000
When you first open the app:
- Click "+ Add Team" in the tab bar to create your first team
- Enter a team name (e.g., "My Dynasty Team")
- Optionally add league name and platform details
- Check "This is a watchlist" if creating a prospect watchlist
- Make sure you have a team selected (click on a team tab)
- Click "+ Add Player" in the controls bar
- Search for players by name, organization, position, or level
- Check the boxes next to players you want to add
- Click "Add X Players" to add them to your active team
Players are stored locally in your browser's IndexedDB, so your team rosters persist across sessions.
- Switch Teams: Click on any team tab to view that team's roster
- Add Teams: Click "+ Add Team" in the tab bar
- Watchlist: Create a team and mark it as a watchlist for prospects you're monitoring
- Delete Teams: (Coming soon - use browser DevTools to delete via IndexedDB for now)
- Select a time period from the dropdown (Season, Last 7/14/30 days)
- Toggle stat categories to show/hide columns
- Click on a player for detailed stats and game logs
The app uses GitHub Actions to automatically update player statistics:
- During season (April-September): Every 4 hours
- Off-season (October-March): Daily at 6 AM UTC
- Player index: Rebuilt weekly to capture new call-ups and roster changes
- Player Index (
player-index.json): A searchable database of ~6,000+ active MiLB players, rebuilt weekly - Stats Fetching: Stats are automatically fetched for all players in the player index
- No Manual Setup: Players you add through the UI will have stats available after the next scheduled update
You can also manually trigger updates via the GitHub Actions tab:
- "Update MiLB Stats" - Fetches latest stats for all players
- "Build Player Index" - Rebuilds the player search database
The app is deployed to GitHub Pages automatically when you push to the main branch.
- Enable GitHub Pages in your repository settings
- Set the source to "GitHub Actions"
- Push to main branch to trigger the first deployment
MiLB-Tracker/
├── .github/workflows/ # GitHub Actions workflows
├── data/ # JSON data files
│ ├── player-index.json # Searchable index of all MiLB players
│ ├── meta.json # Last update timestamp and counts
│ ├── stats/ # Season stats (e.g., 2024.json, 2025.json)
│ ├── game-logs/ # Game-by-game logs
│ └── statcast/ # Statcast data
├── scripts/ # Python data fetchers
│ ├── build_player_index.py # Builds searchable player database
│ ├── fetch_stats.py # Fetches stats for all indexed players
│ └── fetch_statcast.py # Fetches Statcast metrics
├── src/ # React application
│ ├── components/ # React components
│ ├── db/ # Dexie database config
│ ├── stores/ # Zustand stores
│ └── types/ # TypeScript types
└── docs/ # Documentation
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
- Data provided by FanGraphs
- Statcast data from Baseball Savant
- Built with pybaseball