# alhaadee/fantasy_league_project architecture

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

- Interactive diagram: https://gitdiagram.com/alhaadee/fantasy_league_project
- Repository: https://github.com/alhaadee/fantasy_league_project

## Overview

Bright Football League is a fantasy-football web app: users create accounts, choose a budget-limited player team, and follow player performance and league scores alongside real fixtures and statistics. The React home container coordinates screen data and REST calls to a Spring Boot API; the README identifies PostgreSQL persistence and Fantasy Premier League data as the data source. Backend implementation details were not sampled, so internal service and repository wiring is not drawn.

Main entry points: [`frontend/fantasy-league/src/containers/HomeContainer.js`](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/containers/HomeContainer.js) (App coordinator), [`frontend/fantasy-league/src/services/auth.service.js`](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/services/auth.service.js) (Auth client), [`frontend/fantasy-league/src/components/Team.js`](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/Team.js) (Fantasy team), [`frontend/fantasy-league/src/components/Login.js`](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/Login.js) (Account screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["React Web App"]
  node_home["App coordinator<br/>[HomeContainer.js]"]
  node_fixtures["Fixtures view<br/>[Fixtures.jsx]"]
  node_stats["Player stats<br/>[Stats.js]"]
  node_team["Fantasy team<br/>[Team.js]"]
  node_search["Player search<br/>[TeamSearch.js]"]
  node_leaderboard["Leaderboard<br/>[LeaderBoard.js]"]
  node_authui["Account screens<br/>[Login.js]"]
  node_authclient["Auth client<br/>[auth.service.js]"]
end

subgraph group_api["Spring API"]
  node_apiapp["REST API"]
  node_datacontroller["Football data routes"]
  node_playercontroller["Player routes"]
  node_usercontroller["User routes"]
end

subgraph group_security["Authentication"]
  node_authcontroller["Auth routes"]
  node_jwt["JWT security"]
end

subgraph group_domain["Fantasy Domain"]
  node_playerdomain["Player services<br/>[PlayerService.java]"]
  node_userdomain["User services<br/>[UserService.java]"]
end

subgraph group_storage["Data Sources"]
  node_players[("Player records")]
  node_users[("User records")]
  node_postgres[("PostgreSQL")]
end

node_fan(("Football fan"))
node_fpl["Fantasy Premier League API"]

node_fan -->|"uses"| node_home
node_home -->|"routes to"| node_fixtures
node_home -->|"routes to"| node_stats
node_home -->|"routes to"| node_team
node_home -->|"routes to"| node_leaderboard
node_home -->|"routes to"| node_authui
node_home -->|"fetches fixtures and data"| node_datacontroller
node_home -->|"fetches and changes players"| node_playercontroller
node_home -->|"fetches and updates users"| node_usercontroller
node_team -->|"offers search"| node_search
node_authui -->|"submits credentials"| node_authclient
node_authclient -->|"posts login"| node_authcontroller
node_authclient -->|"posts signup"| node_usercontroller
node_datacontroller -.->|"sources football data"| node_fpl
node_players -->|"persists"| node_postgres
node_users -->|"persists"| node_postgres

click node_home "https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/containers/HomeContainer.js"
click node_fixtures "https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/Fixtures.jsx"
click node_stats "https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/Stats.js"
click node_team "https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/Team.js"
click node_search "https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/TeamSearch.js"
click node_leaderboard "https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/LeaderBoard.js"
click node_authui "https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/Login.js"
click node_authclient "https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/services/auth.service.js"
click node_apiapp "https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/FantasyLeagueApiApplication.java"
click node_datacontroller "https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/DataController.java"
click node_playercontroller "https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/PlayerController.java"
click node_usercontroller "https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/UserController.java"
click node_authcontroller "https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/AuthController.java"
click node_jwt "https://github.com/alhaadee/fantasy_league_project/tree/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/springSecurityJwt"
click node_playerdomain "https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/services/PlayerService.java"
click node_userdomain "https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/services/UserService.java"
click node_players "https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/repositories/PlayerRepository.java"
click node_users "https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/repositories/UserRepository.java"

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_home,node_fixtures,node_stats,node_team,node_search,node_leaderboard,node_authui,node_authclient toneBlue
class node_apiapp,node_datacontroller,node_playercontroller,node_usercontroller toneAmber
class node_authcontroller,node_jwt,node_fpl toneMint
class node_playerdomain,node_userdomain toneRose
class node_players,node_users,node_postgres,node_fan toneIndigo
```

## Components

### React Web App

- [App coordinator](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/containers/HomeContainer.js): `frontend/fantasy-league/src/containers/HomeContainer.js`
- [Fixtures view](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/Fixtures.jsx): `frontend/fantasy-league/src/components/Fixtures.jsx`
- [Player stats](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/Stats.js): `frontend/fantasy-league/src/components/Stats.js`
- [Fantasy team](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/Team.js): `frontend/fantasy-league/src/components/Team.js`
- [Player search](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/TeamSearch.js): `frontend/fantasy-league/src/components/TeamSearch.js`
- [Leaderboard](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/LeaderBoard.js): `frontend/fantasy-league/src/components/LeaderBoard.js`
- [Account screens](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/components/Login.js): `frontend/fantasy-league/src/components/Login.js`
- [Auth client](https://github.com/alhaadee/fantasy_league_project/blob/main/frontend/fantasy-league/src/services/auth.service.js): `frontend/fantasy-league/src/services/auth.service.js`

### Spring API

- [REST API](https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/FantasyLeagueApiApplication.java): `backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/FantasyLeagueApiApplication.java`
- [Football data routes](https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/DataController.java): `backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/DataController.java`
- [Player routes](https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/PlayerController.java): `backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/PlayerController.java`
- [User routes](https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/UserController.java): `backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/UserController.java`

### Authentication

- [Auth routes](https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/AuthController.java): `backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/controllers/AuthController.java`
- [JWT security](https://github.com/alhaadee/fantasy_league_project/tree/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/springSecurityJwt): `backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/springSecurityJwt`

### Fantasy Domain

- [Player services](https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/services/PlayerService.java): `backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/services/PlayerService.java`
- [User services](https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/services/UserService.java): `backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/services/UserService.java`

### Data Sources

- [Player records](https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/repositories/PlayerRepository.java): `backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/repositories/PlayerRepository.java`
- [User records](https://github.com/alhaadee/fantasy_league_project/blob/main/backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/repositories/UserRepository.java): `backend/fantasy-league-api/src/main/java/com/example/fullstackproject/fantasyleagueapi/repositories/UserRepository.java`
- **PostgreSQL**

### Other components

- **Football fan**
- **Fantasy Premier League API**

## Connections

- Football fan → App coordinator: uses
- App coordinator → Fixtures view: routes to
- App coordinator → Player stats: routes to
- App coordinator → Fantasy team: routes to
- App coordinator → Leaderboard: routes to
- App coordinator → Account screens: routes to
- App coordinator → Football data routes: fetches fixtures and data
- App coordinator → Player routes: fetches and changes players
- App coordinator → User routes: fetches and updates users
- Fantasy team → Player search: offers search
- Account screens → Auth client: submits credentials
- Auth client → Auth routes: posts login
- Auth client → User routes: posts signup
- Football data routes → Fantasy Premier League API: sources football data
- Player records → PostgreSQL: persists
- User records → PostgreSQL: persists
