Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚽ Pickup Soccer

Organize pickup soccer games, manage player rosters, and auto-balance teams with a fairness algorithm.

Vite Vanilla JS

Features

  • Browse & join games — see open matches, slot availability, and join with one click
  • Player management — register players with defense, striker, and ball holding skill ratings (1–10)
  • Auto-balance teams — serpentine draft + swap refinement algorithm balances teams across all three skill dimensions
  • Admin panel — create games, manage players, reset demo data
  • Dark themed UI — glassmorphism, gradients, animations, fully responsive

Quick Start

# Clone the repo
git clone <repo-url>
cd pickup-soccer

# Install dependencies
npm install

# Start the dev server
npm run dev

Open http://localhost:5173 in your browser. Demo data (12 players, 2 games) loads automatically on first run.

Usage

Page What you can do
Home Dashboard with stats and upcoming games
Games Browse all games, filter by status, click to view details
Game Detail Add/remove players, click Balance Teams to auto-split
Players Add new players, edit skill ratings, delete players
Admin Create new games, manage roster, reset demo data

Balancing Algorithm

Teams are balanced using a two-phase approach:

  1. Serpentine draft — players sorted by composite score, then assigned in snake order (A, B, B, A, A, B, ...)
  2. Swap refinement — iteratively swap players between teams to minimize the cost function:
cost = |defenseGap| + |strikerGap| + |ballHoldingGap| + |overallGap|

This produces near-optimal splits for groups of 4–22 players.

Tests

node tests/balancer.test.js

Runs 32 unit tests covering even/odd splits, identical players, extreme skill gaps, and ball holding balance.

Project Structure

src/
├── main.js           # Entry point, toast & confirm dialogs, routing
├── router.js         # Hash-based SPA router
├── store.js          # localStorage CRUD + demo data seeding
├── balancer.js       # Team balancing algorithm
├── utils.js          # Helpers (UUID, dates, avatars)
├── styles/
│   ├── index.css     # Design system & layout
│   └── components.css# Cards, buttons, forms, tables, modals
└── views/
    ├── home.js       # Dashboard
    ├── games.js      # Game browser
    ├── game-detail.js# Roster & team display
    ├── players.js    # Player management
    └── admin.js      # Admin panel

License

MIT

About

An app for organizing pickup soccer games

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages