# agrism/biathlon architecture

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

- Interactive diagram: https://gitdiagram.com/agrism/biathlon
- Repository: https://github.com/agrism/biathlon

## Overview

Biathlon is a Laravel application combining IBU race-data synchronization, athlete and competition browsing, and a six-place prediction league. The user-facing flow is browsing race stages and results, selecting athletes for a forecast, then reviewing scored forecasts and season standings. The graph also preserves the documented sync, favorites, authentication, and biathlon-news capabilities. Several links are README-supported because their command/controller implementations were not sampled; paths for those subsystems use exact existing directories.

Main entry points: [`app/Models/Athlete.php`](https://github.com/agrism/biathlon/blob/main/app/Models/Athlete.php) (Athlete profiles), [`app/Console/Commands`](https://github.com/agrism/biathlon/tree/main/app/Console/Commands) (Race sync commands), [`app/Http/Controllers/Forecasts/SelectAthleteController.php`](https://github.com/agrism/biathlon/blob/main/app/Http/Controllers/Forecasts/SelectAthleteController.php) (Forecast interaction), [`app/Http/Controllers/Competitions/ShowController.php`](https://github.com/agrism/biathlon/blob/main/app/Http/Controllers/Competitions/ShowController.php) (Race browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_race["Race data"]
  node_sync["Race sync commands"]
  node_race_models[("Race records")]
  node_athlete_models[("Athlete profiles<br/>[Athlete.php]")]
  node_result_models[("Race results")]
end

subgraph group_league["Prediction league"]
  node_forecast_pages["Forecast interaction"]
  node_forecast_records[("Forecast records<br/>[Forecast.php]")]
  node_forecast_scoring["Scoring engines"]
  node_leaderboards["Season standings"]
end

subgraph group_web["Web experience"]
  node_race_pages["Race browsing<br/>[ShowController.php]"]
  node_athlete_pages["Athlete browsing"]
  node_favorites["Athlete favorites<br/>[FavoriteHelper.php]"]
  node_web_views["Server-rendered UI"]
end

subgraph group_news["News and integrations"]
  node_tweet_service["Biathlon news service"]
  node_tweet_records[("Tweet feed records<br/>[Tweet.php]")]
  node_tweet_pages["News feed pages"]
end

subgraph group_identity["Identity"]
  node_auth["Authentication and profiles"]
  node_users[("User accounts<br/>[User.php]")]
end

node_user(("Biathlon user"))
node_ibu["IBU Sport API"]
node_tweet_sources["News providers"]

node_ibu -.->|"supplies data"| node_sync
node_sync -.->|"synchronizes"| node_race_models
node_sync -.->|"updates profiles"| node_athlete_models
node_sync -.->|"imports results"| node_result_models
node_race_pages -->|"queries races"| node_race_models
node_race_pages -->|"queries results"| node_result_models
node_result_models -->|"belongs to"| node_athlete_models
node_user -->|"browses races"| node_race_pages
node_user -->|"browses athletes"| node_athlete_pages
node_athlete_pages -->|"queries profiles"| node_athlete_models
node_user -->|"selects predictions"| node_forecast_pages
node_forecast_pages -->|"loads forecast"| node_forecast_records
node_forecast_pages -->|"lists candidates"| node_athlete_models
node_forecast_records -->|"belongs to race"| node_race_models
node_forecast_scoring -->|"scores forecasts"| node_forecast_records
node_user -.->|"reviews standings"| node_leaderboards
node_leaderboards -.->|"summarizes results"| node_forecast_records
node_user -->|"bookmarks athletes"| node_favorites
node_favorites -->|"marks favorites"| node_athlete_models
node_race_pages -.->|"renders results"| node_web_views
node_athlete_pages -.->|"renders listings"| node_web_views
node_forecast_pages -.->|"renders selection"| node_web_views
node_tweet_sources -->|"provides posts"| node_tweet_service
node_tweet_service -->|"syncs and reads"| node_tweet_records
node_tweet_pages -->|"requests feed"| node_tweet_service
node_user -.->|"reads news"| node_tweet_pages
node_auth -.->|"manages accounts"| node_users
node_user -.->|"signs in"| node_auth

click node_sync "https://github.com/agrism/biathlon/tree/main/app/Console/Commands"
click node_race_models "https://github.com/agrism/biathlon/blob/main/app/Models/EventCompetition.php"
click node_athlete_models "https://github.com/agrism/biathlon/blob/main/app/Models/Athlete.php"
click node_result_models "https://github.com/agrism/biathlon/blob/main/app/Models/EventCompetitionResult.php"
click node_race_pages "https://github.com/agrism/biathlon/blob/main/app/Http/Controllers/Competitions/ShowController.php"
click node_athlete_pages "https://github.com/agrism/biathlon/blob/main/app/Http/Controllers/Athletes/IndexController.php"
click node_forecast_pages "https://github.com/agrism/biathlon/blob/main/app/Http/Controllers/Forecasts/SelectAthleteController.php"
click node_forecast_records "https://github.com/agrism/biathlon/blob/main/app/Models/Forecast.php"
click node_forecast_scoring "https://github.com/agrism/biathlon/tree/main/app/Helpers/Forecasts"
click node_leaderboards "https://github.com/agrism/biathlon/tree/main/app/Http/Controllers/Forecasts/Summary"
click node_favorites "https://github.com/agrism/biathlon/blob/main/app/Helpers/FavoriteHelper.php"
click node_web_views "https://github.com/agrism/biathlon/tree/main/resources/views"
click node_tweet_service "https://github.com/agrism/biathlon/blob/main/app/Services/BiathlonTweetService.php"
click node_tweet_records "https://github.com/agrism/biathlon/blob/main/app/Models/Tweet.php"
click node_tweet_pages "https://github.com/agrism/biathlon/tree/main/app/Http/Controllers/Twitter"
click node_auth "https://github.com/agrism/biathlon/blob/main/app/Providers/FortifyServiceProvider.php"
click node_users "https://github.com/agrism/biathlon/blob/main/app/Models/User.php"

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_race_models,node_athlete_models,node_result_models,node_user toneBlue
class node_forecast_pages,node_forecast_records,node_forecast_scoring,node_leaderboards toneAmber
class node_race_pages,node_athlete_pages,node_favorites,node_web_views,node_ibu toneMint
class node_tweet_service,node_tweet_records,node_tweet_pages toneRose
class node_auth,node_users,node_tweet_sources toneIndigo
```

## Components

### Race data

- [Race sync commands](https://github.com/agrism/biathlon/tree/main/app/Console/Commands): `app/Console/Commands`
- [Race records](https://github.com/agrism/biathlon/blob/main/app/Models/EventCompetition.php): `app/Models/EventCompetition.php`
- [Athlete profiles](https://github.com/agrism/biathlon/blob/main/app/Models/Athlete.php): `app/Models/Athlete.php`
- [Race results](https://github.com/agrism/biathlon/blob/main/app/Models/EventCompetitionResult.php): `app/Models/EventCompetitionResult.php`

### Prediction league

- [Forecast interaction](https://github.com/agrism/biathlon/blob/main/app/Http/Controllers/Forecasts/SelectAthleteController.php): `app/Http/Controllers/Forecasts/SelectAthleteController.php`
- [Forecast records](https://github.com/agrism/biathlon/blob/main/app/Models/Forecast.php): `app/Models/Forecast.php`
- [Scoring engines](https://github.com/agrism/biathlon/tree/main/app/Helpers/Forecasts): `app/Helpers/Forecasts`
- [Season standings](https://github.com/agrism/biathlon/tree/main/app/Http/Controllers/Forecasts/Summary): `app/Http/Controllers/Forecasts/Summary`

### Web experience

- [Race browsing](https://github.com/agrism/biathlon/blob/main/app/Http/Controllers/Competitions/ShowController.php): `app/Http/Controllers/Competitions/ShowController.php`
- [Athlete browsing](https://github.com/agrism/biathlon/blob/main/app/Http/Controllers/Athletes/IndexController.php): `app/Http/Controllers/Athletes/IndexController.php`
- [Athlete favorites](https://github.com/agrism/biathlon/blob/main/app/Helpers/FavoriteHelper.php): `app/Helpers/FavoriteHelper.php`
- [Server-rendered UI](https://github.com/agrism/biathlon/tree/main/resources/views): `resources/views`

### News and integrations

- [Biathlon news service](https://github.com/agrism/biathlon/blob/main/app/Services/BiathlonTweetService.php): `app/Services/BiathlonTweetService.php`
- [Tweet feed records](https://github.com/agrism/biathlon/blob/main/app/Models/Tweet.php): `app/Models/Tweet.php`
- [News feed pages](https://github.com/agrism/biathlon/tree/main/app/Http/Controllers/Twitter): `app/Http/Controllers/Twitter`

### Identity

- [Authentication and profiles](https://github.com/agrism/biathlon/blob/main/app/Providers/FortifyServiceProvider.php): `app/Providers/FortifyServiceProvider.php`
- [User accounts](https://github.com/agrism/biathlon/blob/main/app/Models/User.php): `app/Models/User.php`

### Other components

- **Biathlon user**
- **IBU Sport API**
- **News providers**

## Connections

- IBU Sport API → Race sync commands: supplies data (evidence: `README.md`)
- Race sync commands → Race records: synchronizes (evidence: `README.md`)
- Race sync commands → Athlete profiles: updates profiles (evidence: `README.md`)
- Race sync commands → Race results: imports results (evidence: `README.md`)
- Race browsing → Race records: queries races (evidence: `app/Http/Controllers/Competitions/ShowController.php`)
- Race browsing → Race results: queries results (evidence: `app/Http/Controllers/Competitions/ShowController.php`)
- Race results → Athlete profiles: belongs to (evidence: `app/Models/Athlete.php`)
- Biathlon user → Race browsing: browses races (evidence: `README.md`)
- Biathlon user → Athlete browsing: browses athletes (evidence: `app/Http/Controllers/Athletes/IndexController.php`)
- Athlete browsing → Athlete profiles: queries profiles (evidence: `app/Http/Controllers/Athletes/IndexController.php`)
- Biathlon user → Forecast interaction: selects predictions (evidence: `README.md`)
- Forecast interaction → Forecast records: loads forecast (evidence: `app/Http/Controllers/Forecasts/SelectAthleteController.php`)
- Forecast interaction → Athlete profiles: lists candidates (evidence: `app/Http/Controllers/Forecasts/SelectAthleteController.php`)
- Forecast records → Race records: belongs to race (evidence: `app/Models/Forecast.php`)
- Scoring engines → Forecast records: scores forecasts (evidence: `app/Helpers/Forecasts/ForecastDainisServiceHelper.php`)
- Biathlon user → Season standings: reviews standings (evidence: `README.md`)
- Season standings → Forecast records: summarizes results (evidence: `README.md`)
- Biathlon user → Athlete favorites: bookmarks athletes
- Athlete favorites → Athlete profiles: marks favorites (evidence: `app/Helpers/FavoriteHelper.php`)
- Race browsing → Server-rendered UI: renders results (evidence: `README.md`)
- Athlete browsing → Server-rendered UI: renders listings (evidence: `README.md`)
- Forecast interaction → Server-rendered UI: renders selection (evidence: `README.md`)
- News providers → Biathlon news service: provides posts (evidence: `app/Services/BiathlonTweetService.php`)
- Biathlon news service → Tweet feed records: syncs and reads (evidence: `app/Services/BiathlonTweetService.php`)
- News feed pages → Biathlon news service: requests feed (evidence: `app/Http/Controllers/Twitter/SetAthleteController.php`)
- Biathlon user → News feed pages: reads news (evidence: `README.md`)
- Authentication and profiles → User accounts: manages accounts (evidence: `app/Providers/FortifyServiceProvider.php`)
- Biathlon user → Authentication and profiles: signs in (evidence: `README.md`)
