Skip to content

Repository files navigation

WC26 Picks ⚽

A dead-simple World Cup 2026 prediction site for a group of friends.

  • Shared group code gates access; players register with just a name + PIN
  • Pick winners (and draws in the group stage) — no score predictions
  • Picks lock at kickoff; once locked, everyone's picks are revealed
  • Results auto-sync from football-data.org
  • Scoring: each match is a pot (1 point per player who picked it), split equally among everyone who picked the correct result — rarer correct calls pay more

Deploy (≈10 minutes)

  1. Get a free API key at football-data.org/client/register.

  2. Push this folder to a GitHub repo, then import it on vercel.com/new.

  3. Add a database: in your Vercel project → StorageCreate DatabaseNeon (Postgres). This auto-sets DATABASE_URL. Tables are created automatically on first use.

  4. Set environment variables (Project → Settings → Environment Variables):

    Variable Value
    SHARED_CODE the code you give your friends (e.g. golazo2026)
    SESSION_SECRET any long random string (openssl rand -hex 32)
    FOOTBALL_DATA_TOKEN your football-data.org key
    CRON_SECRET (optional) random string to protect the cron endpoint
  5. Deploy. Visit the site — fixtures sync automatically on first page load.

How syncing works

  • Any page view triggers a sync if data is older than 10 minutes (well within the free tier's 10 req/min limit).
  • A daily Vercel cron (vercel.json) acts as a backstop.
  • Want fresher live scores? Just reload the leaderboard — it re-syncs when stale.

Rules baked in

  • Group-stage matches: pick home win / draw / away win.
  • Knockout matches: pick a winner (extra time / penalties count — no draw option).
  • Matches with TBD teams can't be picked until teams are decided.
  • Picks can be changed any number of times until kickoff.
  • A correct pick (home / draw / away) shares that match's pot with the other players who got it right; a wrong pick scores 0. There is no separate bonus for draws — they simply tend to be rarer picks, so they pay more.

Local dev

cp .env.example .env.local   # fill in values
npm install
npm run dev

Tests

npm run test:unit   # vitest — pure scoring / token / live-window logic
npm run test:e2e    # playwright — login + remember-code flows

The remember-code e2e specs launch their own dev server with fixed SHARED_CODE/SESSION_SECRET. If you already have npm run dev running on port 3000, Playwright reuses it and those env values won't apply — stop that server first, or run the e2e suite with CI=1.

Releases

Packages

Contributors

Languages