# forcequit712/standard-game architecture

> Architecture diagram of the GitHub repository forcequit712/standard-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/forcequit712/standard-game
- Repository: https://github.com/forcequit712/standard-game

## Overview

This repository is a small collection of browser-based games and game pages, rather than a single application; the README does not describe their capabilities. The clearest end-to-end workflow in the sampled source is online chess: a player hosts or joins a game, the client polls for its start and moves, and PHP endpoints exchange move data through game files. The tree also identifies standalone chess, GN Math, Tetris, and other pages, but their behavior and wiring were not sampled, so those are represented only as separate product surfaces.

Main entry points: [`chess/js/game.js`](https://github.com/forcequit712/standard-game/blob/main/chess/js/game.js) (Chess game client), [`chess/php/hostGame.php`](https://github.com/forcequit712/standard-game/blob/main/chess/php/hostGame.php) (Host game), [`chess/php/joinGame.php`](https://github.com/forcequit712/standard-game/blob/main/chess/php/joinGame.php) (Join game), [`chess/php/waitForStart.php`](https://github.com/forcequit712/standard-game/blob/main/chess/php/waitForStart.php) (Wait for start)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chess["Chess"]
  node_chess_page["Chess page<br/>[index.html]"]
  node_chess_client["Chess game client<br/>[game.js]"]
  node_host["Host game<br/>[hostGame.php]"]
  node_join["Join game<br/>[joinGame.php]"]
  node_start_poll["Wait for start<br/>[waitForStart.php]"]
  node_move_poll["Wait for move<br/>[waitForMove.php]"]
  node_save_move["Record move<br/>[makeMove.php]"]
  node_game_files[("Game files")]
end

subgraph group_other_games["Other game pages"]
  node_gn_math["GN Math game<br/>[gn.html]"]
  node_gn_build_page["GN Math build page<br/>[index.html]"]
  node_tetris["Tetris page<br/>[tetris.html]"]
  node_music["Music page<br/>[mus7.html]"]
  node_version_page["Version page<br/>[1.5.2.html]"]
  node_source_view_page["Source-view page"]
end

node_player(("Player"))

node_player -->|"opens"| node_chess_page
node_player -->|"plays"| node_chess_client
node_chess_client -->|"hosts"| node_host
node_chess_client -->|"joins"| node_join
node_chess_client -->|"polls start"| node_start_poll
node_chess_client -->|"polls moves"| node_move_poll
node_chess_client -->|"sends move"| node_save_move
node_host -->|"creates"| node_game_files
node_join -->|"marks joined"| node_game_files
node_start_poll -->|"reads"| node_game_files
node_move_poll -->|"reads"| node_game_files
node_save_move -->|"writes"| node_game_files

click node_chess_page "https://github.com/forcequit712/standard-game/blob/main/chess/index.html"
click node_chess_client "https://github.com/forcequit712/standard-game/blob/main/chess/js/game.js"
click node_host "https://github.com/forcequit712/standard-game/blob/main/chess/php/hostGame.php"
click node_join "https://github.com/forcequit712/standard-game/blob/main/chess/php/joinGame.php"
click node_start_poll "https://github.com/forcequit712/standard-game/blob/main/chess/php/waitForStart.php"
click node_move_poll "https://github.com/forcequit712/standard-game/blob/main/chess/php/waitForMove.php"
click node_save_move "https://github.com/forcequit712/standard-game/blob/main/chess/php/makeMove.php"
click node_gn_math "https://github.com/forcequit712/standard-game/blob/main/gn-math/gn.html"
click node_gn_build_page "https://github.com/forcequit712/standard-game/blob/main/gn-math/260/index.html"
click node_tetris "https://github.com/forcequit712/standard-game/blob/main/tetris.html"
click node_music "https://github.com/forcequit712/standard-game/blob/main/mus7.html"
click node_version_page "https://github.com/forcequit712/standard-game/blob/main/1.5.2.html"
click node_source_view_page "https://github.com/forcequit712/standard-game/blob/main/view-page-source.com-medv.io_bit-planes_.html"

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_chess_page,node_chess_client,node_host,node_join,node_start_poll,node_move_poll,node_save_move,node_game_files toneBlue
class node_gn_math,node_gn_build_page,node_tetris,node_music,node_version_page,node_source_view_page toneAmber
class node_player toneIndigo
```

## Components

### Chess

- [Chess page](https://github.com/forcequit712/standard-game/blob/main/chess/index.html): `chess/index.html`
- [Chess game client](https://github.com/forcequit712/standard-game/blob/main/chess/js/game.js): `chess/js/game.js`
- [Host game](https://github.com/forcequit712/standard-game/blob/main/chess/php/hostGame.php): `chess/php/hostGame.php`
- [Join game](https://github.com/forcequit712/standard-game/blob/main/chess/php/joinGame.php): `chess/php/joinGame.php`
- [Wait for start](https://github.com/forcequit712/standard-game/blob/main/chess/php/waitForStart.php): `chess/php/waitForStart.php`
- [Wait for move](https://github.com/forcequit712/standard-game/blob/main/chess/php/waitForMove.php): `chess/php/waitForMove.php`
- [Record move](https://github.com/forcequit712/standard-game/blob/main/chess/php/makeMove.php): `chess/php/makeMove.php`
- **Game files**

### Other game pages

- [GN Math game](https://github.com/forcequit712/standard-game/blob/main/gn-math/gn.html): `gn-math/gn.html`
- [GN Math build page](https://github.com/forcequit712/standard-game/blob/main/gn-math/260/index.html): `gn-math/260/index.html`
- [Tetris page](https://github.com/forcequit712/standard-game/blob/main/tetris.html): `tetris.html`
- [Music page](https://github.com/forcequit712/standard-game/blob/main/mus7.html): `mus7.html`
- [Version page](https://github.com/forcequit712/standard-game/blob/main/1.5.2.html): `1.5.2.html`
- [Source-view page](https://github.com/forcequit712/standard-game/blob/main/view-page-source.com-medv.io_bit-planes_.html): `view-page-source.com-medv.io_bit-planes_.html`

### Other components

- **Player**

## Connections

- Player → Chess page: opens
- Player → Chess game client: plays
- Chess game client → Host game: hosts
- Chess game client → Join game: joins
- Chess game client → Wait for start: polls start
- Chess game client → Wait for move: polls moves
- Chess game client → Record move: sends move
- Host game → Game files: creates
- Join game → Game files: marks joined
- Wait for start → Game files: reads
- Wait for move → Game files: reads
- Record move → Game files: writes
