# nes-di/sport-manager-collab architecture

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

- Interactive diagram: https://gitdiagram.com/nes-di/sport-manager-collab
- Repository: https://github.com/nes-di/sport-manager-collab

## Overview

Sport Manager is a Blazor Server application for managing teams, players, positions, matches, and injuries. Users work through the feature pages to manage records; match simulation calculates results and can create injury records. The README describes SQLite, while the sampled startup configures MySQL, so the configured database provider is uncertain. Page-to-service wiring was not sampled; those links are shown as unverified rather than asserted.

Main entry points: [`TeamManager/Data/SportManagerDbContext.cs`](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Data/SportManagerDbContext.cs) (EF Core context), [`TeamManager/Components/Pages`](https://github.com/nes-di/sport-manager-collab/tree/main/TeamManager/Components/Pages) (Feature pages), [`TeamManager/Controllers`](https://github.com/nes-di/sport-manager-collab/tree/main/TeamManager/Controllers) (MVC endpoints), [`TeamManager/Services/MatchSimulationService.cs`](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/MatchSimulationService.cs) (Match simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web interface"]
  node_pages["Feature pages"]
  node_mvc["MVC endpoints"]
end

subgraph group_management["Team management"]
  node_teams["Team operations<br/>[TeamService.cs]"]
  node_players["Player operations<br/>[PlayerService.cs]"]
  node_positions["Position operations<br/>[PositionService.cs]"]
  node_avatars["Player avatars<br/>[AvatarService.cs]"]
end

subgraph group_competition["Matches and injuries"]
  node_matches["Match operations<br/>[MatchService.cs]"]
  node_simulation["Match simulation"]
  node_injuries["Injury operations<br/>[InjuryService.cs]"]
end

subgraph group_persistence["Data layer"]
  node_entities["Sports records"]
  node_context["EF Core context"]
  node_database[("Configured database")]
  node_seeder["Starter data"]
end

node_user(("Manager"))

node_user -->|"uses"| node_pages
node_user -.->|"uses"| node_mvc
node_pages -.->|"uses"| node_teams
node_pages -.->|"uses"| node_players
node_pages -.->|"uses"| node_positions
node_pages -.->|"uses"| node_avatars
node_pages -.->|"uses"| node_matches
node_pages -.->|"uses"| node_simulation
node_pages -.->|"uses"| node_injuries
node_mvc -->|"calls"| node_players
node_mvc -->|"calls"| node_teams
node_simulation -->|"creates injuries"| node_injuries
node_teams -->|"reads/writes"| node_context
node_players -->|"reads/writes"| node_context
node_positions -->|"reads/writes"| node_context
node_matches -->|"reads/writes"| node_context
node_simulation -->|"reads/writes"| node_context
node_injuries -->|"reads/writes"| node_context
node_context -->|"maps records"| node_entities
node_context -.->|"persists"| node_database
node_seeder -->|"seeds records"| node_context
node_context -->|"creates schema"| node_database
node_seeder -->|"runs at startup"| node_database

click node_pages "https://github.com/nes-di/sport-manager-collab/tree/main/TeamManager/Components/Pages"
click node_mvc "https://github.com/nes-di/sport-manager-collab/tree/main/TeamManager/Controllers"
click node_teams "https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/TeamService.cs"
click node_players "https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/PlayerService.cs"
click node_positions "https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/PositionService.cs"
click node_avatars "https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/AvatarService.cs"
click node_matches "https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/MatchService.cs"
click node_simulation "https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/MatchSimulationService.cs"
click node_injuries "https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/InjuryService.cs"
click node_entities "https://github.com/nes-di/sport-manager-collab/tree/main/TeamManager/Models"
click node_context "https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Data/SportManagerDbContext.cs"
click node_seeder "https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Data/SportManagerSeeder.cs"

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_pages,node_mvc toneBlue
class node_teams,node_players,node_positions,node_avatars toneAmber
class node_matches,node_simulation,node_injuries toneMint
class node_entities,node_context,node_database,node_seeder toneRose
class node_user toneIndigo
```

## Components

### Web interface

- [Feature pages](https://github.com/nes-di/sport-manager-collab/tree/main/TeamManager/Components/Pages): `TeamManager/Components/Pages`
- [MVC endpoints](https://github.com/nes-di/sport-manager-collab/tree/main/TeamManager/Controllers): `TeamManager/Controllers`

### Team management

- [Team operations](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/TeamService.cs): `TeamManager/Services/TeamService.cs`
- [Player operations](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/PlayerService.cs): `TeamManager/Services/PlayerService.cs`
- [Position operations](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/PositionService.cs): `TeamManager/Services/PositionService.cs`
- [Player avatars](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/AvatarService.cs): `TeamManager/Services/AvatarService.cs`

### Matches and injuries

- [Match operations](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/MatchService.cs): `TeamManager/Services/MatchService.cs`
- [Match simulation](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/MatchSimulationService.cs): `TeamManager/Services/MatchSimulationService.cs`
- [Injury operations](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Services/InjuryService.cs): `TeamManager/Services/InjuryService.cs`

### Data layer

- [Sports records](https://github.com/nes-di/sport-manager-collab/tree/main/TeamManager/Models): `TeamManager/Models`
- [EF Core context](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Data/SportManagerDbContext.cs): `TeamManager/Data/SportManagerDbContext.cs`
- **Configured database**
- [Starter data](https://github.com/nes-di/sport-manager-collab/blob/main/TeamManager/Data/SportManagerSeeder.cs): `TeamManager/Data/SportManagerSeeder.cs`

### Other components

- **Manager**

## Connections

- Manager → Feature pages: uses (evidence: `README.md`)
- Manager → MVC endpoints: uses
- Feature pages → Team operations: uses
- Feature pages → Player operations: uses
- Feature pages → Position operations: uses
- Feature pages → Player avatars: uses
- Feature pages → Match operations: uses
- Feature pages → Match simulation: uses
- Feature pages → Injury operations: uses
- MVC endpoints → Player operations: calls (evidence: `TeamManager/Controllers/PlayersController.cs`)
- MVC endpoints → Team operations: calls (evidence: `TeamManager/Controllers/TeamsController.cs`)
- Match simulation → Injury operations: creates injuries (evidence: `TeamManager/Services/MatchSimulationService.cs`)
- Team operations → EF Core context: reads/writes (evidence: `TeamManager/Services/TeamService.cs`)
- Player operations → EF Core context: reads/writes (evidence: `TeamManager/Services/PlayerService.cs`)
- Position operations → EF Core context: reads/writes (evidence: `TeamManager/Services/PositionService.cs`)
- Match operations → EF Core context: reads/writes (evidence: `TeamManager/Services/MatchService.cs`)
- Match simulation → EF Core context: reads/writes (evidence: `TeamManager/Services/MatchSimulationService.cs`)
- Injury operations → EF Core context: reads/writes (evidence: `TeamManager/Services/InjuryService.cs`)
- EF Core context → Sports records: maps records (evidence: `TeamManager/Data/SportManagerDbContext.cs`)
- EF Core context → Configured database: persists
- Starter data → EF Core context: seeds records (evidence: `TeamManager/Data/SportManagerSeeder.cs`)
- EF Core context → Configured database: creates schema
- Starter data → Configured database: runs at startup
