A modern React web application for generating batting orders and field position rotations for little league baseball games. Installable as a Progressive Web App (PWA) on any device! π±
You can now install this on your iPhone, Android, or computer - completely FREE!
- π± Add to home screen on iOS/Android
- π» Install on desktop - Chrome, Edge, Safari
- β‘ Works offline after installation
- π« No App Store fees - Deploy and share instantly!
π See the PWA Installation Guide for details
- Web App: Use in any browser at your deployed URL
- PWA: Install on home screen (iPhone, Android, desktop) - FREE!
- Smart Player Input: Add players with individual name/number fields and Tab navigation
- Baseball Field Visualization: Interactive field diagram showing player positions (desktop view)
- Position Rotation: Automatic rotation ensuring fair playing time
- Fair Playing Time: Balances infield and outfield innings for each player
- Configurable Settings:
- Number of innings (1-9)
- Number of outfielders (2-4)
- Optional catcher position
- Responsive Design: Field overlay on desktop, list view on mobile
- Statistics Tracking: View each player's infield, outfield, and bench time
- Print Support: Print-optimized layout for game day
- Walk-Up Music: Play walk-up songs for each batter via Spotify Connect
- Node.js 18.0.0 or higher (Node.js 20.4+ recommended)
- npm (comes with Node.js)
-
Install Dependencies
npm install
-
Start Development Server
npm run dev
Open http://localhost:5173 in your browser
-
Build for Production
npm run build
Built files will be in the
dist/directory -
Run Tests
npm testRun tests in watch mode:
npm run test:watch
- Click "Load Example Team" to populate with sample players, or add players manually
- Enter player name β Tab β Enter number (optional) β Tab to add next player
- Use up/down arrows to reorder players in batting order
- Configure innings, outfielders, and catcher option
- Click "Generate Lineup" to create the rotation
- Print or save the lineup for game day
Play custom walk-up songs for each batter during the game using your Spotify account. Music plays through Spotify Connect on any active device (phone, speaker, computer).
- A Spotify Premium account (required for playback control)
- An active Spotify playback device (open Spotify on your phone, speaker, or computer)
- Click the π΅ Walk-Up Music button in the app
- Click Connect to Spotify β you'll be redirected to Spotify to authorize the app
- After approving, you'll be redirected back and connected
Note: The app uses the secure PKCE authorization flow, so no backend or client secret is needed.
To enable Spotify integration on your own deployment, you need a Spotify Developer App:
- Go to the Spotify Developer Dashboard
- Click Create App
- Fill in a name (e.g. "Batting Order Music") and description
- Set the Redirect URI to your app's URL (e.g.
https://your-site.vercel.app/for production orhttp://localhost:5173/for local dev) - Check Web API under "Which API/SDKs are you planning to use?"
- Save the app and copy your Client ID
- Set the
VITE_SPOTIFY_CLIENT_IDenvironment variable to your Client ID (in Vercel environment settings or a local.envfile)
- Once connected, select a playlist from your Spotify library to use as your song source
- For each player, click the edit button to assign a song from the playlist
- Optionally set a start time and end time (e.g.
0:30to0:45) to play just the best part of the song - Song assignments are saved locally and persist between sessions
- Config tab: Assign and manage songs for each player
- Play tab: Tap a player's name to play their walk-up song; tap again to stop
- Game Mode: Select a saved game to follow the batting order β use the next/previous batter buttons to advance through the lineup and auto-play each batter's song
- Music plays on whichever device is currently active in Spotify (phone, Bluetooth speaker, etc.)
- If playback fails, make sure Spotify is open and playing on at least one device
If you see an error like:
You are using Node.js X.X.X. Vite requires Node.js version 18.0.0+
Solution: Upgrade Node.js to version 18 or higher:
- Visit https://nodejs.org/ to download the latest LTS version
- Or use nvm:
nvm install 20andnvm use 20
After upgrading, delete node_modules and reinstall:
rm -rf node_modules package-lock.json
npm install- Players are assigned a batting order based on the order they're entered
- This batting order remains consistent throughout all innings
- All players bat, including those on the bench
The algorithm ensures fair distribution of positions:
- Balancing: Players with fewer active innings get priority for field positions
- Variety: The system balances time between infield and outfield positions
- Rotation: Positions rotate each inning using standard baseball numbering (1=P, 2=C, 3=1B, etc.)
- Bench: Players not on the field sit on the bench but remain in the batting order
After generating a lineup, you can view:
- Each player's batting order position
- Number of innings in infield positions
- Number of innings in outfield positions
- Number of innings on the bench
- React 19.2
- Vite 5.4 (fast build tool)
- Vanilla CSS (no external styling dependencies)
- PWA (Progressive Web App) - installable on all devices
This project is configured to automatically deploy to Vercel when a pull request is merged to the main branch.
-
Create a Vercel Account: Sign up for a free account at vercel.com
-
Create a New Project: In Vercel, import your GitHub repository
-
Get Required Credentials:
- VERCEL_TOKEN: Go to Settings β Tokens β Create a new token
- VERCEL_ORG_ID: Found in Settings β General β Your ID
- VERCEL_PROJECT_ID: Found in Project Settings β General β Project ID
-
Configure GitHub Secrets:
- Go to your GitHub repository β Settings β Secrets and variables β Actions
- Add three repository secrets:
VERCEL_TOKEN: Your Vercel access tokenVERCEL_ORG_ID: Your Vercel org/user IDVERCEL_PROJECT_ID: Your Vercel project ID
-
Automatic Deployment: Once configured, the site will automatically deploy when PRs are merged to
main
You can also trigger a deployment manually:
- Go to Actions tab in GitHub
- Select "Deploy to Vercel" workflow
- Click "Run workflow"
This app is a PWA and can be installed on any device!
π± See the complete PWA Guide for installation instructions.
Quick Install:
- iPhone/iPad: Open in Safari β Share β Add to Home Screen
- Android: Open in Chrome β Tap "Install" prompt or Menu β Install app
- Desktop: Click install icon in browser address bar
Benefits:
- β FREE - No app store fees
- β Works offline after installation
- β Looks like a native app
- β Works on ALL devices (iOS, Android, desktop)
- β Updates automatically when you deploy
Once deployed to Vercel, anyone can install your app on their device instantly!
Open source - feel free to use and modify for your team!