Track and visualize performance for club and national teams: records, goals, player abilities, head-to-head results, and analytics.
Default setup pulls real match results (no paid API keys).
| Layer | Tech |
|---|---|
| Frontend | React, TypeScript, Vite, Tailwind CSS, Recharts, React Router |
| Backend | Node.js, Express |
| Database | SQLite via Prisma (swap-ready for Postgres) |
| State | React Context (team type filter + player compare selection) |
npm run setup # install + db + sync:real
npm run devOr step by step:
npm install
npm run db:generate
npm run db:push
npm run sync:real
npm run devThen open:
npm run sync:real downloads current top-5 league results and can take a few minutes (squad fetch is rate-limited).
Open Predict in the nav (or /predict). Pick two clubs or two nations to get:
- Most likely scoreline + expected goals (xG)
- Win / draw / away probabilities, Over/Under 2.5, BTTS
- Predicted possession, shots, shots on target, corners, fouls
- Recent form badges + H2H summary
Model: Poisson attack–defence rates from real results, adjusted by form, H2H, and FIFA rank (nations).
| Source | What you get | Key required? |
|---|---|---|
| football-data.co.uk CSV | Real finished matches — Premier League, La Liga, Serie A, Bundesliga, Ligue 1 (2024/25 + 2025/26 by default) | No |
| Bundled FIFA ranking list | Top 200 national teams + confederations (June 2026 cycle) | No |
| Bundled major-club squads | Real player names/positions for big clubs (Player Analyzer) | No |
| TheSportsDB | Optional extra squads/badges (often rate-limited on free key) | Free key 3 |
| football-data.org | UEFA Champions League, World Cup, Euro finished matches + crests | Free token (optional) |
- Register at https://www.football-data.org/client/register (free forever tier).
- Add to
server/.env:
FOOTBALL_DATA_API_KEY=your_token_here- Re-run:
npm run sync:realEA/FIFA-style 0–100 attribute ratings are not available from free APIs. Real player names / positions / ages / nationality are imported; radar values are estimated from position so the Player Analyzer UI still works.
npm run setup:mock # or: npm run seed| Command | Description |
|---|---|
npm run setup |
Install, push schema, sync real data |
npm run sync:real |
Re-download real results/squads into SQLite |
npm run seed |
Load generated mock data instead |
npm run setup:mock |
Install + mock seed |
npm run dev |
API + Vite client |
npm run db:push |
Apply Prisma schema |
Env knobs in server/.env:
FOOTBALL_CSV_SEASONS=2526,2425— CSV seasons to importSYNC_SKIP_SQUADS=1— skip TheSportsDB player downloadSYNC_SQUAD_LIMIT=20— only first N clubs for faster testing
GET /api/teams?type=CLUB|COUNTRY&league=&country=&q=GET /api/teams/:id— detail, season stats, recent form, win% seriesGET /api/teams/:id/matchesGET /api/players?teamId=&q=&position=GET /api/players/compare?ids=id1,id2GET /api/matches?type=&teamId=GET /api/matches/h2h?teamA=&teamB=GET /api/analytics/top-scorers?type=GET /api/analytics/best-win-pct?type=GET /api/analytics/top-players?position=&type=
- Team Dashboard — Club/Country toggle, search/filter, W-D-L from real results
- Team Detail — Record, goals, win% over time, recent form
- Player Analyzer — Real squad names (where available) + estimated ability radar
- Comparison — Overlay radars + attribute table
- Match Analysis — Real scores + head-to-head
- Analytics — Win% leaders; top scorers when goal events exist
- In
server/prisma/schema.prisma, setprovider = "postgresql". - Set
DATABASE_URLinserver/.env. - Run
npm run db:pushthennpm run sync:real.
Football_Analyzer/
├── client/ # React + Vite UI
├── server/
│ ├── prisma/ # schema + optional mock seed
│ └── src/
│ ├── adapters/ # CSV, football-data.org, TheSportsDB
│ ├── sync/ # syncRealData.ts
│ └── routes/ # REST API
└── package.json