# gabrieljgb/futbol-1 architecture

> Architecture diagram of the GitHub repository gabrieljgb/futbol-1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gabrieljgb/futbol-1
- Repository: https://github.com/gabrieljgb/futbol-1

## Overview

Fútbol 1 is a Preact football-results PWA. Its main workflow routes users to a date-based match listing, then to match, league, team, or player detail views; it also offers news and video content. Data hooks fetch and expose results to those views, while Signals hold shared UI selections and preferences. The README documents fixture, table, bracket, history, match-event, lineup, statistics, player, team, and multimedia capabilities. Some feature implementations are unsampled, so their relationships are included only where the source index or README supports them.

Main entry points: [`src/index.jsx`](https://github.com/gabrieljgb/futbol-1/blob/main/src/index.jsx) (Routed application), [`src/pages/League/index.jsx`](https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/League/index.jsx) (League detail page), [`src/pages/Player/index.jsx`](https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Player/index.jsx) (Player profile page), [`src/utils/fetcher.js`](https://github.com/gabrieljgb/futbol-1/blob/main/src/utils/fetcher.js) (HTTP fetchers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Routed application<br/>[index.jsx]"]
end

subgraph group_scores["Scores and matches"]
  node_home["Date-based home<br/>[index.jsx]"]
  node_gamepage["Match detail page<br/>[index.jsx]"]
  node_matchview["Match events and field<br/>[Field_2.jsx]"]
end

subgraph group_leagues["League coverage"]
  node_leaguepage["League detail page<br/>[index.jsx]"]
  node_leagueviews["League competitions<br/>[Brackets.jsx]"]
  node_leaguehistory["League history<br/>[History.jsx]"]
  node_leaguestats["Team statistics<br/>[TeamsStats.jsx]"]
end

subgraph group_profiles["Team and player profiles"]
  node_team["Team profile"]
  node_playerpage["Player profile page<br/>[index.jsx]"]
  node_playergames["Player match history<br/>[LastGames.jsx]"]
  node_playerstats["Player performance<br/>[Stats.jsx]"]
  node_playertrophies["Player honours<br/>[Trophies.jsx]"]
end

subgraph group_content["News and media"]
  node_articles["Article view<br/>[index.jsx]"]
  node_videos["Video view<br/>[index.jsx]"]
  node_news["Home news<br/>[HomeNews.jsx]"]
end

subgraph group_data["Data and state"]
  node_gamedata["Match data hook<br/>[useGame.js]"]
  node_leaguehooks["League data hooks<br/>[useLeague.js]"]
  node_playerhooks["Player data hooks<br/>[usePlayer.js]"]
  node_fetcher["HTTP fetchers<br/>[fetcher.js]"]
  node_signals["Reactive UI state<br/>[home.js]"]
  node_league_signals["League selections<br/>[league.js]"]
  node_storage[("Browser preferences<br/>[storage.js]")]
end

node_visitor(("Football fan"))
node_scores_api["Promiedos API"]
node_player_api["365Scores API"]

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_gamepage
node_app -->|"routes to"| node_leaguepage
node_app -->|"routes to"| node_playerpage
node_app -->|"routes to"| node_team
node_app -->|"routes to"| node_articles
node_app -->|"routes to"| node_videos
node_home -->|"loads matches"| node_gamedata
node_home -->|"renders news"| node_news
node_home -->|"reads state"| node_signals
node_gamepage -.->|"loads match"| node_gamedata
node_gamepage -.->|"shows field"| node_matchview
node_gamedata -->|"fetches through"| node_fetcher
node_leaguepage -->|"loads league"| node_leaguehooks
node_leaguepage -->|"renders bracket"| node_leagueviews
node_leaguepage -->|"renders history"| node_leaguehistory
node_leaguepage -->|"renders stats"| node_leaguestats
node_leaguepage -->|"reads selection"| node_league_signals
node_leaguehooks -->|"fetches through"| node_fetcher
node_leaguehooks -->|"requests league data"| node_scores_api
node_playerpage -->|"loads player"| node_playerhooks
node_playerpage -->|"renders history"| node_playergames
node_playerpage -->|"renders stats"| node_playerstats
node_playerpage -->|"renders honours"| node_playertrophies
node_playerhooks -->|"fetches through"| node_fetcher
node_playerhooks -->|"requests player data"| node_player_api
node_playergames -->|"loads games"| node_playerhooks
node_articles -->|"loads article"| node_fetcher
node_app -->|"loads preference"| node_storage
node_fetcher -.->|"requests data"| node_scores_api

click node_app "https://github.com/gabrieljgb/futbol-1/blob/main/src/index.jsx"
click node_home "https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Home/index.jsx"
click node_gamepage "https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Game/index.jsx"
click node_matchview "https://github.com/gabrieljgb/futbol-1/blob/main/src/components/game/Field_2.jsx"
click node_gamedata "https://github.com/gabrieljgb/futbol-1/blob/main/src/hooks/useGame.js"
click node_leaguepage "https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/League/index.jsx"
click node_leagueviews "https://github.com/gabrieljgb/futbol-1/blob/main/src/components/league/tabs/Brackets.jsx"
click node_leaguehistory "https://github.com/gabrieljgb/futbol-1/blob/main/src/components/league/tabs/History.jsx"
click node_leaguestats "https://github.com/gabrieljgb/futbol-1/blob/main/src/components/league/tabs/TeamsStats.jsx"
click node_leaguehooks "https://github.com/gabrieljgb/futbol-1/blob/main/src/hooks/useLeague.js"
click node_team "https://github.com/gabrieljgb/futbol-1/tree/main/src/components/team"
click node_playerpage "https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Player/index.jsx"
click node_playergames "https://github.com/gabrieljgb/futbol-1/blob/main/src/components/player/LastGames.jsx"
click node_playerstats "https://github.com/gabrieljgb/futbol-1/blob/main/src/components/player/Stats.jsx"
click node_playertrophies "https://github.com/gabrieljgb/futbol-1/blob/main/src/components/player/Trophies.jsx"
click node_playerhooks "https://github.com/gabrieljgb/futbol-1/blob/main/src/hooks/usePlayer.js"
click node_articles "https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Article/index.jsx"
click node_videos "https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Video/index.jsx"
click node_news "https://github.com/gabrieljgb/futbol-1/blob/main/src/components/common/HomeNews.jsx"
click node_fetcher "https://github.com/gabrieljgb/futbol-1/blob/main/src/utils/fetcher.js"
click node_signals "https://github.com/gabrieljgb/futbol-1/blob/main/src/signals/home.js"
click node_league_signals "https://github.com/gabrieljgb/futbol-1/blob/main/src/signals/league.js"
click node_storage "https://github.com/gabrieljgb/futbol-1/blob/main/src/utils/storage.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_app toneBlue
class node_home,node_gamepage,node_matchview toneAmber
class node_leaguepage,node_leagueviews,node_leaguehistory,node_leaguestats,node_scores_api,node_player_api toneMint
class node_team,node_playerpage,node_playergames,node_playerstats,node_playertrophies toneRose
class node_articles,node_videos,node_news,node_visitor toneIndigo
class node_gamedata,node_leaguehooks,node_playerhooks,node_fetcher,node_signals,node_league_signals,node_storage toneTeal
```

## Components

### Application shell

- [Routed application](https://github.com/gabrieljgb/futbol-1/blob/main/src/index.jsx): `src/index.jsx`

### Scores and matches

- [Date-based home](https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Home/index.jsx): `src/pages/Home/index.jsx`
- [Match detail page](https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Game/index.jsx): `src/pages/Game/index.jsx`
- [Match events and field](https://github.com/gabrieljgb/futbol-1/blob/main/src/components/game/Field_2.jsx): `src/components/game/Field_2.jsx`

### League coverage

- [League detail page](https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/League/index.jsx): `src/pages/League/index.jsx`
- [League competitions](https://github.com/gabrieljgb/futbol-1/blob/main/src/components/league/tabs/Brackets.jsx): `src/components/league/tabs/Brackets.jsx`
- [League history](https://github.com/gabrieljgb/futbol-1/blob/main/src/components/league/tabs/History.jsx): `src/components/league/tabs/History.jsx`
- [Team statistics](https://github.com/gabrieljgb/futbol-1/blob/main/src/components/league/tabs/TeamsStats.jsx): `src/components/league/tabs/TeamsStats.jsx`

### Team and player profiles

- [Team profile](https://github.com/gabrieljgb/futbol-1/tree/main/src/components/team): `src/components/team`
- [Player profile page](https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Player/index.jsx): `src/pages/Player/index.jsx`
- [Player match history](https://github.com/gabrieljgb/futbol-1/blob/main/src/components/player/LastGames.jsx): `src/components/player/LastGames.jsx`
- [Player performance](https://github.com/gabrieljgb/futbol-1/blob/main/src/components/player/Stats.jsx): `src/components/player/Stats.jsx`
- [Player honours](https://github.com/gabrieljgb/futbol-1/blob/main/src/components/player/Trophies.jsx): `src/components/player/Trophies.jsx`

### News and media

- [Article view](https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Article/index.jsx): `src/pages/Article/index.jsx`
- [Video view](https://github.com/gabrieljgb/futbol-1/blob/main/src/pages/Video/index.jsx): `src/pages/Video/index.jsx`
- [Home news](https://github.com/gabrieljgb/futbol-1/blob/main/src/components/common/HomeNews.jsx): `src/components/common/HomeNews.jsx`

### Data and state

- [Match data hook](https://github.com/gabrieljgb/futbol-1/blob/main/src/hooks/useGame.js): `src/hooks/useGame.js`
- [League data hooks](https://github.com/gabrieljgb/futbol-1/blob/main/src/hooks/useLeague.js): `src/hooks/useLeague.js`
- [Player data hooks](https://github.com/gabrieljgb/futbol-1/blob/main/src/hooks/usePlayer.js): `src/hooks/usePlayer.js`
- [HTTP fetchers](https://github.com/gabrieljgb/futbol-1/blob/main/src/utils/fetcher.js): `src/utils/fetcher.js`
- [Reactive UI state](https://github.com/gabrieljgb/futbol-1/blob/main/src/signals/home.js): `src/signals/home.js`
- [League selections](https://github.com/gabrieljgb/futbol-1/blob/main/src/signals/league.js): `src/signals/league.js`
- [Browser preferences](https://github.com/gabrieljgb/futbol-1/blob/main/src/utils/storage.js): `src/utils/storage.js`

### Other components

- **Football fan**
- **Promiedos API**
- **365Scores API**

## Connections

- Football fan → Routed application: opens (evidence: `src/index.jsx`)
- Routed application → Date-based home: routes to (evidence: `src/index.jsx`)
- Routed application → Match detail page: routes to (evidence: `src/index.jsx`)
- Routed application → League detail page: routes to (evidence: `src/index.jsx`)
- Routed application → Player profile page: routes to (evidence: `src/index.jsx`)
- Routed application → Team profile: routes to (evidence: `src/index.jsx`)
- Routed application → Article view: routes to (evidence: `src/index.jsx`)
- Routed application → Video view: routes to (evidence: `src/index.jsx`)
- Date-based home → Match data hook: loads matches (evidence: `src/pages/Home/index.jsx`)
- Date-based home → Home news: renders news (evidence: `src/pages/Home/index.jsx`)
- Date-based home → Reactive UI state: reads state (evidence: `src/pages/Home/index.jsx`)
- Match detail page → Match data hook: loads match
- Match detail page → Match events and field: shows field
- Match data hook → HTTP fetchers: fetches through (evidence: `src/hooks/useGame.js`)
- League detail page → League data hooks: loads league (evidence: `src/pages/League/index.jsx`)
- League detail page → League competitions: renders bracket (evidence: `src/pages/League/index.jsx`)
- League detail page → League history: renders history (evidence: `src/pages/League/index.jsx`)
- League detail page → Team statistics: renders stats (evidence: `src/pages/League/index.jsx`)
- League detail page → League selections: reads selection (evidence: `src/pages/League/index.jsx`)
- League data hooks → HTTP fetchers: fetches through (evidence: `src/hooks/useLeague.js`)
- League data hooks → Promiedos API: requests league data (evidence: `src/hooks/useLeague.js`)
- Player profile page → Player data hooks: loads player (evidence: `src/pages/Player/index.jsx`)
- Player profile page → Player match history: renders history (evidence: `src/pages/Player/index.jsx`)
- Player profile page → Player performance: renders stats (evidence: `src/pages/Player/index.jsx`)
- Player profile page → Player honours: renders honours (evidence: `src/pages/Player/index.jsx`)
- Player data hooks → HTTP fetchers: fetches through (evidence: `src/hooks/usePlayer.js`)
- Player data hooks → 365Scores API: requests player data (evidence: `src/hooks/usePlayer.js`)
- Player match history → Player data hooks: loads games (evidence: `src/components/player/LastGames.jsx`)
- Article view → HTTP fetchers: loads article (evidence: `src/pages/Article/index.jsx`)
- Routed application → Browser preferences: loads preference (evidence: `src/index.jsx`)
- HTTP fetchers → Promiedos API: requests data
