# vbcompetitions/competitions-php architecture

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

- Interactive diagram: https://gitdiagram.com/vbcompetitions/competitions-php
- Repository: https://github.com/vbcompetitions/competitions-php

## Overview

VBCompetitions/competitions-php is a PHP library for loading, validating, editing, and serializing volleyball competition data, with HTML and iCalendar representations. The main workflow is competition JSON into a competition model, organized as stages, groups, and matches; match results support league standings and knockout progression, then callers can save the model or generate views. The graph also preserves roster/contact and match-official concepts. Source excerpts are partial, so links between unsampled capabilities and their implementations are limited to relationships supported by the README or sampled code.

Main entry points: [`src/Competition.php`](https://github.com/vbcompetitions/competitions-php/blob/main/src/Competition.php) (Competition), [`src/GroupMatch.php`](https://github.com/vbcompetitions/competitions-php/blob/main/src/GroupMatch.php) (Match and scores), [`src/League.php`](https://github.com/vbcompetitions/competitions-php/blob/main/src/League.php) (League standings), [`src/Group.php`](https://github.com/vbcompetitions/competitions-php/blob/main/src/Group.php) (Group)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Competition model"]
  node_competition["Competition<br/>[Competition.php]"]
  node_stage["Stage<br/>[Stage.php]"]
  node_group["Group<br/>[Group.php]"]
  node_match["Match and scores<br/>[GroupMatch.php]"]
end

subgraph group_formats["Import and export"]
  node_schema["JSON schema<br/>[competition.json]"]
  node_html["HTML representation<br/>[HTML.php]"]
  node_ics["Calendar representation<br/>[ICS.php]"]
end

subgraph group_results["Results and formats"]
  node_league["League standings<br/>[League.php]"]
  node_knockout["Knockout format<br/>[Knockout.php]"]
  node_crossover["Crossover format<br/>[Crossover.php]"]
  node_unknown["Unknown teams<br/>[IfUnknown.php]"]
end

subgraph group_people["Teams and people"]
  node_teams["Competition teams"]
  node_players["Players<br/>[Player.php]"]
  node_clubs["Clubs<br/>[Club.php]"]
  node_contacts["Contacts<br/>[Contact.php]"]
  node_officials["Match officials<br/>[MatchOfficials.php]"]
  node_manager["Match manager<br/>[MatchManager.php]"]
end

node_caller(("Library caller"))
node_json["Competition JSON"]
node_output["Serialized or rendered data"]

node_caller -->|"loads or edits"| node_competition
node_json -->|"loads data"| node_competition
node_competition -->|"validates against"| node_schema
node_competition -->|"organizes stages"| node_stage
node_stage -->|"organizes groups"| node_group
node_group -->|"contains matches"| node_match
node_group -->|"validates team IDs"| node_competition
node_league -->|"processes results"| node_match
node_league -->|"reads team names"| node_teams
node_caller -->|"requests standings"| node_league
node_caller -->|"uses format"| node_knockout
node_caller -->|"uses format"| node_crossover
node_caller -->|"queries incomplete state"| node_unknown
node_competition -->|"manages teams"| node_teams
node_competition -->|"manages players"| node_players
node_competition -->|"manages clubs"| node_clubs
node_competition -->|"manages contacts"| node_contacts
node_match -->|"stores officials"| node_officials
node_match -->|"stores manager"| node_manager
node_caller -->|"requests HTML"| node_html
node_html -->|"returns representation"| node_output
node_html -->|"reads standings"| node_league
node_caller -->|"requests calendar"| node_ics
node_ics -->|"reads fixtures"| node_competition
node_ics -->|"returns calendar data"| node_output
node_caller -->|"saves competition"| node_output
node_competition -->|"serializes JSON"| node_output

click node_competition "https://github.com/vbcompetitions/competitions-php/blob/main/src/Competition.php"
click node_stage "https://github.com/vbcompetitions/competitions-php/blob/main/src/Stage.php"
click node_group "https://github.com/vbcompetitions/competitions-php/blob/main/src/Group.php"
click node_match "https://github.com/vbcompetitions/competitions-php/blob/main/src/GroupMatch.php"
click node_schema "https://github.com/vbcompetitions/competitions-php/blob/main/schema/competition.json"
click node_league "https://github.com/vbcompetitions/competitions-php/blob/main/src/League.php"
click node_knockout "https://github.com/vbcompetitions/competitions-php/blob/main/src/Knockout.php"
click node_crossover "https://github.com/vbcompetitions/competitions-php/blob/main/src/Crossover.php"
click node_unknown "https://github.com/vbcompetitions/competitions-php/blob/main/src/IfUnknown.php"
click node_teams "https://github.com/vbcompetitions/competitions-php/blob/main/src/CompetitionTeam.php"
click node_players "https://github.com/vbcompetitions/competitions-php/blob/main/src/Player.php"
click node_clubs "https://github.com/vbcompetitions/competitions-php/blob/main/src/Club.php"
click node_contacts "https://github.com/vbcompetitions/competitions-php/blob/main/src/Contact.php"
click node_officials "https://github.com/vbcompetitions/competitions-php/blob/main/src/MatchOfficials.php"
click node_manager "https://github.com/vbcompetitions/competitions-php/blob/main/src/MatchManager.php"
click node_html "https://github.com/vbcompetitions/competitions-php/blob/main/src/HTML.php"
click node_ics "https://github.com/vbcompetitions/competitions-php/blob/main/src/ICS.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_competition,node_stage,node_group,node_match toneBlue
class node_schema,node_html,node_ics toneAmber
class node_league,node_knockout,node_crossover,node_unknown toneMint
class node_teams,node_players,node_clubs,node_contacts,node_officials,node_manager toneRose
class node_caller,node_json,node_output toneIndigo
```

## Components

### Competition model

- [Competition](https://github.com/vbcompetitions/competitions-php/blob/main/src/Competition.php): `src/Competition.php`
- [Stage](https://github.com/vbcompetitions/competitions-php/blob/main/src/Stage.php): `src/Stage.php`
- [Group](https://github.com/vbcompetitions/competitions-php/blob/main/src/Group.php): `src/Group.php`
- [Match and scores](https://github.com/vbcompetitions/competitions-php/blob/main/src/GroupMatch.php): `src/GroupMatch.php`

### Import and export

- [JSON schema](https://github.com/vbcompetitions/competitions-php/blob/main/schema/competition.json): `schema/competition.json`
- [HTML representation](https://github.com/vbcompetitions/competitions-php/blob/main/src/HTML.php): `src/HTML.php`
- [Calendar representation](https://github.com/vbcompetitions/competitions-php/blob/main/src/ICS.php): `src/ICS.php`

### Results and formats

- [League standings](https://github.com/vbcompetitions/competitions-php/blob/main/src/League.php): `src/League.php`
- [Knockout format](https://github.com/vbcompetitions/competitions-php/blob/main/src/Knockout.php): `src/Knockout.php`
- [Crossover format](https://github.com/vbcompetitions/competitions-php/blob/main/src/Crossover.php): `src/Crossover.php`
- [Unknown teams](https://github.com/vbcompetitions/competitions-php/blob/main/src/IfUnknown.php): `src/IfUnknown.php`

### Teams and people

- [Competition teams](https://github.com/vbcompetitions/competitions-php/blob/main/src/CompetitionTeam.php): `src/CompetitionTeam.php`
- [Players](https://github.com/vbcompetitions/competitions-php/blob/main/src/Player.php): `src/Player.php`
- [Clubs](https://github.com/vbcompetitions/competitions-php/blob/main/src/Club.php): `src/Club.php`
- [Contacts](https://github.com/vbcompetitions/competitions-php/blob/main/src/Contact.php): `src/Contact.php`
- [Match officials](https://github.com/vbcompetitions/competitions-php/blob/main/src/MatchOfficials.php): `src/MatchOfficials.php`
- [Match manager](https://github.com/vbcompetitions/competitions-php/blob/main/src/MatchManager.php): `src/MatchManager.php`

### Other components

- **Library caller**
- **Competition JSON**
- **Serialized or rendered data**

## Connections

- Library caller → Competition: loads or edits
- Competition JSON → Competition: loads data
- Competition → JSON schema: validates against
- Competition → Stage: organizes stages
- Stage → Group: organizes groups
- Group → Match and scores: contains matches
- Group → Competition: validates team IDs
- League standings → Match and scores: processes results
- League standings → Competition teams: reads team names
- Library caller → League standings: requests standings
- Library caller → Knockout format: uses format
- Library caller → Crossover format: uses format
- Library caller → Unknown teams: queries incomplete state
- Competition → Competition teams: manages teams
- Competition → Players: manages players
- Competition → Clubs: manages clubs
- Competition → Contacts: manages contacts
- Match and scores → Match officials: stores officials
- Match and scores → Match manager: stores manager
- Library caller → HTML representation: requests HTML
- HTML representation → Serialized or rendered data: returns representation
- HTML representation → League standings: reads standings
- Library caller → Calendar representation: requests calendar
- Calendar representation → Competition: reads fixtures
- Calendar representation → Serialized or rendered data: returns calendar data
- Library caller → Serialized or rendered data: saves competition
- Competition → Serialized or rendered data: serializes JSON
