# design2k27/garame-app architecture

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

- Interactive diagram: https://gitdiagram.com/design2k27/garame-app
- Repository: https://github.com/design2k27/garame-app
- Video tour (about a minute): https://gitdiagram.com/design2k27/garame-app/video

## Overview

Garame is a browser-based multiplayer card-game product with a Symfony API. Players authenticate, enter the dashboard or lobby, join or create a match, play rounds in a game room, and view game outcomes; the API handles matchmaking, game rules, state payloads, and account-related features. The graph preserves the distinct wallet, profile, ranking, home-status, and live-update capabilities visible in the source inventory. Some of those implementations were not excerpted, so their internal relationships are left unasserted.

Main entry points: [`garame-api/src/Service/GameApplicationService.php`](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/GameApplicationService.php) (Game application), [`garame-web/src/app/routes.tsx`](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/routes.tsx) (Page routing), [`garame-api/src/Controller/GameController.php`](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/GameController.php) (Game API), [`garame-web/src/app/api/client.ts`](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/api/client.ts) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routes["Page routing<br/>[routes.tsx]"]
  node_auth_ui["Auth context<br/>[AuthContext.tsx]"]
  node_auth_page["Sign in and register<br/>[AuthPage.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_lobby["Match lobby<br/>[Lobby.tsx]"]
  node_game_room["Game room<br/>[GameRoom.tsx]"]
  node_wallet["Wallet<br/>[Wallet.tsx]"]
  node_api_client["HTTP client<br/>[client.ts]"]
  node_api_facade["API operations<br/>[garameApi.ts]"]
end

subgraph group_api["API workflows"]
  node_auth_controller["Authentication API<br/>[AuthController.php]"]
  node_game_controller["Game API<br/>[GameController.php]"]
  node_move_controller["Move API<br/>[MoveController.php]"]
  node_home_controller["Home status API<br/>[HomeController.php]"]
  node_profile_controller["Profile API"]
  node_ranking_controller["Ranking API"]
  node_home_status["Home status"]
  node_profile_stats["Profile statistics"]
end

subgraph group_game["Game domain"]
  node_game_app["Game application"]
  node_move_app["Move application"]
  node_engine["Rules engine<br/>[GameEngine.php]"]
  node_deck["Card deck"]
  node_payload["Game payloads"]
  node_live_updates["Live publishing"]
end

subgraph group_persistence["Persistence and accounts"]
  node_user["User record<br/>[User.php]"]
  node_game_entities["Game state records"]
  node_user_repo["User repository<br/>[UserRepository.php]"]
  node_game_repo["Game repository<br/>[GameRepository.php]"]
  node_player_repo["Game-player repository"]
  node_game_db[("Doctrine database")]
end

node_player(("Player"))

node_routes -->|"routes to"| node_auth_page
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_lobby
node_routes -->|"routes to"| node_game_room
node_routes -->|"routes to"| node_wallet
node_auth_ui -->|"requests auth"| node_api_facade
node_auth_page -->|"uses context"| node_auth_ui
node_api_facade -->|"sends requests"| node_api_client
node_game_room -->|"sends requests"| node_api_client
node_game_room -->|"uses operations"| node_api_facade
node_player -.->|"opens application"| node_routes
node_api_client -.->|"HTTP API"| node_game_controller
node_api_client -.->|"HTTP API"| node_auth_controller
node_auth_controller -->|"uses repository"| node_user_repo
node_auth_controller -->|"uses user"| node_user
node_game_controller -->|"delegates games"| node_game_app
node_game_controller -->|"builds responses"| node_payload
node_move_controller -->|"delegates moves"| node_move_app
node_move_controller -->|"builds responses"| node_payload
node_home_controller -->|"gets status"| node_home_status
node_game_app -->|"uses rules"| node_engine
node_game_app -->|"queries games"| node_game_repo
node_game_app -->|"queries players"| node_player_repo
node_game_app -->|"queries users"| node_user_repo
node_game_app -.->|"publishes updates"| node_live_updates
node_engine -->|"uses deck"| node_deck
node_engine -->|"queries players"| node_player_repo
node_game_controller -->|"serializes game"| node_game_entities
node_user_repo -->|"loads users"| node_user
node_game_repo -->|"loads games"| node_game_entities
node_player_repo -->|"loads players"| node_game_entities
node_profile_controller -.->|"uses statistics"| node_profile_stats
node_game_entities -.->|"persisted by Doctrine"| node_game_db

click node_routes "https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/routes.tsx"
click node_auth_ui "https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/auth/AuthContext.tsx"
click node_auth_page "https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/pages/AuthPage.tsx"
click node_dashboard "https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/pages/Dashboard.tsx"
click node_lobby "https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/pages/Lobby.tsx"
click node_game_room "https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/pages/GameRoom.tsx"
click node_wallet "https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/pages/Wallet.tsx"
click node_api_client "https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/api/client.ts"
click node_api_facade "https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/api/garameApi.ts"
click node_auth_controller "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/AuthController.php"
click node_game_controller "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/GameController.php"
click node_move_controller "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/MoveController.php"
click node_home_controller "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/HomeController.php"
click node_profile_controller "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/ProfileController.php"
click node_ranking_controller "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/RankingController.php"
click node_game_app "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/GameApplicationService.php"
click node_move_app "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/MoveApplicationService.php"
click node_engine "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/GameEngine.php"
click node_deck "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/CardDeckService.php"
click node_payload "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/GamePayloadBuilder.php"
click node_live_updates "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/MercurePublisher.php"
click node_home_status "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/HomeStatusService.php"
click node_profile_stats "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/ProfileStatsService.php"
click node_user "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Entity/User.php"
click node_game_entities "https://github.com/design2k27/garame-app/tree/main/garame-api/src/Entity"
click node_user_repo "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Repository/UserRepository.php"
click node_game_repo "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Repository/GameRepository.php"
click node_player_repo "https://github.com/design2k27/garame-app/blob/main/garame-api/src/Repository/GamePlayerRepository.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_routes,node_auth_ui,node_auth_page,node_dashboard,node_lobby,node_game_room,node_wallet,node_api_client,node_api_facade toneBlue
class node_auth_controller,node_game_controller,node_move_controller,node_home_controller,node_profile_controller,node_ranking_controller,node_home_status,node_profile_stats toneAmber
class node_game_app,node_move_app,node_engine,node_deck,node_payload,node_live_updates toneMint
class node_user,node_game_entities,node_user_repo,node_game_repo,node_player_repo,node_game_db toneRose
class node_player toneIndigo
```

## Components

### Web application

- [Page routing](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/routes.tsx): `garame-web/src/app/routes.tsx`
- [Auth context](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/auth/AuthContext.tsx): `garame-web/src/app/auth/AuthContext.tsx`
- [Sign in and register](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/pages/AuthPage.tsx): `garame-web/src/app/pages/AuthPage.tsx`
- [Dashboard](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/pages/Dashboard.tsx): `garame-web/src/app/pages/Dashboard.tsx`
- [Match lobby](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/pages/Lobby.tsx): `garame-web/src/app/pages/Lobby.tsx`
- [Game room](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/pages/GameRoom.tsx): `garame-web/src/app/pages/GameRoom.tsx`
- [Wallet](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/pages/Wallet.tsx): `garame-web/src/app/pages/Wallet.tsx`
- [HTTP client](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/api/client.ts): `garame-web/src/app/api/client.ts`
- [API operations](https://github.com/design2k27/garame-app/blob/main/garame-web/src/app/api/garameApi.ts): `garame-web/src/app/api/garameApi.ts`

### API workflows

- [Authentication API](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/AuthController.php): `garame-api/src/Controller/AuthController.php`
- [Game API](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/GameController.php): `garame-api/src/Controller/GameController.php`
- [Move API](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/MoveController.php): `garame-api/src/Controller/MoveController.php`
- [Home status API](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/HomeController.php): `garame-api/src/Controller/HomeController.php`
- [Profile API](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/ProfileController.php): `garame-api/src/Controller/ProfileController.php`
- [Ranking API](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Controller/RankingController.php): `garame-api/src/Controller/RankingController.php`
- [Home status](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/HomeStatusService.php): `garame-api/src/Service/HomeStatusService.php`
- [Profile statistics](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/ProfileStatsService.php): `garame-api/src/Service/ProfileStatsService.php`

### Game domain

- [Game application](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/GameApplicationService.php): `garame-api/src/Service/GameApplicationService.php`
- [Move application](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/MoveApplicationService.php): `garame-api/src/Service/MoveApplicationService.php`
- [Rules engine](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/GameEngine.php): `garame-api/src/Service/GameEngine.php`
- [Card deck](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/CardDeckService.php): `garame-api/src/Service/CardDeckService.php`
- [Game payloads](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/GamePayloadBuilder.php): `garame-api/src/Service/GamePayloadBuilder.php`
- [Live publishing](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Service/MercurePublisher.php): `garame-api/src/Service/MercurePublisher.php`

### Persistence and accounts

- [User record](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Entity/User.php): `garame-api/src/Entity/User.php`
- [Game state records](https://github.com/design2k27/garame-app/tree/main/garame-api/src/Entity): `garame-api/src/Entity`
- [User repository](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Repository/UserRepository.php): `garame-api/src/Repository/UserRepository.php`
- [Game repository](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Repository/GameRepository.php): `garame-api/src/Repository/GameRepository.php`
- [Game-player repository](https://github.com/design2k27/garame-app/blob/main/garame-api/src/Repository/GamePlayerRepository.php): `garame-api/src/Repository/GamePlayerRepository.php`
- **Doctrine database**

### Other components

- **Player**

## Connections

- Page routing → Sign in and register: routes to (evidence: `garame-web/src/app/routes.tsx`)
- Page routing → Dashboard: routes to (evidence: `garame-web/src/app/routes.tsx`)
- Page routing → Match lobby: routes to (evidence: `garame-web/src/app/routes.tsx`)
- Page routing → Game room: routes to (evidence: `garame-web/src/app/routes.tsx`)
- Page routing → Wallet: routes to (evidence: `garame-web/src/app/routes.tsx`)
- Auth context → API operations: requests auth (evidence: `garame-web/src/app/auth/AuthContext.tsx`)
- Sign in and register → Auth context: uses context (evidence: `garame-web/src/app/pages/AuthPage.tsx`)
- API operations → HTTP client: sends requests (evidence: `garame-web/src/app/api/garameApi.ts`)
- Game room → HTTP client: sends requests (evidence: `garame-web/src/app/pages/GameRoom.tsx`)
- Game room → API operations: uses operations (evidence: `garame-web/src/app/pages/GameRoom.tsx`)
- Player → Page routing: opens application
- HTTP client → Game API: HTTP API
- HTTP client → Authentication API: HTTP API
- Authentication API → User repository: uses repository (evidence: `garame-api/src/Controller/AuthController.php`)
- Authentication API → User record: uses user (evidence: `garame-api/src/Controller/AuthController.php`)
- Game API → Game application: delegates games (evidence: `garame-api/src/Controller/GameController.php`)
- Game API → Game payloads: builds responses (evidence: `garame-api/src/Controller/GameController.php`)
- Move API → Move application: delegates moves (evidence: `garame-api/src/Controller/MoveController.php`)
- Move API → Game payloads: builds responses (evidence: `garame-api/src/Controller/MoveController.php`)
- Home status API → Home status: gets status (evidence: `garame-api/src/Controller/HomeController.php`)
- Game application → Rules engine: uses rules (evidence: `garame-api/src/Service/GameApplicationService.php`)
- Game application → Game repository: queries games (evidence: `garame-api/src/Service/GameApplicationService.php`)
- Game application → Game-player repository: queries players (evidence: `garame-api/src/Service/GameApplicationService.php`)
- Game application → User repository: queries users (evidence: `garame-api/src/Service/GameApplicationService.php`)
- Game application → Live publishing: publishes updates (evidence: `garame-api/src/Service/GameApplicationService.php`)
- Rules engine → Card deck: uses deck (evidence: `garame-api/src/Service/GameEngine.php`)
- Rules engine → Game-player repository: queries players (evidence: `garame-api/src/Service/GameEngine.php`)
- Game API → Game state records: serializes game (evidence: `garame-api/src/Controller/GameController.php`)
- User repository → User record: loads users (evidence: `garame-api/src/Repository/UserRepository.php`)
- Game repository → Game state records: loads games (evidence: `garame-api/src/Repository/GameRepository.php`)
- Game-player repository → Game state records: loads players (evidence: `garame-api/src/Repository/GamePlayerRepository.php`)
- Profile API → Profile statistics: uses statistics
- Game state records → Doctrine database: persisted by Doctrine
