# melvy13/pickleball-scoretracker architecture

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

- Interactive diagram: https://gitdiagram.com/melvy13/pickleball-scoretracker
- Repository: https://github.com/melvy13/pickleball-scoretracker

## Overview

Pickleball Team Round-Robin Scoretracker is a local-first Angular app for managing a flighted tournament from roster setup through score entry to team and pair rankings. TournamentService initializes state from browser storage or the seed JSON, generates fixtures and matches, and persists edits locally. Separate views handle the schedule, roster and voids, scores, team standings, and seed-level pair rankings. Optional custom seed upload is validated before loading. The README documents these capabilities; unsampled implementation details are represented only where the tree supports a path.

Main entry points: [`src/app/core/tournament.service.ts`](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/core/tournament.service.ts) (Tournament service), [`src/app/app.ts`](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/app.ts) (App shell), [`src/app/core/standings-calculator.ts`](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/core/standings-calculator.ts) (Standings calculator), [`src/app/views/score-entry/score-entry.ts`](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/score-entry/score-entry.ts) (Score entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Tournament screens"]
  node_app["App shell<br/>[app.ts]"]
  node_routes["Page routes<br/>[app.routes.ts]"]
  node_scores["Score entry<br/>[score-entry.ts]"]
  node_roster["Pairs and roster<br/>[pairs.ts]"]
  node_schedule["Fixture schedule<br/>[schedule.ts]"]
  node_teamrank["Team standings<br/>[standings.ts]"]
  node_pairrank["Pair rankings<br/>[pair-rankings.ts]"]
end

subgraph group_state["Tournament state"]
  node_service["Tournament service"]
  node_models["Tournament models"]
end

subgraph group_logic["Domain logic"]
  node_generator["Tournament generator"]
  node_validator["Seed validator"]
  node_calculator["Standings calculator"]
end

subgraph group_storage["Browser data"]
  node_seed["Seed roster<br/>[seed-data.json]"]
  node_browser[("Browser localStorage")]
end

node_organizer(("Organizer"))

node_organizer -->|"uses"| node_app
node_app -->|"navigates"| node_routes
node_app -->|"validates upload"| node_validator
node_app -->|"loads seed"| node_service
node_scores -->|"submits scores"| node_service
node_scores -->|"checks voids"| node_calculator
node_roster -->|"edits roster"| node_service
node_schedule -->|"reorders fixtures"| node_service
node_teamrank -->|"reads state"| node_service
node_teamrank -->|"calculates standings"| node_calculator
node_pairrank -->|"reads state"| node_service
node_pairrank -->|"calculates rankings"| node_calculator
node_service -->|"loads and saves"| node_browser
node_service -->|"fetches roster"| node_seed
node_service -->|"generates fixtures"| node_generator
node_service -->|"stores entities"| node_models
node_validator -->|"validates seed shape"| node_models

click node_app "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/app.ts"
click node_routes "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/app.routes.ts"
click node_scores "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/score-entry/score-entry.ts"
click node_roster "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/pairs/pairs.ts"
click node_schedule "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/schedule/schedule.ts"
click node_teamrank "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/standings/standings.ts"
click node_pairrank "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/pair-rankings/pair-rankings.ts"
click node_service "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/core/tournament.service.ts"
click node_models "https://github.com/melvy13/pickleball-scoretracker/tree/master/src/app/models"
click node_generator "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/core/tournament-generator.ts"
click node_validator "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/core/seed-data-validator.ts"
click node_calculator "https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/core/standings-calculator.ts"
click node_seed "https://github.com/melvy13/pickleball-scoretracker/blob/master/public/seed-data.json"

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,node_routes,node_scores,node_roster,node_schedule,node_teamrank,node_pairrank toneBlue
class node_service,node_models toneAmber
class node_generator,node_validator,node_calculator toneMint
class node_seed,node_browser toneRose
class node_organizer toneIndigo
```

## Components

### Tournament screens

- [App shell](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/app.ts): `src/app/app.ts`
- [Page routes](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/app.routes.ts): `src/app/app.routes.ts`
- [Score entry](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/score-entry/score-entry.ts): `src/app/views/score-entry/score-entry.ts`
- [Pairs and roster](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/pairs/pairs.ts): `src/app/views/pairs/pairs.ts`
- [Fixture schedule](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/schedule/schedule.ts): `src/app/views/schedule/schedule.ts`
- [Team standings](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/standings/standings.ts): `src/app/views/standings/standings.ts`
- [Pair rankings](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/views/pair-rankings/pair-rankings.ts): `src/app/views/pair-rankings/pair-rankings.ts`

### Tournament state

- [Tournament service](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/core/tournament.service.ts): `src/app/core/tournament.service.ts`
- [Tournament models](https://github.com/melvy13/pickleball-scoretracker/tree/master/src/app/models): `src/app/models`

### Domain logic

- [Tournament generator](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/core/tournament-generator.ts): `src/app/core/tournament-generator.ts`
- [Seed validator](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/core/seed-data-validator.ts): `src/app/core/seed-data-validator.ts`
- [Standings calculator](https://github.com/melvy13/pickleball-scoretracker/blob/master/src/app/core/standings-calculator.ts): `src/app/core/standings-calculator.ts`

### Browser data

- [Seed roster](https://github.com/melvy13/pickleball-scoretracker/blob/master/public/seed-data.json): `public/seed-data.json`
- **Browser localStorage**

### Other components

- **Organizer**

## Connections

- Organizer → App shell: uses
- App shell → Page routes: navigates
- App shell → Seed validator: validates upload
- App shell → Tournament service: loads seed
- Score entry → Tournament service: submits scores
- Score entry → Standings calculator: checks voids
- Pairs and roster → Tournament service: edits roster
- Fixture schedule → Tournament service: reorders fixtures
- Team standings → Tournament service: reads state
- Team standings → Standings calculator: calculates standings
- Pair rankings → Tournament service: reads state
- Pair rankings → Standings calculator: calculates rankings
- Tournament service → Browser localStorage: loads and saves
- Tournament service → Seed roster: fetches roster
- Tournament service → Tournament generator: generates fixtures
- Tournament service → Tournament models: stores entities
- Seed validator → Tournament models: validates seed shape
