# tradicije/librett-wordpress architecture

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

- Interactive diagram: https://gitdiagram.com/tradicije/librett-wordpress
- Repository: https://github.com/tradicije/librett-wordpress

## Overview

LibreTT is a WordPress plugin for managing and publishing table-tennis competitions, clubs, players, matches, and statistics. Its main workflow is operators entering competition and match data in the admin or user portal, which the plugin stores in database tables and exposes through compatible routes and shortcodes. Separate branches provide frontend search, settings and data transfer, and an in-progress tournament add-on. Edges reflect README statements and SOURCE INDEX references; unsampled modules are included where documented capabilities or the index support them, without inferring their internal calls.

Main entry points: [`src/WordPress/UserPortalManager.php`](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalManager.php) (Portal manager), [`includes/modules/trait-opentt-unified-search.php`](https://github.com/tradicije/librett-wordpress/blob/main/includes/modules/trait-opentt-unified-search.php) (Search orchestration), [`addons/tournaments/src/Plugin.php`](https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/Plugin.php) (Tournament bootstrap), [`addons/tournaments/src/WordPress/Admin.php`](https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/WordPress/Admin.php) (Tournament admin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["Plugin lifecycle"]
  node_plugin["Plugin bootstrap<br/>[Plugin.php]"]
  node_legacy["Compatibility core"]
  node_matchdata[("Match data tables")]
end

subgraph group_admin["Admin operations"]
  node_adminactions["Admin actions"]
  node_settings["Settings"]
  node_visual["Visual settings<br/>[VisualSettings.php]"]
  node_transfer["Import and export"]
  node_onboarding["Onboarding"]
end

subgraph group_frontend["Frontend publishing"]
  node_shortcodes["Shortcode services"]
  node_search["Search orchestration"]
  node_intent["Intent parser"]
  node_dateparser["Date parser"]
  node_searchrepo["Search repository"]
  node_searchtext["Search text matching"]
  node_templates["Route templates"]
end

subgraph group_portal["User portal"]
  node_portal["Portal manager"]
  node_auth["Portal authentication"]
  node_leagueview["League admin views"]
  node_leaguegames["League game entry"]
  node_leaguematches["League match entry"]
  node_teamview["Team manager views"]
end

subgraph group_tournaments["Tournament add-on"]
  node_tplugin["Tournament bootstrap<br/>[Plugin.php]"]
  node_tadmin["Tournament admin<br/>[Admin.php]"]
  node_brackets["Bracket generator"]
  node_trepo["Tournament repository<br/>[Repository.php]"]
  node_tschema[("Tournament tables<br/>[Schema.php]")]
  node_tshortcodes["Tournament shortcodes<br/>[Shortcodes.php]"]
end

node_operator(("Club operator"))
node_visitor(("Site visitor"))

node_operator -->|"configures"| node_adminactions
node_adminactions -->|"updates"| node_settings
node_settings -->|"resets"| node_visual
node_operator -->|"imports or exports"| node_transfer
node_operator -->|"starts setup"| node_onboarding
node_operator -->|"manages data"| node_portal
node_plugin -->|"loads"| node_legacy
node_plugin -->|"loads add-on"| node_tplugin
node_portal -->|"delegates to"| node_auth
node_portal -->|"delegates to"| node_leagueview
node_portal -->|"delegates to"| node_leaguegames
node_portal -->|"delegates to"| node_leaguematches
node_portal -->|"delegates to"| node_teamview
node_visitor -->|"requests content"| node_shortcodes
node_visitor -->|"searches"| node_search
node_search -->|"parses intent"| node_intent
node_search -->|"parses dates"| node_dateparser
node_search -->|"queries"| node_searchrepo
node_search -->|"scores text"| node_searchtext
node_dateparser -->|"uses"| node_searchtext
node_visitor -->|"views routes"| node_templates
node_visitor -->|"views tournaments"| node_tshortcodes
node_tplugin -->|"registers"| node_tadmin
node_tplugin -->|"registers"| node_tshortcodes
node_tplugin -->|"activates schema"| node_tschema
node_tadmin -->|"generates brackets"| node_brackets
node_tadmin -->|"reads tournament data"| node_trepo
node_tadmin -->|"uses tables"| node_tschema
node_tshortcodes -->|"reads tournament data"| node_trepo
node_trepo -->|"resolves tables"| node_tschema
node_brackets -->|"uses schema"| node_tschema
node_operator -->|"records matches"| node_matchdata
node_shortcodes -->|"publishes results"| node_matchdata

click node_plugin "https://github.com/tradicije/librett-wordpress/blob/main/src/Plugin.php"
click node_legacy "https://github.com/tradicije/librett-wordpress/blob/main/includes/class-opentt-unified-core.php"
click node_adminactions "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/AdminSettingsActionManager.php"
click node_settings "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/SettingsManager.php"
click node_visual "https://github.com/tradicije/librett-wordpress/blob/main/src/Infrastructure/VisualSettings.php"
click node_transfer "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/DataTransferActionManager.php"
click node_onboarding "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/OnboardingManager.php"
click node_shortcodes "https://github.com/tradicije/librett-wordpress/tree/main/src/WordPress/Shortcodes"
click node_search "https://github.com/tradicije/librett-wordpress/blob/main/includes/modules/trait-opentt-unified-search.php"
click node_intent "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/FrontendSearchIntentParser.php"
click node_dateparser "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/FrontendSearchDateParser.php"
click node_searchrepo "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/FrontendSearchRepository.php"
click node_searchtext "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/FrontendSearchText.php"
click node_templates "https://github.com/tradicije/librett-wordpress/tree/main/templates"
click node_portal "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalManager.php"
click node_auth "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalAuthService.php"
click node_leagueview "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalLeagueAdminViewService.php"
click node_leaguegames "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalLeagueGamesService.php"
click node_leaguematches "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalLeagueMatchService.php"
click node_teamview "https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalTeamManagerViewService.php"
click node_tplugin "https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/Plugin.php"
click node_tadmin "https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/WordPress/Admin.php"
click node_brackets "https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/Domain/BracketGenerator.php"
click node_trepo "https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/Infrastructure/Repository.php"
click node_tschema "https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/Infrastructure/Schema.php"
click node_tshortcodes "https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/WordPress/Shortcodes.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_plugin,node_legacy,node_matchdata toneBlue
class node_adminactions,node_settings,node_visual,node_transfer,node_onboarding toneAmber
class node_shortcodes,node_search,node_intent,node_dateparser,node_searchrepo,node_searchtext,node_templates toneMint
class node_portal,node_auth,node_leagueview,node_leaguegames,node_leaguematches,node_teamview toneRose
class node_tplugin,node_tadmin,node_brackets,node_trepo,node_tschema,node_tshortcodes,node_operator,node_visitor toneIndigo
```

## Components

### Plugin lifecycle

- [Plugin bootstrap](https://github.com/tradicije/librett-wordpress/blob/main/src/Plugin.php): `src/Plugin.php`
- [Compatibility core](https://github.com/tradicije/librett-wordpress/blob/main/includes/class-opentt-unified-core.php): `includes/class-opentt-unified-core.php`
- **Match data tables**

### Admin operations

- [Admin actions](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/AdminSettingsActionManager.php): `src/WordPress/AdminSettingsActionManager.php`
- [Settings](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/SettingsManager.php): `src/WordPress/SettingsManager.php`
- [Visual settings](https://github.com/tradicije/librett-wordpress/blob/main/src/Infrastructure/VisualSettings.php): `src/Infrastructure/VisualSettings.php`
- [Import and export](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/DataTransferActionManager.php): `src/WordPress/DataTransferActionManager.php`
- [Onboarding](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/OnboardingManager.php): `src/WordPress/OnboardingManager.php`

### Frontend publishing

- [Shortcode services](https://github.com/tradicije/librett-wordpress/tree/main/src/WordPress/Shortcodes): `src/WordPress/Shortcodes`
- [Search orchestration](https://github.com/tradicije/librett-wordpress/blob/main/includes/modules/trait-opentt-unified-search.php): `includes/modules/trait-opentt-unified-search.php`
- [Intent parser](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/FrontendSearchIntentParser.php): `src/WordPress/FrontendSearchIntentParser.php`
- [Date parser](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/FrontendSearchDateParser.php): `src/WordPress/FrontendSearchDateParser.php`
- [Search repository](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/FrontendSearchRepository.php): `src/WordPress/FrontendSearchRepository.php`
- [Search text matching](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/FrontendSearchText.php): `src/WordPress/FrontendSearchText.php`
- [Route templates](https://github.com/tradicije/librett-wordpress/tree/main/templates): `templates`

### User portal

- [Portal manager](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalManager.php): `src/WordPress/UserPortalManager.php`
- [Portal authentication](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalAuthService.php): `src/WordPress/UserPortalAuthService.php`
- [League admin views](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalLeagueAdminViewService.php): `src/WordPress/UserPortalLeagueAdminViewService.php`
- [League game entry](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalLeagueGamesService.php): `src/WordPress/UserPortalLeagueGamesService.php`
- [League match entry](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalLeagueMatchService.php): `src/WordPress/UserPortalLeagueMatchService.php`
- [Team manager views](https://github.com/tradicije/librett-wordpress/blob/main/src/WordPress/UserPortalTeamManagerViewService.php): `src/WordPress/UserPortalTeamManagerViewService.php`

### Tournament add-on

- [Tournament bootstrap](https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/Plugin.php): `addons/tournaments/src/Plugin.php`
- [Tournament admin](https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/WordPress/Admin.php): `addons/tournaments/src/WordPress/Admin.php`
- [Bracket generator](https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/Domain/BracketGenerator.php): `addons/tournaments/src/Domain/BracketGenerator.php`
- [Tournament repository](https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/Infrastructure/Repository.php): `addons/tournaments/src/Infrastructure/Repository.php`
- [Tournament tables](https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/Infrastructure/Schema.php): `addons/tournaments/src/Infrastructure/Schema.php`
- [Tournament shortcodes](https://github.com/tradicije/librett-wordpress/blob/main/addons/tournaments/src/WordPress/Shortcodes.php): `addons/tournaments/src/WordPress/Shortcodes.php`

### Other components

- **Club operator**
- **Site visitor**

## Connections

- Club operator → Admin actions: configures
- Admin actions → Settings: updates (evidence: `src/WordPress/AdminSettingsActionManager.php`)
- Settings → Visual settings: resets (evidence: `src/WordPress/SettingsManager.php`)
- Club operator → Import and export: imports or exports
- Club operator → Onboarding: starts setup
- Club operator → Portal manager: manages data
- Plugin bootstrap → Compatibility core: loads (evidence: `src/Plugin.php`)
- Plugin bootstrap → Tournament bootstrap: loads add-on (evidence: `src/Plugin.php`)
- Portal manager → Portal authentication: delegates to (evidence: `src/WordPress/UserPortalManager.php`)
- Portal manager → League admin views: delegates to (evidence: `src/WordPress/UserPortalManager.php`)
- Portal manager → League game entry: delegates to (evidence: `src/WordPress/UserPortalManager.php`)
- Portal manager → League match entry: delegates to (evidence: `src/WordPress/UserPortalManager.php`)
- Portal manager → Team manager views: delegates to (evidence: `src/WordPress/UserPortalManager.php`)
- Site visitor → Shortcode services: requests content
- Site visitor → Search orchestration: searches
- Search orchestration → Intent parser: parses intent (evidence: `includes/modules/trait-opentt-unified-search.php`)
- Search orchestration → Date parser: parses dates (evidence: `includes/modules/trait-opentt-unified-search.php`)
- Search orchestration → Search repository: queries (evidence: `includes/modules/trait-opentt-unified-search.php`)
- Search orchestration → Search text matching: scores text (evidence: `includes/modules/trait-opentt-unified-search.php`)
- Date parser → Search text matching: uses (evidence: `src/WordPress/FrontendSearchDateParser.php`)
- Site visitor → Route templates: views routes
- Site visitor → Tournament shortcodes: views tournaments
- Tournament bootstrap → Tournament admin: registers (evidence: `addons/tournaments/src/Plugin.php`)
- Tournament bootstrap → Tournament shortcodes: registers (evidence: `addons/tournaments/src/Plugin.php`)
- Tournament bootstrap → Tournament tables: activates schema (evidence: `addons/tournaments/src/Plugin.php`)
- Tournament admin → Bracket generator: generates brackets (evidence: `addons/tournaments/src/WordPress/Admin.php`)
- Tournament admin → Tournament repository: reads tournament data (evidence: `addons/tournaments/src/WordPress/Admin.php`)
- Tournament admin → Tournament tables: uses tables (evidence: `addons/tournaments/src/WordPress/Admin.php`)
- Tournament shortcodes → Tournament repository: reads tournament data (evidence: `addons/tournaments/src/WordPress/Shortcodes.php`)
- Tournament repository → Tournament tables: resolves tables (evidence: `addons/tournaments/src/Infrastructure/Repository.php`)
- Bracket generator → Tournament tables: uses schema (evidence: `addons/tournaments/src/Domain/BracketGenerator.php`)
- Club operator → Match data tables: records matches
- Shortcode services → Match data tables: publishes results
