Mobile-friendly React app that tracks playing time and recommends fair substitutions for kids' soccer. The coach decides; the app keeps track of fairness.
Node.js 18 or newer (https://nodejs.org) and npm.
npm install
npm run dev # http://localhost:5173 (also reachable from your phone on the same Wi-Fi: npm run dev -- --host)npm test # run once
npm run test:watch # re-run on changenpm run buildThis produces dist/index.html: one self-contained file (JS and CSS inlined, no CDN, works offline).
Open it directly in a browser, email it, or host it anywhere (GitHub Pages, Netlify, any web server).
npm run preview serves the built file locally to check it.
src/
main.jsx entry point
App.jsx UI: Setup, Match and Stats screens
styles.css
engine/ pure functions, no React, fully unit tested
time.js fmt, clockOf, played
config.js defaults, derive (available/bench/outfield), validate
suggest.js fair substitution recommendation (pure)
match.js doSub, closeAll, statRows, finish (history)
engine.test.js unit tests and full-match simulations
state/storage.js localStorage save/load (match state and history)
- Match state and saved match history live in the browser's localStorage on that device only.
- Swaps are normally capped at 2 per interval. The cap is lifted only when too few swap points remain in the half for every substitute to get on.
- Tolerance: playing-time differences under 20 seconds count as equal.