# exiastar/football-scores architecture

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

- Interactive diagram: https://gitdiagram.com/exiastar/football-scores
- Repository: https://github.com/exiastar/football-scores

## Overview

Gridiron is a self-hosted NFL and college-football scores dashboard. A user signs in, then the browser polls the backend for live games; the backend fetches and normalizes ESPN scoreboard data, and the client presents scores with calendar, schedule-list, team-filter, NFL-standings, and game-detail views. The backend also serves the web assets and protects score endpoints with token authentication. Source excerpts show the live-poll and server paths; schedule-loading and some UI wiring are not fully sampled, so those links are documented or omitted where evidence is limited.

Main entry points: [`public/app.js`](https://github.com/exiastar/football-scores/blob/main/public/app.js) (Score client), [`server.js`](https://github.com/exiastar/football-scores/blob/main/server.js) (API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Dashboard client"]
  node_auth_ui["Sign-in UI<br/>[app.js]"]
  node_score_client["Score client<br/>[app.js]"]
  node_calendar["Calendar view<br/>[app.js]"]
  node_schedule_list["Schedule list<br/>[app.js]"]
  node_team_filter["Team filter<br/>[app.js]"]
  node_standings["NFL standings<br/>[app.js]"]
  node_game_details["Game details<br/>[app.js]"]
end

subgraph group_backend["Backend services"]
  node_api_routes["API routes<br/>[server.js]"]
  node_authentication["Token authentication<br/>[server.js]"]
  node_schedule_cache["Schedule cache<br/>[server.js]"]
  node_active_weeks["Active-week selection<br/>[server.js]"]
  node_game_parser["Game normalization<br/>[server.js]"]
end

subgraph group_feeds["External data"]
  node_espn["ESPN scoreboards"]
end

node_user(("Dashboard user"))

node_user -->|"signs in"| node_auth_ui
node_user -->|"views scores"| node_score_client
node_auth_ui -.->|"submits login"| node_api_routes
node_score_client -->|"requests live scores"| node_api_routes
node_api_routes -->|"checks protected routes"| node_authentication
node_api_routes -->|"gets schedule"| node_schedule_cache
node_schedule_cache -->|"fetches weeks"| node_espn
node_api_routes -->|"selects live weeks"| node_active_weeks
node_active_weeks -->|"refreshes weeks"| node_espn
node_espn -->|"provides events"| node_game_parser
node_game_parser -->|"returns normalized games"| node_api_routes
node_score_client -->|"renders calendar"| node_calendar
node_score_client -->|"renders schedule"| node_schedule_list
node_score_client -->|"builds team options"| node_team_filter
node_score_client -->|"renders standings"| node_standings
node_score_client -->|"opens game modal"| node_game_details

click node_auth_ui "https://github.com/exiastar/football-scores/blob/main/public/app.js"
click node_score_client "https://github.com/exiastar/football-scores/blob/main/public/app.js"
click node_calendar "https://github.com/exiastar/football-scores/blob/main/public/app.js"
click node_schedule_list "https://github.com/exiastar/football-scores/blob/main/public/app.js"
click node_team_filter "https://github.com/exiastar/football-scores/blob/main/public/app.js"
click node_standings "https://github.com/exiastar/football-scores/blob/main/public/app.js"
click node_game_details "https://github.com/exiastar/football-scores/blob/main/public/app.js"
click node_api_routes "https://github.com/exiastar/football-scores/blob/main/server.js"
click node_authentication "https://github.com/exiastar/football-scores/blob/main/server.js"
click node_schedule_cache "https://github.com/exiastar/football-scores/blob/main/server.js"
click node_active_weeks "https://github.com/exiastar/football-scores/blob/main/server.js"
click node_game_parser "https://github.com/exiastar/football-scores/blob/main/server.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_auth_ui,node_score_client,node_calendar,node_schedule_list,node_team_filter,node_standings,node_game_details,node_user toneBlue
class node_api_routes,node_authentication,node_schedule_cache,node_active_weeks,node_game_parser toneAmber
class node_espn toneMint
```

## Components

### Dashboard client

- [Sign-in UI](https://github.com/exiastar/football-scores/blob/main/public/app.js): `public/app.js`
- [Score client](https://github.com/exiastar/football-scores/blob/main/public/app.js): `public/app.js`
- [Calendar view](https://github.com/exiastar/football-scores/blob/main/public/app.js): `public/app.js`
- [Schedule list](https://github.com/exiastar/football-scores/blob/main/public/app.js): `public/app.js`
- [Team filter](https://github.com/exiastar/football-scores/blob/main/public/app.js): `public/app.js`
- [NFL standings](https://github.com/exiastar/football-scores/blob/main/public/app.js): `public/app.js`
- [Game details](https://github.com/exiastar/football-scores/blob/main/public/app.js): `public/app.js`

### Backend services

- [API routes](https://github.com/exiastar/football-scores/blob/main/server.js): `server.js`
- [Token authentication](https://github.com/exiastar/football-scores/blob/main/server.js): `server.js`
- [Schedule cache](https://github.com/exiastar/football-scores/blob/main/server.js): `server.js`
- [Active-week selection](https://github.com/exiastar/football-scores/blob/main/server.js): `server.js`
- [Game normalization](https://github.com/exiastar/football-scores/blob/main/server.js): `server.js`

### External data

- **ESPN scoreboards**

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Sign-in UI: signs in (evidence: `README.md`)
- Dashboard user → Score client: views scores (evidence: `README.md`)
- Sign-in UI → API routes: submits login
- Score client → API routes: requests live scores (evidence: `public/app.js`)
- API routes → Token authentication: checks protected routes (evidence: `server.js`)
- API routes → Schedule cache: gets schedule (evidence: `server.js`)
- Schedule cache → ESPN scoreboards: fetches weeks (evidence: `server.js`)
- API routes → Active-week selection: selects live weeks (evidence: `server.js`)
- Active-week selection → ESPN scoreboards: refreshes weeks (evidence: `server.js`)
- ESPN scoreboards → Game normalization: provides events (evidence: `server.js`)
- Game normalization → API routes: returns normalized games (evidence: `server.js`)
- Score client → Calendar view: renders calendar (evidence: `public/app.js`)
- Score client → Schedule list: renders schedule (evidence: `public/app.js`)
- Score client → Team filter: builds team options (evidence: `public/app.js`)
- Score client → NFL standings: renders standings (evidence: `public/app.js`)
- Score client → Game details: opens game modal (evidence: `public/app.js`)
