# sevynix/calcgt architecture

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

- Interactive diagram: https://gitdiagram.com/sevynix/calcgt
- Repository: https://github.com/sevynix/calcgt

## Overview

This Laravel application combines tournament administration and hosting with public tournament registration and a broad collection of game-related calculators and tool pages. The main workflow is a host managing a tournament, preparing participants, generating and running bracket phases, and publishing results for public viewing. The graph emphasizes that workflow and the documented-in-tree tool and community branches. Evidence is limited to the supplied excerpts and SOURCE INDEX; unsampled integrations are not connected speculatively.

Main entry points: [`app/Services/BracketService.php`](https://github.com/sevynix/calcgt/blob/main/app/Services/BracketService.php) (Bracket coordination), [`app/Http/Controllers/Public/RegistrationController.php`](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Public/RegistrationController.php) (Registration), [`app/Http/Controllers/Host/BracketController.php`](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Host/BracketController.php) (Host bracket controls), [`app/Services/Bracket/BracketManager.php`](https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/BracketManager.php) (Bracket progression)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tournament["Tournament workflow"]
  node_public_tournaments["Public tournaments"]
  node_registration["Registration"]
  node_tournament_admin["Tournament setup"]
  node_host_access["Host access<br/>[HostMiddleware.php]"]
  node_tournament_model[("Tournament records<br/>[Tournament.php]")]
  node_competition_model[("Competition records<br/>[Competition.php]")]
  node_participant_records[("Participant records<br/>[Registration.php]")]
  node_host_bracket["Host bracket controls"]
  node_host_spin["Participant selection"]
  node_public_bracket["Public bracket"]
end

subgraph group_brackets["Bracket engine"]
  node_bracket_service["Bracket coordination<br/>[BracketService.php]"]
  node_bracket_manager["Bracket progression<br/>[BracketManager.php]"]
  node_format_resolver["Format options"]
  node_single_elim["Single elimination"]
  node_group_stage["Group stage"]
  node_upper_lower["Upper-lower bracket"]
  node_bracket_data[("Bracket records<br/>[BracketNode.php]")]
  node_phase_data[("Competition phases")]
  node_spin_service["Spin wheel service"]
end

subgraph group_community["Community and admin"]
  node_admin_dashboard["Admin dashboard"]
  node_feedback["Feedback"]
  node_opinions["Community opinions"]
  node_community_posts[("Community posts<br/>[CommunityPost.php]")]
  node_admin_capabilities["Content administration"]
end

subgraph group_tools["Game tools"]
  node_game_tools["Game calculators and packs"]
end

node_visitor(("Public visitor"))
node_host(("Tournament host"))
node_admin(("Administrator"))

node_visitor -.->|"browses"| node_public_tournaments
node_visitor -.->|"registers"| node_registration
node_registration -->|"creates registrations"| node_participant_records
node_registration -->|"checks eligibility"| node_competition_model
node_tournament_admin -->|"manages tournaments"| node_tournament_model
node_tournament_admin -->|"manages host keys"| node_host_access
node_host -.->|"authenticates"| node_host_access
node_host_access -->|"authorizes host routes"| node_host_bracket
node_host_bracket -->|"reads bracket data"| node_bracket_service
node_host_bracket -->|"reads selection"| node_spin_service
node_host_spin -->|"manages draws"| node_spin_service
node_spin_service -->|"loads participants"| node_competition_model
node_bracket_service -->|"delegates progression"| node_bracket_manager
node_bracket_service -->|"resolves formats"| node_format_resolver
node_bracket_service -->|"generates format"| node_single_elim
node_bracket_service -->|"generates format"| node_group_stage
node_bracket_service -->|"generates format"| node_upper_lower
node_bracket_manager -->|"updates matches"| node_bracket_data
node_bracket_manager -->|"updates phase status"| node_phase_data
node_bracket_service -->|"creates bracket data"| node_bracket_data
node_bracket_service -->|"creates phases"| node_phase_data
node_public_bracket -->|"requests bracket data"| node_bracket_service
node_admin -.->|"views dashboard"| node_admin_dashboard
node_admin_dashboard -->|"counts feedback"| node_feedback
node_feedback -.->|"uses feedback model"| node_community_posts
node_opinions -->|"loads related posts"| node_community_posts
node_admin -.->|"manages content"| node_admin_capabilities

click node_public_tournaments "https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Public/TournamentController.php"
click node_registration "https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Public/RegistrationController.php"
click node_tournament_admin "https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Admin/TournamentController.php"
click node_host_access "https://github.com/sevynix/calcgt/blob/main/app/Http/Middleware/HostMiddleware.php"
click node_tournament_model "https://github.com/sevynix/calcgt/blob/main/app/Models/Tournament.php"
click node_competition_model "https://github.com/sevynix/calcgt/blob/main/app/Models/Competition.php"
click node_participant_records "https://github.com/sevynix/calcgt/blob/main/app/Models/Registration.php"
click node_host_bracket "https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Host/BracketController.php"
click node_host_spin "https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Host/SpinWheelController.php"
click node_public_bracket "https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Public/BracketController.php"
click node_bracket_service "https://github.com/sevynix/calcgt/blob/main/app/Services/BracketService.php"
click node_bracket_manager "https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/BracketManager.php"
click node_format_resolver "https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/FixedBracketOptionsResolver.php"
click node_single_elim "https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/SingleEliminationGenerator.php"
click node_group_stage "https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/GroupStageGenerator.php"
click node_upper_lower "https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/UpperLowerGenerator.php"
click node_bracket_data "https://github.com/sevynix/calcgt/blob/main/app/Models/BracketNode.php"
click node_phase_data "https://github.com/sevynix/calcgt/blob/main/app/Models/CompetitionPhase.php"
click node_spin_service "https://github.com/sevynix/calcgt/blob/main/app/Services/SpinWheelService.php"
click node_admin_dashboard "https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Admin/DashboardController.php"
click node_feedback "https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/FeedbackController.php"
click node_opinions "https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/CommunityOpinionController.php"
click node_community_posts "https://github.com/sevynix/calcgt/blob/main/app/Models/CommunityPost.php"
click node_admin_capabilities "https://github.com/sevynix/calcgt/tree/main/app/Http/Controllers/Admin"
click node_game_tools "https://github.com/sevynix/calcgt/tree/main/resources/views/layouts"

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_public_tournaments,node_registration,node_tournament_admin,node_host_access,node_tournament_model,node_competition_model,node_participant_records,node_host_bracket,node_host_spin,node_public_bracket toneBlue
class node_bracket_service,node_bracket_manager,node_format_resolver,node_single_elim,node_group_stage,node_upper_lower,node_bracket_data,node_phase_data,node_spin_service toneAmber
class node_admin_dashboard,node_feedback,node_opinions,node_community_posts,node_admin_capabilities toneMint
class node_game_tools toneRose
class node_visitor,node_host,node_admin toneIndigo
```

## Components

### Tournament workflow

- [Public tournaments](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Public/TournamentController.php): `app/Http/Controllers/Public/TournamentController.php`
- [Registration](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Public/RegistrationController.php): `app/Http/Controllers/Public/RegistrationController.php`
- [Tournament setup](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Admin/TournamentController.php): `app/Http/Controllers/Admin/TournamentController.php`
- [Host access](https://github.com/sevynix/calcgt/blob/main/app/Http/Middleware/HostMiddleware.php): `app/Http/Middleware/HostMiddleware.php`
- [Tournament records](https://github.com/sevynix/calcgt/blob/main/app/Models/Tournament.php): `app/Models/Tournament.php`
- [Competition records](https://github.com/sevynix/calcgt/blob/main/app/Models/Competition.php): `app/Models/Competition.php`
- [Participant records](https://github.com/sevynix/calcgt/blob/main/app/Models/Registration.php): `app/Models/Registration.php`
- [Host bracket controls](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Host/BracketController.php): `app/Http/Controllers/Host/BracketController.php`
- [Participant selection](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Host/SpinWheelController.php): `app/Http/Controllers/Host/SpinWheelController.php`
- [Public bracket](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Public/BracketController.php): `app/Http/Controllers/Public/BracketController.php`

### Bracket engine

- [Bracket coordination](https://github.com/sevynix/calcgt/blob/main/app/Services/BracketService.php): `app/Services/BracketService.php`
- [Bracket progression](https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/BracketManager.php): `app/Services/Bracket/BracketManager.php`
- [Format options](https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/FixedBracketOptionsResolver.php): `app/Services/Bracket/FixedBracketOptionsResolver.php`
- [Single elimination](https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/SingleEliminationGenerator.php): `app/Services/Bracket/SingleEliminationGenerator.php`
- [Group stage](https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/GroupStageGenerator.php): `app/Services/Bracket/GroupStageGenerator.php`
- [Upper-lower bracket](https://github.com/sevynix/calcgt/blob/main/app/Services/Bracket/UpperLowerGenerator.php): `app/Services/Bracket/UpperLowerGenerator.php`
- [Bracket records](https://github.com/sevynix/calcgt/blob/main/app/Models/BracketNode.php): `app/Models/BracketNode.php`
- [Competition phases](https://github.com/sevynix/calcgt/blob/main/app/Models/CompetitionPhase.php): `app/Models/CompetitionPhase.php`
- [Spin wheel service](https://github.com/sevynix/calcgt/blob/main/app/Services/SpinWheelService.php): `app/Services/SpinWheelService.php`

### Community and admin

- [Admin dashboard](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/Admin/DashboardController.php): `app/Http/Controllers/Admin/DashboardController.php`
- [Feedback](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/FeedbackController.php): `app/Http/Controllers/FeedbackController.php`
- [Community opinions](https://github.com/sevynix/calcgt/blob/main/app/Http/Controllers/CommunityOpinionController.php): `app/Http/Controllers/CommunityOpinionController.php`
- [Community posts](https://github.com/sevynix/calcgt/blob/main/app/Models/CommunityPost.php): `app/Models/CommunityPost.php`
- [Content administration](https://github.com/sevynix/calcgt/tree/main/app/Http/Controllers/Admin): `app/Http/Controllers/Admin`

### Game tools

- [Game calculators and packs](https://github.com/sevynix/calcgt/tree/main/resources/views/layouts): `resources/views/layouts`

### Other components

- **Public visitor**
- **Tournament host**
- **Administrator**

## Connections

- Public visitor → Public tournaments: browses
- Public visitor → Registration: registers
- Registration → Participant records: creates registrations (evidence: `app/Http/Controllers/Public/RegistrationController.php`)
- Registration → Competition records: checks eligibility (evidence: `app/Http/Controllers/Public/RegistrationController.php`)
- Tournament setup → Tournament records: manages tournaments (evidence: `app/Http/Controllers/Admin/TournamentController.php`)
- Tournament setup → Host access: manages host keys (evidence: `app/Http/Controllers/Admin/TournamentController.php`)
- Tournament host → Host access: authenticates
- Host access → Host bracket controls: authorizes host routes
- Host bracket controls → Bracket coordination: reads bracket data (evidence: `app/Http/Controllers/Host/BracketController.php`)
- Host bracket controls → Spin wheel service: reads selection (evidence: `app/Http/Controllers/Host/BracketController.php`)
- Participant selection → Spin wheel service: manages draws (evidence: `app/Http/Controllers/Host/SpinWheelController.php`)
- Spin wheel service → Competition records: loads participants (evidence: `app/Services/SpinWheelService.php`)
- Bracket coordination → Bracket progression: delegates progression (evidence: `app/Services/BracketService.php`)
- Bracket coordination → Format options: resolves formats (evidence: `app/Services/BracketService.php`)
- Bracket coordination → Single elimination: generates format (evidence: `app/Services/BracketService.php`)
- Bracket coordination → Group stage: generates format (evidence: `app/Services/BracketService.php`)
- Bracket coordination → Upper-lower bracket: generates format (evidence: `app/Services/BracketService.php`)
- Bracket progression → Bracket records: updates matches (evidence: `app/Services/Bracket/BracketManager.php`)
- Bracket progression → Competition phases: updates phase status (evidence: `app/Services/Bracket/BracketManager.php`)
- Bracket coordination → Bracket records: creates bracket data (evidence: `app/Services/BracketService.php`)
- Bracket coordination → Competition phases: creates phases (evidence: `app/Services/BracketService.php`)
- Public bracket → Bracket coordination: requests bracket data (evidence: `app/Http/Controllers/Public/BracketController.php`)
- Administrator → Admin dashboard: views dashboard
- Admin dashboard → Feedback: counts feedback (evidence: `app/Http/Controllers/Admin/DashboardController.php`)
- Feedback → Community posts: uses feedback model
- Community opinions → Community posts: loads related posts (evidence: `app/Http/Controllers/CommunityOpinionController.php`)
- Administrator → Content administration: manages content
