Fairkick helps balance pickup soccer games by locking in team captains and shuffling the remaining players into Green and Orange squads. The project ships with a React + Vite frontend and an optional FastAPI backend for server-side team generation.
.
├── frontend/ # React + TypeScript + Tailwind UI
└── backend/ # FastAPI service for team generation
The frontend is built with Vite, React, TypeScript, Tailwind CSS, and shadcn-inspired primitives.
cd frontend
npm install
npm run devIf you want the UI to call the FastAPI backend, expose the API URL via VITE_API_BASE_URL:
# .env.local
VITE_API_BASE_URL=http://127.0.0.1:8000When the variable is unset, the UI falls back to running the team-balancing algorithm in the browser.
The backend exposes a /generate endpoint that applies the same balancing rules. Install the
requirements and run the development server with Uvicorn:
cd backend
conda create -n fairkick python=3.11
conda activate fairkick
pip install -e .
uvicorn app.main:app --reloadRun tests with:
pytest- Add players and assign a tier (Pro, Advanced, Casual, New).
- Choose captains for the Green and Orange teams.
- Generate lineups. Captains stay fixed while the remaining players randomize into squads.
- Fairkick reports the total tier points per team and highlights the difference so you can decide whether to reshuffle.
The balancing logic alternates players between teams, always giving the lower-rated team the next pick while preserving randomness when the scores are tied.