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
-
Get a free API key at football-data.org/client/register.
-
Push this folder to a GitHub repo, then import it on vercel.com/new.
-
Add a database: in your Vercel project → Storage → Create Database → Neon (Postgres). This auto-sets
DATABASE_URL. Tables are created automatically on first use. -
Set environment variables (Project → Settings → Environment Variables):
Variable Value SHARED_CODEthe code you give your friends (e.g. golazo2026)SESSION_SECRETany long random string ( openssl rand -hex 32)FOOTBALL_DATA_TOKENyour football-data.org key CRON_SECRET(optional) random string to protect the cron endpoint -
Deploy. Visit the site — fixtures sync automatically on first page load.
- 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.
- 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.
cp .env.example .env.local # fill in values
npm install
npm run devnpm run test:unit # vitest — pure scoring / token / live-window logic
npm run test:e2e # playwright — login + remember-code flowsThe 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.