# njabulorivaldo/tic-tac-toe-oxo-game architecture

> Architecture diagram of the GitHub repository njabulorivaldo/tic-tac-toe-oxo-game, 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/njabulorivaldo/tic-tac-toe-oxo-game
- Repository: https://github.com/njabulorivaldo/tic-tac-toe-oxo-game

## Overview

This is a localhost, two-player networked tic-tac-toe game with both PyQt and terminal clients. Players connect to a server, exchange moves and replay choices, and receive game results. The OXO server owns turn-taking and game rules, using the shared server layer for socket communication; clients use the shared client layer. The README documents localhost play, while the sampled source establishes the protocol and client variants. The GUI excerpt is partial, so uncertain details of its board-update wiring are omitted.

Main entry points: [`GUI_Files/GameClient.py`](https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/GameClient.py) (Client transport), [`GUI_Files/GameServer.py`](https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/GameServer.py) (Server transport), [`GUI_Files/OXOGuiClient.py`](https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/OXOGuiClient.py) (GUI client), [`GUI_Files/OXOTextClient.py`](https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/OXOTextClient.py) (Text client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Player clients"]
  node_gui["GUI client<br/>[OXOGuiClient.py]"]
  node_terminal["Text client<br/>[OXOTextClient.py]"]
end

subgraph group_network["Socket communication"]
  node_client_transport["Client transport<br/>[GameClient.py]"]
  node_settings["Game settings<br/>[GameIni.py]"]
end

subgraph group_server["Game server"]
  node_oxo_server["OXO game loop<br/>[OXOGameServer.py]"]
  node_server_transport["Server transport<br/>[GameServer.py]"]
end

node_players(("Players"))
node_tcp["TCP sockets"]

node_players -->|"play via"| node_gui
node_players -->|"play via"| node_terminal
node_gui -->|"connects and exchanges"| node_client_transport
node_terminal -->|"connects and exchanges"| node_client_transport
node_client_transport -->|"opens socket"| node_tcp
node_server_transport -->|"binds and listens"| node_tcp
node_oxo_server -->|"accepts, sends, receives"| node_server_transport
node_client_transport -->|"reads constants"| node_settings
node_server_transport -->|"reads constants"| node_settings
node_tcp -->|"delivers client messages"| node_oxo_server

click node_gui "https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/OXOGuiClient.py"
click node_terminal "https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/OXOTextClient.py"
click node_client_transport "https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/GameClient.py"
click node_settings "https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/GameIni.py"
click node_oxo_server "https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/OXOGameServer.py"
click node_server_transport "https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/GameServer.py"

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_gui,node_terminal toneBlue
class node_client_transport,node_settings toneAmber
class node_oxo_server,node_server_transport toneMint
class node_players,node_tcp toneIndigo
```

## Components

### Player clients

- [GUI client](https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/OXOGuiClient.py): `GUI_Files/OXOGuiClient.py`
- [Text client](https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/OXOTextClient.py): `GUI_Files/OXOTextClient.py`

### Socket communication

- [Client transport](https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/GameClient.py): `GUI_Files/GameClient.py`
- [Game settings](https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/GameIni.py): `GUI_Files/GameIni.py`

### Game server

- [OXO game loop](https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/OXOGameServer.py): `GUI_Files/OXOGameServer.py`
- [Server transport](https://github.com/njabulorivaldo/tic-tac-toe-oxo-game/blob/main/GUI_Files/GameServer.py): `GUI_Files/GameServer.py`

### Other components

- **Players**
- **TCP sockets**

## Connections

- Players → GUI client: play via
- Players → Text client: play via
- GUI client → Client transport: connects and exchanges
- Text client → Client transport: connects and exchanges
- Client transport → TCP sockets: opens socket
- Server transport → TCP sockets: binds and listens
- OXO game loop → Server transport: accepts, sends, receives
- Client transport → Game settings: reads constants
- Server transport → Game settings: reads constants
- TCP sockets → OXO game loop: delivers client messages
