# nadavsho11/poker_tournament_system architecture

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

- Interactive diagram: https://gitdiagram.com/nadavsho11/poker_tournament_system
- Repository: https://github.com/nadavsho11/poker_tournament_system

## Overview

This is a browser-based poker tournament management app. A tournament operator uses the public interface to start and advance blind levels, pause the timer, and finish or reset the event; they can also manage players and view prize and final-ranking tables. The Express server serves the interface and routes API requests to tournament and player controllers or file-backed prize/blind reads. Player records and configuration are JSON files, while live tournament state is in memory. The excerpts show the principal request paths; frontend and some route behavior is only partially sampled.

Main entry points: [`server/server.js`](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/server.js) (Express server), [`public/script.js`](https://github.com/nadavsho11/poker_tournament_system/blob/main/public/script.js) (Browser logic), [`server/controllers/playerController.js`](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/controllers/playerController.js) (Player operations), [`server/controllers/tournamentController.js`](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/controllers/tournamentController.js) (Tournament state and timer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Operator Interface"]
  node_web["Web interface<br/>[index.html]"]
  node_browser["Browser logic<br/>[script.js]"]
end

subgraph group_api["HTTP API"]
  node_server["Express server<br/>[server.js]"]
  node_player_routes["Player routes<br/>[player.js]"]
  node_tournament_routes["Tournament routes<br/>[tournament.js]"]
  node_prize_routes["Prize route<br/>[prize.js]"]
  node_blinds_routes["Blind route<br/>[blinds.js]"]
end

subgraph group_operations["Tournament Operations"]
  node_player_controller["Player operations"]
  node_tournament_controller["Tournament state and timer"]
end

subgraph group_records["Tournament Records"]
  node_player_data[("Player records<br/>[players.json]")]
  node_prize_data[("Prize schedule<br/>[prizes.json]")]
  node_blind_data[("Blind schedule<br/>[blinds.json]")]
  node_tournament_data["Tournament snapshot<br/>[tournament.json]"]
end

node_operator(("Tournament operator"))

node_operator -->|"uses"| node_web
node_web -->|"loads"| node_browser
node_browser -->|"requests API"| node_server
node_server -->|"serves interface"| node_browser
node_server -->|"mounts API"| node_player_routes
node_server -->|"mounts API"| node_tournament_routes
node_server -->|"mounts API"| node_prize_routes
node_server -->|"mounts API"| node_blinds_routes
node_player_routes -->|"dispatches"| node_player_controller
node_tournament_routes -->|"dispatches"| node_tournament_controller
node_player_controller -->|"reads and writes"| node_player_data
node_player_controller -->|"reads"| node_prize_data
node_tournament_controller -->|"reads"| node_blind_data
node_tournament_controller -->|"resets records"| node_player_data
node_prize_routes -->|"reads"| node_prize_data
node_blinds_routes -->|"reads"| node_blind_data
node_browser -.->|"unknown use"| node_tournament_data

click node_web "https://github.com/nadavsho11/poker_tournament_system/blob/main/public/index.html"
click node_browser "https://github.com/nadavsho11/poker_tournament_system/blob/main/public/script.js"
click node_server "https://github.com/nadavsho11/poker_tournament_system/blob/main/server/server.js"
click node_player_routes "https://github.com/nadavsho11/poker_tournament_system/blob/main/server/routes/player.js"
click node_tournament_routes "https://github.com/nadavsho11/poker_tournament_system/blob/main/server/routes/tournament.js"
click node_prize_routes "https://github.com/nadavsho11/poker_tournament_system/blob/main/server/routes/prize.js"
click node_blinds_routes "https://github.com/nadavsho11/poker_tournament_system/blob/main/server/routes/blinds.js"
click node_player_controller "https://github.com/nadavsho11/poker_tournament_system/blob/main/server/controllers/playerController.js"
click node_tournament_controller "https://github.com/nadavsho11/poker_tournament_system/blob/main/server/controllers/tournamentController.js"
click node_player_data "https://github.com/nadavsho11/poker_tournament_system/blob/main/server/data/players.json"
click node_prize_data "https://github.com/nadavsho11/poker_tournament_system/blob/main/server/data/prizes.json"
click node_blind_data "https://github.com/nadavsho11/poker_tournament_system/blob/main/server/data/blinds.json"
click node_tournament_data "https://github.com/nadavsho11/poker_tournament_system/blob/main/data/tournament.json"

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_web,node_browser toneBlue
class node_server,node_player_routes,node_tournament_routes,node_prize_routes,node_blinds_routes toneAmber
class node_player_controller,node_tournament_controller toneMint
class node_player_data,node_prize_data,node_blind_data,node_tournament_data toneRose
class node_operator toneIndigo
```

## Components

### Operator Interface

- [Web interface](https://github.com/nadavsho11/poker_tournament_system/blob/main/public/index.html): `public/index.html`
- [Browser logic](https://github.com/nadavsho11/poker_tournament_system/blob/main/public/script.js): `public/script.js`

### HTTP API

- [Express server](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/server.js): `server/server.js`
- [Player routes](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/routes/player.js): `server/routes/player.js`
- [Tournament routes](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/routes/tournament.js): `server/routes/tournament.js`
- [Prize route](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/routes/prize.js): `server/routes/prize.js`
- [Blind route](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/routes/blinds.js): `server/routes/blinds.js`

### Tournament Operations

- [Player operations](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/controllers/playerController.js): `server/controllers/playerController.js`
- [Tournament state and timer](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/controllers/tournamentController.js): `server/controllers/tournamentController.js`

### Tournament Records

- [Player records](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/data/players.json): `server/data/players.json`
- [Prize schedule](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/data/prizes.json): `server/data/prizes.json`
- [Blind schedule](https://github.com/nadavsho11/poker_tournament_system/blob/main/server/data/blinds.json): `server/data/blinds.json`
- [Tournament snapshot](https://github.com/nadavsho11/poker_tournament_system/blob/main/data/tournament.json): `data/tournament.json`

### Other components

- **Tournament operator**

## Connections

- Tournament operator → Web interface: uses
- Web interface → Browser logic: loads
- Browser logic → Express server: requests API
- Express server → Browser logic: serves interface
- Express server → Player routes: mounts API
- Express server → Tournament routes: mounts API
- Express server → Prize route: mounts API
- Express server → Blind route: mounts API
- Player routes → Player operations: dispatches
- Tournament routes → Tournament state and timer: dispatches
- Player operations → Player records: reads and writes
- Player operations → Prize schedule: reads
- Tournament state and timer → Blind schedule: reads
- Tournament state and timer → Player records: resets records
- Prize route → Prize schedule: reads
- Blind route → Blind schedule: reads
- Browser logic → Tournament snapshot: unknown use
