# nowath/text-or-death architecture

> Architecture diagram of the GitHub repository nowath/text-or-death, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nowath/text-or-death
- Repository: https://github.com/nowath/text-or-death

## Overview

##### Project type and purpose
- This is a small networked Python game (“Text or death”) with a clear client-server separation.
- The client hosts the UI and game-loop logic; the server holds game rules, persistent state (in database.json), and orchestrates multiplayer or stateful interactions.

##### File structure
- Top-level folders:
- assets/       ← all art, sprites, font files
- client/       ← entry point for the player’s game client
- server/       ← game server logic
- ui/           ← user-interface components (buttons, screens, character widgets)
- utils/        ← shared utilities (word checking, spritesheet loading)
- Config:
- config.json   ← game or network settings
- database.json ← simple file-based persistence
- requirements.txt declares Python dependencies.

##### README
- Only project title “Text or death” is present; rely on file structure for architectural intent.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Player
    Player["Player (Input Devices)"]:::external

    subgraph "Client Application"
        direction TB
        subgraph "UI Layer"
            direction TB
            GameUI["game_ui.py"]:::client
            Button["button.py"]:::client
            Character["character.py"]:::client
            MainPage["main_page.py"]:::client
            Splash["splash_screen.py"]:::client
        end
        ClientCore["Client Core\nmain.py"]:::client
        subgraph "Utilities"
            direction TB
            CheckWord["checkword.py"]:::client
            SpriteSheet["spritesheet.py"]:::client
        end
        Assets["Assets\n(assets/)"]:::client
    end

    Network["Network\n(JSON over TCP)"]:::external

    subgraph "Server Application"
        direction TB
        ServerCore["Server Core\nserver.py"]:::server
        Persistence["Persistence\n(database.json)"]:::external
        Config["Configuration\n(config.json)"]:::external
    end

    %% Connections
    Player -->|"User Input"| GameUI
    GameUI -->|"UI Events"| ClientCore
    ClientCore -->|"calls"| CheckWord
    ClientCore -->|"loads"| SpriteSheet
    ClientCore -->|"renders from"| Assets
    ClientCore -->|"sends GameAction"| Network
    Network -->|"receives JSON"| ServerCore
    ServerCore -->|"reads/writes"| Persistence
    ServerCore -->|"reads"| Config
    ServerCore -->|"sends StateUpdate"| Network
    Network -->|"receives JSON"| ClientCore

    %% Click Events
    click ClientCore "https://github.com/nowath/text-or-death/blob/main/client/main.py"
    click GameUI "https://github.com/nowath/text-or-death/blob/main/ui/game_ui.py"
    click Button "https://github.com/nowath/text-or-death/blob/main/ui/button.py"
    click Character "https://github.com/nowath/text-or-death/blob/main/ui/character.py"
    click MainPage "https://github.com/nowath/text-or-death/blob/main/ui/main_page.py"
    click Splash "https://github.com/nowath/text-or-death/blob/main/ui/splash_screen.py"
    click CheckWord "https://github.com/nowath/text-or-death/blob/main/utils/checkword.py"
    click SpriteSheet "https://github.com/nowath/text-or-death/blob/main/utils/spritesheet.py"
    click Assets "https://github.com/nowath/text-or-death/tree/main/assets/"
    click ServerCore "https://github.com/nowath/text-or-death/blob/main/server/server.py"
    click Persistence "https://github.com/nowath/text-or-death/blob/main/database.json"
    click Config "https://github.com/nowath/text-or-death/blob/main/config.json"

    %% Styles
    classDef client fill:#cce5ff,stroke:#004085,color:#004085;
    classDef server fill:#d4edda,stroke:#155724,color:#155724;
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
```
