# nishancshetty/premier-league-analytics architecture

> Architecture diagram of the GitHub repository nishancshetty/premier-league-analytics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nishancshetty/premier-league-analytics
- Repository: https://github.com/nishancshetty/premier-league-analytics

## Overview

The product is a Premier League analytics web app. Users enter through a landing page, then view dashboard and fixtures pages; live match updates have a separate Socket.IO path. The backend exposes football and dashboard routes backed by an external football-data API, and runs a simulated live-match engine. The README also describes player/team statistics, comparisons, predictions, summaries, and news, but their implementation is not established by the sampled source. Those capabilities are represented cautiously; no database or AI runtime is evidenced.

Main entry points: [`client/src/App.jsx`](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/App.jsx) (Route selection), [`server.js`](https://github.com/nishancshetty/premier-league-analytics/blob/main/server.js) (Server startup), [`services/liveMatchEngine.js`](https://github.com/nishancshetty/premier-league-analytics/blob/main/services/liveMatchEngine.js) (Match simulation), [`app.js`](https://github.com/nishancshetty/premier-league-analytics/blob/main/app.js) (API application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_webapp["Route selection<br/>[App.jsx]"]
  node_landing["Landing page<br/>[LandingPage.tsx]"]
  node_dashboard["Dashboard<br/>[Home.jsx]"]
  node_league["League table<br/>[LeagueTable.jsx]"]
  node_fixtures["Fixtures<br/>[Fixtures.jsx]"]
  node_players["Player statistics<br/>[Players.jsx]"]
  node_teams["Team statistics<br/>[Teams.jsx]"]
  node_livepage["Live match view<br/>[LiveMatch.jsx]"]
  node_matchhook["Live match hook<br/>[useLiveMatch.js]"]
  node_matchclient["Socket client<br/>[socket.js]"]
  node_matchapi["Match data hook<br/>[useMatches.js]"]
  node_httpclient["HTTP client<br/>[api.js]"]
end

subgraph group_api["Football API"]
  node_apiapp["API application<br/>[app.js]"]
  node_footballroutes["Football routes<br/>[footballRoutes.js]"]
  node_footballcontroller["Match controller"]
  node_dashboardroutes["Dashboard routes<br/>[dashboardRoutes.js]"]
  node_dashboardcontroller["Dashboard controller"]
  node_footballservice["Football data service<br/>[footballApi.js]"]
end

subgraph group_live["Live match"]
  node_server["Server startup<br/>[server.js]"]
  node_engine["Match simulation<br/>[liveMatchEngine.js]"]
  node_matchstate[("Match state<br/>[matchService.js]")]
  node_socketserver["Socket server<br/>[socket.js]"]
end

subgraph group_integrations["External data"]
  node_footballfeed["Football data provider"]
  node_predictions["AI predictions"]
  node_summaries["AI summaries"]
  node_comparison["Player and club comparisons"]
  node_news["Injury and transfer news"]
end

node_visitor(("Football fan"))

node_visitor -->|"opens"| node_webapp
node_webapp -->|"routes to"| node_landing
node_webapp -->|"routes to"| node_dashboard
node_webapp -->|"routes to"| node_fixtures
node_webapp -->|"routes to"| node_livepage
node_dashboard -->|"renders"| node_league
node_matchhook -->|"uses"| node_matchclient
node_livepage -->|"uses"| node_matchclient
node_matchhook -.->|"supplies updates"| node_livepage
node_matchapi -->|"uses"| node_httpclient
node_fixtures -->|"fetches matches"| node_httpclient
node_apiapp -->|"mounts"| node_footballroutes
node_apiapp -->|"mounts"| node_dashboardroutes
node_footballroutes -->|"dispatches"| node_footballcontroller
node_dashboardroutes -->|"dispatches"| node_dashboardcontroller
node_footballcontroller -->|"fetches matches"| node_footballservice
node_dashboardcontroller -->|"fetches matches"| node_footballservice
node_footballservice -->|"requests data"| node_footballfeed
node_server -->|"starts"| node_apiapp
node_server -->|"initializes"| node_socketserver
node_server -->|"starts"| node_engine
node_engine -->|"updates"| node_matchstate
node_engine -->|"broadcasts through"| node_socketserver
node_matchclient -.->|"receives events"| node_socketserver
node_visitor -.->|"explores"| node_predictions
node_visitor -.->|"reads"| node_summaries
node_visitor -.->|"compares"| node_comparison
node_visitor -.->|"checks"| node_news

click node_webapp "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/App.jsx"
click node_landing "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/LandingPage.tsx"
click node_dashboard "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/Home.jsx"
click node_league "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/components/dashboard/LeagueTable.jsx"
click node_fixtures "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/Fixtures.jsx"
click node_players "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/Players.jsx"
click node_teams "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/Teams.jsx"
click node_livepage "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/LiveMatch.jsx"
click node_matchhook "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/hooks/useLiveMatch.js"
click node_matchclient "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/services/socket.js"
click node_matchapi "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/hooks/useMatches.js"
click node_httpclient "https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/services/api.js"
click node_apiapp "https://github.com/nishancshetty/premier-league-analytics/blob/main/app.js"
click node_footballroutes "https://github.com/nishancshetty/premier-league-analytics/blob/main/routes/footballRoutes.js"
click node_footballcontroller "https://github.com/nishancshetty/premier-league-analytics/blob/main/controllers/footballController.js"
click node_dashboardroutes "https://github.com/nishancshetty/premier-league-analytics/blob/main/routes/dashboardRoutes.js"
click node_dashboardcontroller "https://github.com/nishancshetty/premier-league-analytics/blob/main/controllers/dashboardController.js"
click node_footballservice "https://github.com/nishancshetty/premier-league-analytics/blob/main/services/footballApi.js"
click node_server "https://github.com/nishancshetty/premier-league-analytics/blob/main/server.js"
click node_engine "https://github.com/nishancshetty/premier-league-analytics/blob/main/services/liveMatchEngine.js"
click node_matchstate "https://github.com/nishancshetty/premier-league-analytics/blob/main/services/matchService.js"
click node_socketserver "https://github.com/nishancshetty/premier-league-analytics/blob/main/sockets/socket.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_landing,node_dashboard,node_league,node_fixtures,node_players,node_teams,node_livepage,node_matchhook,node_matchclient,node_matchapi,node_httpclient toneBlue
class node_apiapp,node_footballroutes,node_footballcontroller,node_dashboardroutes,node_dashboardcontroller,node_footballservice toneAmber
class node_server,node_engine,node_matchstate,node_socketserver toneMint
class node_footballfeed,node_predictions,node_summaries,node_comparison,node_news toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Route selection](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Landing page](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/LandingPage.tsx): `client/src/pages/LandingPage.tsx`
- [Dashboard](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/Home.jsx): `client/src/pages/Home.jsx`
- [League table](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/components/dashboard/LeagueTable.jsx): `client/src/components/dashboard/LeagueTable.jsx`
- [Fixtures](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/Fixtures.jsx): `client/src/pages/Fixtures.jsx`
- [Player statistics](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/Players.jsx): `client/src/pages/Players.jsx`
- [Team statistics](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/Teams.jsx): `client/src/pages/Teams.jsx`
- [Live match view](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/pages/LiveMatch.jsx): `client/src/pages/LiveMatch.jsx`
- [Live match hook](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/hooks/useLiveMatch.js): `client/src/hooks/useLiveMatch.js`
- [Socket client](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/services/socket.js): `client/src/services/socket.js`
- [Match data hook](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/hooks/useMatches.js): `client/src/hooks/useMatches.js`
- [HTTP client](https://github.com/nishancshetty/premier-league-analytics/blob/main/client/src/services/api.js): `client/src/services/api.js`

### Football API

- [API application](https://github.com/nishancshetty/premier-league-analytics/blob/main/app.js): `app.js`
- [Football routes](https://github.com/nishancshetty/premier-league-analytics/blob/main/routes/footballRoutes.js): `routes/footballRoutes.js`
- [Match controller](https://github.com/nishancshetty/premier-league-analytics/blob/main/controllers/footballController.js): `controllers/footballController.js`
- [Dashboard routes](https://github.com/nishancshetty/premier-league-analytics/blob/main/routes/dashboardRoutes.js): `routes/dashboardRoutes.js`
- [Dashboard controller](https://github.com/nishancshetty/premier-league-analytics/blob/main/controllers/dashboardController.js): `controllers/dashboardController.js`
- [Football data service](https://github.com/nishancshetty/premier-league-analytics/blob/main/services/footballApi.js): `services/footballApi.js`

### Live match

- [Server startup](https://github.com/nishancshetty/premier-league-analytics/blob/main/server.js): `server.js`
- [Match simulation](https://github.com/nishancshetty/premier-league-analytics/blob/main/services/liveMatchEngine.js): `services/liveMatchEngine.js`
- [Match state](https://github.com/nishancshetty/premier-league-analytics/blob/main/services/matchService.js): `services/matchService.js`
- [Socket server](https://github.com/nishancshetty/premier-league-analytics/blob/main/sockets/socket.js): `sockets/socket.js`

### External data

- **Football data provider**
- **AI predictions**
- **AI summaries**
- **Player and club comparisons**
- **Injury and transfer news**

### Other components

- **Football fan**

## Connections

- Football fan → Route selection: opens
- Route selection → Landing page: routes to (evidence: `client/src/App.jsx`)
- Route selection → Dashboard: routes to (evidence: `client/src/App.jsx`)
- Route selection → Fixtures: routes to (evidence: `client/src/App.jsx`)
- Route selection → Live match view: routes to (evidence: `client/src/App.jsx`)
- Dashboard → League table: renders (evidence: `client/src/pages/Home.jsx`)
- Live match hook → Socket client: uses (evidence: `client/src/hooks/useLiveMatch.js`)
- Live match view → Socket client: uses (evidence: `client/src/pages/LiveMatch.jsx`)
- Live match hook → Live match view: supplies updates
- Match data hook → HTTP client: uses (evidence: `client/src/hooks/useMatches.js`)
- Fixtures → HTTP client: fetches matches (evidence: `client/src/pages/Fixtures.jsx`)
- API application → Football routes: mounts (evidence: `app.js`)
- API application → Dashboard routes: mounts (evidence: `app.js`)
- Football routes → Match controller: dispatches (evidence: `routes/footballRoutes.js`)
- Dashboard routes → Dashboard controller: dispatches (evidence: `routes/dashboardRoutes.js`)
- Match controller → Football data service: fetches matches (evidence: `controllers/footballController.js`)
- Dashboard controller → Football data service: fetches matches (evidence: `controllers/dashboardController.js`)
- Football data service → Football data provider: requests data (evidence: `services/footballApi.js`)
- Server startup → API application: starts (evidence: `server.js`)
- Server startup → Socket server: initializes (evidence: `server.js`)
- Server startup → Match simulation: starts (evidence: `server.js`)
- Match simulation → Match state: updates (evidence: `services/liveMatchEngine.js`)
- Match simulation → Socket server: broadcasts through (evidence: `services/liveMatchEngine.js`)
- Socket client → Socket server: receives events
- Football fan → AI predictions: explores (evidence: `README.md`)
- Football fan → AI summaries: reads (evidence: `README.md`)
- Football fan → Player and club comparisons: compares (evidence: `README.md`)
- Football fan → Injury and transfer news: checks (evidence: `README.md`)
