# mateustassinari/api-soccer-championships architecture

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

- Interactive diagram: https://gitdiagram.com/mateustassinari/api-soccer-championships
- Repository: https://github.com/mateustassinari/api-soccer-championships

## Overview

projectRestPuc is a Kotlin/Spring REST API for managing soccer teams, players, tournaments, matches, and transfers. Users authenticate to obtain a JWT, then call API endpoints to manage those records; match-event operations also publish messages to RabbitMQ, while match events are stored in MySQL. The graph preserves the documented domain capabilities and the sampled controller/service boundaries. Several implementations and integrations are unsampled, so their internal call paths are not inferred.

Main entry points: [`src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/MatchController.kt`](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/MatchController.kt) (Match API), [`src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/PlayersController.kt`](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/PlayersController.kt) (Players API), [`src/main/kotlin/br/com/mateus/projetoRestPuc/services/EventService.kt`](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services/EventService.kt) (Match events), [`src/main/kotlin/br/com/mateus/projetoRestPuc/services`](https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services) (Tournament service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and security"]
  node_auth["Authentication API<br/>[AuthController.kt]"]
  node_jwt["JWT security"]
end

subgraph group_domain["Soccer management"]
  node_teams_api["Teams API<br/>[TeamsController.kt]"]
  node_players_api["Players API"]
  node_tournaments_api["Tournament API"]
  node_matches_api["Match API<br/>[MatchController.kt]"]
  node_transfers_api["Transfers API"]
end

subgraph group_services["Domain services"]
  node_team_service["Team service"]
  node_player_service["Player service"]
  node_tournament_service["Tournament service"]
  node_match_service["Match service"]
  node_transfer_service["Transfer service"]
  node_event_service["Match events<br/>[EventService.kt]"]
end

subgraph group_persistence["Persistence and messaging"]
  node_entities["Domain entities"]
  node_repositories["JPA repositories"]
  node_rabbit_sender["RabbitMQ sender<br/>[QueueSender.kt]"]
end

node_user(("API client"))
node_mysql[("MySQL")]
node_rabbit["RabbitMQ events queue"]

node_user -->|"logs in"| node_auth
node_user -->|"sends token"| node_jwt
node_user -->|"manages teams"| node_teams_api
node_user -->|"manages players"| node_players_api
node_user -->|"manages tournaments"| node_tournaments_api
node_user -->|"manages matches"| node_matches_api
node_user -->|"manages transfers"| node_transfers_api
node_teams_api -->|"delegates to"| node_team_service
node_players_api -->|"delegates to"| node_player_service
node_players_api -->|"delegates to"| node_transfer_service
node_tournaments_api -->|"delegates to"| node_tournament_service
node_matches_api -->|"delegates to"| node_match_service
node_matches_api -->|"checks tournament"| node_tournament_service
node_matches_api -->|"records events"| node_event_service
node_transfers_api -->|"delegates to"| node_transfer_service
node_team_service -->|"uses team repository"| node_repositories
node_tournament_service -->|"uses repositories"| node_repositories
node_repositories -.->|"persists records"| node_mysql
node_event_service -.->|"stores match events"| node_mysql
node_event_service -.->|"publishes events"| node_rabbit_sender
node_rabbit_sender -.->|"sends messages"| node_rabbit

click node_auth "https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/AuthController.kt"
click node_jwt "https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/security"
click node_teams_api "https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TeamsController.kt"
click node_players_api "https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/PlayersController.kt"
click node_tournaments_api "https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TournamentController.kt"
click node_matches_api "https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/MatchController.kt"
click node_transfers_api "https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TransfersController.kt"
click node_team_service "https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services"
click node_player_service "https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services"
click node_tournament_service "https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services"
click node_match_service "https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services"
click node_transfer_service "https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services"
click node_event_service "https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services/EventService.kt"
click node_entities "https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/entities"
click node_repositories "https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/repositories"
click node_rabbit_sender "https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/rabbit/QueueSender.kt"

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_auth,node_jwt,node_user toneBlue
class node_teams_api,node_players_api,node_tournaments_api,node_matches_api,node_transfers_api,node_mysql toneAmber
class node_team_service,node_player_service,node_tournament_service,node_match_service,node_transfer_service,node_event_service toneMint
class node_entities,node_repositories,node_rabbit_sender,node_rabbit toneRose
```

## Components

### API and security

- [Authentication API](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/AuthController.kt): `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/AuthController.kt`
- [JWT security](https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/security): `src/main/kotlin/br/com/mateus/projetoRestPuc/security`

### Soccer management

- [Teams API](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TeamsController.kt): `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TeamsController.kt`
- [Players API](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/PlayersController.kt): `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/PlayersController.kt`
- [Tournament API](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TournamentController.kt): `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TournamentController.kt`
- [Match API](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/MatchController.kt): `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/MatchController.kt`
- [Transfers API](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TransfersController.kt): `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TransfersController.kt`

### Domain services

- [Team service](https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services): `src/main/kotlin/br/com/mateus/projetoRestPuc/services`
- [Player service](https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services): `src/main/kotlin/br/com/mateus/projetoRestPuc/services`
- [Tournament service](https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services): `src/main/kotlin/br/com/mateus/projetoRestPuc/services`
- [Match service](https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services): `src/main/kotlin/br/com/mateus/projetoRestPuc/services`
- [Transfer service](https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services): `src/main/kotlin/br/com/mateus/projetoRestPuc/services`
- [Match events](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/services/EventService.kt): `src/main/kotlin/br/com/mateus/projetoRestPuc/services/EventService.kt`

### Persistence and messaging

- [Domain entities](https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/entities): `src/main/kotlin/br/com/mateus/projetoRestPuc/entities`
- [JPA repositories](https://github.com/mateustassinari/api-soccer-championships/tree/master/src/main/kotlin/br/com/mateus/projetoRestPuc/repositories): `src/main/kotlin/br/com/mateus/projetoRestPuc/repositories`
- [RabbitMQ sender](https://github.com/mateustassinari/api-soccer-championships/blob/master/src/main/kotlin/br/com/mateus/projetoRestPuc/rabbit/QueueSender.kt): `src/main/kotlin/br/com/mateus/projetoRestPuc/rabbit/QueueSender.kt`

### Other components

- **API client**
- **MySQL**
- **RabbitMQ events queue**

## Connections

- API client → Authentication API: logs in (evidence: `README.md`)
- API client → JWT security: sends token (evidence: `README.md`)
- API client → Teams API: manages teams (evidence: `README.md`)
- API client → Players API: manages players (evidence: `README.md`)
- API client → Tournament API: manages tournaments (evidence: `README.md`)
- API client → Match API: manages matches (evidence: `README.md`)
- API client → Transfers API: manages transfers (evidence: `README.md`)
- Teams API → Team service: delegates to (evidence: `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TeamsController.kt`)
- Players API → Player service: delegates to (evidence: `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/PlayersController.kt`)
- Players API → Transfer service: delegates to (evidence: `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/PlayersController.kt`)
- Tournament API → Tournament service: delegates to (evidence: `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TournamentController.kt`)
- Match API → Match service: delegates to (evidence: `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/MatchController.kt`)
- Match API → Tournament service: checks tournament (evidence: `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/MatchController.kt`)
- Match API → Match events: records events (evidence: `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/MatchController.kt`)
- Transfers API → Transfer service: delegates to (evidence: `src/main/kotlin/br/com/mateus/projetoRestPuc/controllers/TransfersController.kt`)
- Team service → JPA repositories: uses team repository (evidence: `src/main/kotlin/br/com/mateus/projetoRestPuc/services/impl/TeamServiceImpl.kt`)
- Tournament service → JPA repositories: uses repositories (evidence: `src/main/kotlin/br/com/mateus/projetoRestPuc/services/impl/TournamentServiceImpl.kt`)
- JPA repositories → MySQL: persists records
- Match events → MySQL: stores match events (evidence: `README.md`)
- Match events → RabbitMQ sender: publishes events (evidence: `README.md`)
- RabbitMQ sender → RabbitMQ events queue: sends messages (evidence: `README.md`)
