# computa-gr-bd/scout architecture

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

- Interactive diagram: https://gitdiagram.com/computa-gr-bd/scout
- Repository: https://github.com/computa-gr-bd/scout

## Overview

ScoutVision is a football scouting and analysis platform: provider data is collected and stored, exposed through a FastAPI backend, then explored through a React interface. Users browse matches, teams and players, and use reports, comparisons, and tactical visualizations. The graph preserves the documented ingestion-to-interface flow and major analysis capabilities. Source excerpts and the README support the shown relationships; several domain modules are indexed but unsampled, so their internal calls are not inferred.

Main entry points: [`backend/app/api`](https://github.com/computa-gr-bd/scout/tree/main/backend/app/api) (Domain API routes), [`frontend/src/pages`](https://github.com/computa-gr-bd/scout/tree/main/frontend/src/pages) (Scouting pages), [`backend/app/db/models.py`](https://github.com/computa-gr-bd/scout/blob/main/backend/app/db/models.py) (Football data store), [`backend/app/services`](https://github.com/computa-gr-bd/scout/tree/main/backend/app/services) (Provider collectors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection and data"]
  node_sync["Provider collectors"]
  node_understat_sync["Understat sync<br/>[understat_sync.py]"]
  node_database[("Football data store<br/>[models.py]")]
end

subgraph group_backend["Backend and analysis"]
  node_server["API application<br/>[main.py]"]
  node_routes["Domain API routes"]
  node_repositories["Data repositories<br/>[repositories.py]"]
  node_scope["Season scope<br/>[scope.py]"]
  node_lineups["Lineups<br/>[lineups.py]"]
  node_standings["Standings<br/>[standings.py]"]
  node_studio["Match Studio data<br/>[studio.py]"]
  node_player_profile["Player profiles<br/>[player_profile.py]"]
  node_position_index["Scouting indices<br/>[position_index.py]"]
  node_predictions["Match reports<br/>[predictions.py]"]
  node_crests["Crest resolution<br/>[crests.py]"]
end

subgraph group_frontend["Web experience"]
  node_web_app["Web navigation<br/>[App.tsx]"]
  node_api_client["Typed API client<br/>[client.ts]"]
  node_pages["Scouting pages"]
  node_pitch_studio["Tactical Studio<br/>[PitchStudio.tsx]"]
  node_ui["Shared UI<br/>[ui.tsx]"]
end

node_user(("Scouting user"))
node_providers["Football data providers"]

node_providers -->|"supply data"| node_sync
node_sync -->|"persist records"| node_database
node_providers -->|"supply match events"| node_understat_sync
node_understat_sync -->|"write events"| node_database
node_database -->|"query records"| node_repositories
node_server -->|"register routes"| node_routes
node_routes -->|"read domain data"| node_repositories
node_routes -->|"apply season scope"| node_scope
node_routes -->|"retrieve standings"| node_standings
node_routes -->|"resolve crests"| node_crests
node_routes -->|"build match data"| node_studio
node_routes -->|"retrieve lineups"| node_lineups
node_routes -->|"build reports"| node_predictions
node_routes -->|"build profiles"| node_player_profile
node_routes -->|"calculate indices"| node_position_index
node_user -->|"browse"| node_web_app
node_web_app -->|"route to pages"| node_pages
node_pages -->|"request data"| node_api_client
node_api_client -->|"call API"| node_server
node_pages -->|"render match analysis"| node_pitch_studio
node_pitch_studio -->|"render controls"| node_ui

click node_sync "https://github.com/computa-gr-bd/scout/tree/main/backend/app/services"
click node_understat_sync "https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/understat_sync.py"
click node_database "https://github.com/computa-gr-bd/scout/blob/main/backend/app/db/models.py"
click node_server "https://github.com/computa-gr-bd/scout/blob/main/backend/app/main.py"
click node_routes "https://github.com/computa-gr-bd/scout/tree/main/backend/app/api"
click node_repositories "https://github.com/computa-gr-bd/scout/blob/main/backend/app/repositories/repositories.py"
click node_scope "https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/scope.py"
click node_lineups "https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/lineups.py"
click node_standings "https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/standings.py"
click node_studio "https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/studio.py"
click node_player_profile "https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/player_profile.py"
click node_position_index "https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/position_index.py"
click node_predictions "https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/predictions.py"
click node_crests "https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/crests.py"
click node_web_app "https://github.com/computa-gr-bd/scout/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/computa-gr-bd/scout/blob/main/frontend/src/api/client.ts"
click node_pages "https://github.com/computa-gr-bd/scout/tree/main/frontend/src/pages"
click node_pitch_studio "https://github.com/computa-gr-bd/scout/blob/main/frontend/src/components/PitchStudio.tsx"
click node_ui "https://github.com/computa-gr-bd/scout/blob/main/frontend/src/components/ui.tsx"

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_sync,node_understat_sync,node_database,node_user toneBlue
class node_server,node_routes,node_repositories,node_scope,node_lineups,node_standings,node_studio,node_player_profile,node_position_index,node_predictions,node_crests toneAmber
class node_web_app,node_api_client,node_pages,node_pitch_studio,node_ui toneMint
class node_providers toneIndigo
```

## Components

### Collection and data

- [Provider collectors](https://github.com/computa-gr-bd/scout/tree/main/backend/app/services): `backend/app/services`
- [Understat sync](https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/understat_sync.py): `backend/app/services/understat_sync.py`
- [Football data store](https://github.com/computa-gr-bd/scout/blob/main/backend/app/db/models.py): `backend/app/db/models.py`

### Backend and analysis

- [API application](https://github.com/computa-gr-bd/scout/blob/main/backend/app/main.py): `backend/app/main.py`
- [Domain API routes](https://github.com/computa-gr-bd/scout/tree/main/backend/app/api): `backend/app/api`
- [Data repositories](https://github.com/computa-gr-bd/scout/blob/main/backend/app/repositories/repositories.py): `backend/app/repositories/repositories.py`
- [Season scope](https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/scope.py): `backend/app/services/scope.py`
- [Lineups](https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/lineups.py): `backend/app/services/lineups.py`
- [Standings](https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/standings.py): `backend/app/services/standings.py`
- [Match Studio data](https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/studio.py): `backend/app/services/studio.py`
- [Player profiles](https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/player_profile.py): `backend/app/services/player_profile.py`
- [Scouting indices](https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/position_index.py): `backend/app/services/position_index.py`
- [Match reports](https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/predictions.py): `backend/app/services/predictions.py`
- [Crest resolution](https://github.com/computa-gr-bd/scout/blob/main/backend/app/services/crests.py): `backend/app/services/crests.py`

### Web experience

- [Web navigation](https://github.com/computa-gr-bd/scout/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Typed API client](https://github.com/computa-gr-bd/scout/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Scouting pages](https://github.com/computa-gr-bd/scout/tree/main/frontend/src/pages): `frontend/src/pages`
- [Tactical Studio](https://github.com/computa-gr-bd/scout/blob/main/frontend/src/components/PitchStudio.tsx): `frontend/src/components/PitchStudio.tsx`
- [Shared UI](https://github.com/computa-gr-bd/scout/blob/main/frontend/src/components/ui.tsx): `frontend/src/components/ui.tsx`

### Other components

- **Scouting user**
- **Football data providers**

## Connections

- Football data providers → Provider collectors: supply data
- Provider collectors → Football data store: persist records (evidence: `backend/app/services/index_service.py`)
- Football data providers → Understat sync: supply match events
- Understat sync → Football data store: write events (evidence: `backend/app/services/understat_sync.py`)
- Football data store → Data repositories: query records (evidence: `backend/app/repositories/repositories.py`)
- API application → Domain API routes: register routes (evidence: `backend/app/main.py`)
- Domain API routes → Data repositories: read domain data (evidence: `backend/app/api/competitions.py`)
- Domain API routes → Season scope: apply season scope (evidence: `backend/app/api/competitions.py`)
- Domain API routes → Standings: retrieve standings (evidence: `backend/app/api/competitions.py`)
- Domain API routes → Crest resolution: resolve crests (evidence: `backend/app/api/competitions.py`)
- Domain API routes → Match Studio data: build match data (evidence: `backend/app/api/matches.py`)
- Domain API routes → Lineups: retrieve lineups (evidence: `backend/app/api/matches.py`)
- Domain API routes → Match reports: build reports (evidence: `backend/app/api/matches.py`)
- Domain API routes → Player profiles: build profiles (evidence: `backend/app/api/players.py`)
- Domain API routes → Scouting indices: calculate indices (evidence: `backend/app/api/players.py`)
- Scouting user → Web navigation: browse
- Web navigation → Scouting pages: route to pages (evidence: `frontend/src/App.tsx`)
- Scouting pages → Typed API client: request data (evidence: `frontend/src/pages/Analysis.tsx`)
- Typed API client → API application: call API
- Scouting pages → Tactical Studio: render match analysis (evidence: `frontend/src/pages/Analysis.tsx`)
- Tactical Studio → Shared UI: render controls (evidence: `frontend/src/components/PitchStudio.tsx`)
