Skip to content

canias7/clubs-

Repository files navigation

FIFA Tournament Hub

Community FIFA tournament platform: 5 regions × 5 divisions × 20 clubs = 500 pre-seeded clubs, one cup per region, and a cross-region Champions League featuring the top 5 from each region's top flight.

All competitions are organised outside the actual FIFA game — managers and players use this site to claim clubs, build squads, schedule fixtures, and crown champions.

Regions

Five continent-scale regions: Europe, America, Africa, Asia, Australia.

Each region has 5 divisions (tier 1 = top) and one domestic cup. The Champions League is a cross-region knockout featuring the top 5 from each region's top flight (25 clubs).

Roles

  • Club manager — claims an unclaimed club, builds the squad, submits match results.
  • Player — joins a club's roster, racks up goals/assists, climbs the player leaderboard.

Features

  • Pre-seeded league pyramid for 5 regions, ready to play
  • Email + password auth (JWT cookie sessions)
  • Double round-robin league fixtures (38 matches per team, like real life)
  • Knockout brackets for cups & Champions League (auto-seeded, byes handled)
  • Match result entry with automatic bracket advancement
  • League tables (W/D/L, GF/GA/GD, points) with top-5 highlight for CL qualification
  • Global club leaderboard and player goals/assists leaderboard

Stack

  • Next.js 14 (App Router) + TypeScript
  • Tailwind CSS
  • Supabase Postgres (data + simple RPC functions for standings)
  • bcryptjs for password hashing, jsonwebtoken for sessions

Deploy to Vercel

  1. Push this repo to GitHub.
  2. Import it on https://vercel.com → New Project → Import from Git.
  3. Add the following Environment Variables in the Vercel dashboard:
    • JWT_SECRET — a long random string (e.g. openssl rand -hex 32)
    • NEXT_PUBLIC_SUPABASE_URL — your Supabase project URL
    • NEXT_PUBLIC_SUPABASE_ANON_KEY — your Supabase anon/publishable key
  4. Click Deploy. The app has no native binaries, so it runs on Vercel's standard serverless functions.

Note: Starting the Champions League generates ~127 matches with sequential bracket-linking queries and can take ~25–30s — if you're on Vercel's Hobby plan (10s function timeout), bump to Pro or start that competition from a local run.

Run locally

npm install
cp .env.example .env   # then fill in the three values above
npm run dev

Open http://localhost:3000.

Database schema

The full schema, seed data, and helper RPC functions live in the Supabase project as migrations. The seed includes 5 regions, 25 divisions, 500 clubs, 25 leagues, 5 cups, and 1 Champions League for the current season (2026/27).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors