# somunaexe/pseudodemocracy architecture

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

- Interactive diagram: https://gitdiagram.com/somunaexe/pseudodemocracy
- Repository: https://github.com/somunaexe/pseudodemocracy

## Overview

Pseudodemocracy is a multiplayer political-satire game, with a Godot client, game rules, and a WebSocket-backed server. The likely player workflow is to connect, enter a lobby, play turns at the table, and reach a game result; the tree also shows exam and law-amendment stages. The README provides no capability details, and most runtime source was not sampled, so links among these components are shown as unverified rather than asserted calls. The central game, client, server, and content branches are represented without mapping tests or deployment tooling.

Main entry points: [`scripts/game.gd`](https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/game.gd) (Game Coordinator), [`client/table_screen.gd`](https://github.com/somunaexe/pseudodemocracy/blob/main/client/table_screen.gd) (Table Screen), [`client/session_model.gd`](https://github.com/somunaexe/pseudodemocracy/blob/main/client/session_model.gd) (Game Sessions), [`client/lobby_screen.gd`](https://github.com/somunaexe/pseudodemocracy/blob/main/client/lobby_screen.gd) (Lobby Screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Player Client"]
  node_lobby["Lobby Screen<br/>[lobby_screen.gd]"]
  node_connection["Connection<br/>[connection.gd]"]
  node_table["Table Screen<br/>[table_screen.gd]"]
  node_exam_ui["Exam Screen<br/>[exam_screen.gd]"]
  node_client_models["Client Models<br/>[session_model.gd]"]
end

subgraph group_engine["Game Engine"]
  node_game["Game Coordinator<br/>[game.gd]"]
  node_state["Game State<br/>[game_state.gd]"]
  node_turns["Turn Flow"]
  node_law["Law Amendment<br/>[amendment_flow.gd]"]
  node_cards["Card Effects<br/>[card_effects.gd]"]
  node_scoring["Scoring<br/>[scoring.gd]"]
  node_views["Game Views<br/>[views.gd]"]
end

subgraph group_content["Game Content"]
  node_articles_source["Article Source<br/>[articles.js]"]
  node_cards_source["Card Source<br/>[cards.js]"]
  node_exam_source["Exam Questions<br/>[exam_questions.js]"]
  node_game_data_source["Rules Data<br/>[game_data.js]"]
end

subgraph group_server["Session Server"]
  node_disk_store[("Disk Store<br/>[disk_store.gd]")]
  node_memory_store[("Memory Store<br/>[memory_store.gd]")]
  node_server_core["Server Core<br/>[server_core.gd]"]
  node_websocket["WebSocket Server<br/>[ws_server.gd]"]
  node_sessions["Game Sessions<br/>[session_model.gd]"]
end

node_player(("Player"))

node_player -.->|"enters lobby"| node_lobby
node_lobby -.->|"connects through"| node_connection
node_connection -.->|"communicates with"| node_websocket
node_websocket -.->|"dispatches to"| node_server_core
node_server_core -.->|"manages"| node_sessions
node_sessions -.->|"may store in"| node_memory_store
node_sessions -.->|"may persist to"| node_disk_store
node_player -.->|"plays at"| node_table
node_table -.->|"sends actions to"| node_game
node_game -.->|"updates"| node_state
node_game -.->|"advances"| node_turns
node_game -.->|"handles amendments via"| node_law
node_game -.->|"applies"| node_cards
node_game -.->|"calculates results with"| node_scoring
node_table -.->|"displays"| node_views
node_player -.->|"takes exam at"| node_exam_ui
node_exam_ui -.->|"uses questions from"| node_exam_source
node_game -.->|"uses article content from"| node_articles_source
node_game -.->|"uses card content from"| node_cards_source
node_cards_source -->|"imports rules values from"| node_game_data_source

click node_lobby "https://github.com/somunaexe/pseudodemocracy/blob/main/client/lobby_screen.gd"
click node_connection "https://github.com/somunaexe/pseudodemocracy/blob/main/client/connection.gd"
click node_table "https://github.com/somunaexe/pseudodemocracy/blob/main/client/table_screen.gd"
click node_exam_ui "https://github.com/somunaexe/pseudodemocracy/blob/main/client/exam_screen.gd"
click node_client_models "https://github.com/somunaexe/pseudodemocracy/blob/main/client/session_model.gd"
click node_game "https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/game.gd"
click node_state "https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/game_state.gd"
click node_law "https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/amendment_flow.gd"
click node_cards "https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/card_effects.gd"
click node_scoring "https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/scoring.gd"
click node_views "https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/views.gd"
click node_articles_source "https://github.com/somunaexe/pseudodemocracy/blob/main/data/source/articles.js"
click node_cards_source "https://github.com/somunaexe/pseudodemocracy/blob/main/data/source/cards.js"
click node_exam_source "https://github.com/somunaexe/pseudodemocracy/blob/main/data/source/exam_questions.js"
click node_game_data_source "https://github.com/somunaexe/pseudodemocracy/blob/main/data/source/game_data.js"
click node_disk_store "https://github.com/somunaexe/pseudodemocracy/blob/main/server/disk_store.gd"
click node_memory_store "https://github.com/somunaexe/pseudodemocracy/blob/main/server/memory_store.gd"
click node_server_core "https://github.com/somunaexe/pseudodemocracy/blob/main/server/server_core.gd"
click node_websocket "https://github.com/somunaexe/pseudodemocracy/blob/main/server/ws_server.gd"
click node_sessions "https://github.com/somunaexe/pseudodemocracy/blob/main/client/session_model.gd"

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_lobby,node_connection,node_table,node_exam_ui,node_client_models toneBlue
class node_game,node_state,node_turns,node_law,node_cards,node_scoring,node_views toneAmber
class node_articles_source,node_cards_source,node_exam_source,node_game_data_source toneMint
class node_disk_store,node_memory_store,node_server_core,node_websocket,node_sessions toneRose
class node_player toneIndigo
```

## Components

### Player Client

- [Lobby Screen](https://github.com/somunaexe/pseudodemocracy/blob/main/client/lobby_screen.gd): `client/lobby_screen.gd`
- [Connection](https://github.com/somunaexe/pseudodemocracy/blob/main/client/connection.gd): `client/connection.gd`
- [Table Screen](https://github.com/somunaexe/pseudodemocracy/blob/main/client/table_screen.gd): `client/table_screen.gd`
- [Exam Screen](https://github.com/somunaexe/pseudodemocracy/blob/main/client/exam_screen.gd): `client/exam_screen.gd`
- [Client Models](https://github.com/somunaexe/pseudodemocracy/blob/main/client/session_model.gd): `client/session_model.gd`

### Game Engine

- [Game Coordinator](https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/game.gd): `scripts/game.gd`
- [Game State](https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/game_state.gd): `scripts/game_state.gd`
- **Turn Flow**
- [Law Amendment](https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/amendment_flow.gd): `scripts/amendment_flow.gd`
- [Card Effects](https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/card_effects.gd): `scripts/card_effects.gd`
- [Scoring](https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/scoring.gd): `scripts/scoring.gd`
- [Game Views](https://github.com/somunaexe/pseudodemocracy/blob/main/scripts/views.gd): `scripts/views.gd`

### Game Content

- [Article Source](https://github.com/somunaexe/pseudodemocracy/blob/main/data/source/articles.js): `data/source/articles.js`
- [Card Source](https://github.com/somunaexe/pseudodemocracy/blob/main/data/source/cards.js): `data/source/cards.js`
- [Exam Questions](https://github.com/somunaexe/pseudodemocracy/blob/main/data/source/exam_questions.js): `data/source/exam_questions.js`
- [Rules Data](https://github.com/somunaexe/pseudodemocracy/blob/main/data/source/game_data.js): `data/source/game_data.js`

### Session Server

- [Disk Store](https://github.com/somunaexe/pseudodemocracy/blob/main/server/disk_store.gd): `server/disk_store.gd`
- [Memory Store](https://github.com/somunaexe/pseudodemocracy/blob/main/server/memory_store.gd): `server/memory_store.gd`
- [Server Core](https://github.com/somunaexe/pseudodemocracy/blob/main/server/server_core.gd): `server/server_core.gd`
- [WebSocket Server](https://github.com/somunaexe/pseudodemocracy/blob/main/server/ws_server.gd): `server/ws_server.gd`
- [Game Sessions](https://github.com/somunaexe/pseudodemocracy/blob/main/client/session_model.gd): `client/session_model.gd`

### Other components

- **Player**

## Connections

- Player → Lobby Screen: enters lobby
- Lobby Screen → Connection: connects through
- Connection → WebSocket Server: communicates with
- WebSocket Server → Server Core: dispatches to
- Server Core → Game Sessions: manages
- Game Sessions → Memory Store: may store in
- Game Sessions → Disk Store: may persist to
- Player → Table Screen: plays at
- Table Screen → Game Coordinator: sends actions to
- Game Coordinator → Game State: updates
- Game Coordinator → Turn Flow: advances
- Game Coordinator → Law Amendment: handles amendments via
- Game Coordinator → Card Effects: applies
- Game Coordinator → Scoring: calculates results with
- Table Screen → Game Views: displays
- Player → Exam Screen: takes exam at
- Exam Screen → Exam Questions: uses questions from
- Game Coordinator → Article Source: uses article content from
- Game Coordinator → Card Source: uses card content from
- Card Source → Rules Data: imports rules values from (evidence: `data/source/cards.js`)
