# echodot07/games architecture

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

- Interactive diagram: https://gitdiagram.com/echodot07/games
- Repository: https://github.com/echodot07/games

## Overview

Game Night Arcade is a browser-based multiplayer game site with Discord login, invite-code rooms, friends, chat, and eleven games. Players enter through the main menu, authenticate, create or join a room, and play through a host-authoritative browser game: the host runs the rules while the shared network client relays actions and game state through the server. The README documents the game and failover capabilities; sampled source shows server authentication, room and relay handling, plus shared lobby and friend-fetch behavior. Individual game implementations were not sampled, so their internal links are limited to documented relationships.

Main entry points: [`public/games`](https://github.com/echodot07/games/tree/main/public/games) (Host game rules), [`public/games/net.js`](https://github.com/echodot07/games/blob/main/public/games/net.js) (Room lobby), [`public/index.html`](https://github.com/echodot07/games/blob/main/public/index.html) (Login and menu), [`server.js`](https://github.com/echodot07/games/blob/main/server.js) (Login and sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and identity"]
  node_menu["Login and menu<br/>[index.html]"]
  node_auth["Login and sessions<br/>[server.js]"]
end

subgraph group_social["Social and rooms"]
  node_friends["Friends and presence<br/>[server.js]"]
  node_room_lobby["Room lobby<br/>[net.js]"]
  node_room_service["Rooms and codes<br/>[server.js]"]
  node_chat["Room chat<br/>[net.js]"]
  node_relay["WebSocket relay<br/>[server.js]"]
end

subgraph group_play["Game experience"]
  node_game_rules["Host game rules"]
  node_ludo["Ludo<br/>[ludo.html]"]
  node_minigolf["Minigolf<br/>[minigolf.html]"]
  node_blackjack["Blackjack<br/>[blackjack.html]"]
  node_holdem["Texas Hold'em<br/>[holdem.html]"]
  node_three_card["Three Card Poker<br/>[three-card.html]"]
  node_pool["8 Ball Pool<br/>[eight-ball.html]"]
  node_uno["Uno<br/>[uno.html]"]
  node_draw_guess["Draw and Guess<br/>[draw-guess.html]"]
  node_darts["Darts<br/>[darts.html]"]
  node_monopoly["World Monopoly"]
  node_block_baron["Block Baron<br/>[block-baron.html]"]
end

subgraph group_runtime["Shared runtime"]
  node_network["Online sync client<br/>[net.js]"]
  node_shared_helpers["Shared game helpers<br/>[common.js]"]
  node_dealer_art["Dealer visuals<br/>[dealer.js]"]
  node_dealer_3d["3D dealer<br/>[dealer3d.js]"]
  node_dice_3d["3D dice<br/>[dice3d.js]"]
  node_styles["Game styles<br/>[common.css]"]
end

node_players(("Players"))
node_discord["Discord OAuth"]

node_players -->|"open site"| node_menu
node_menu -->|"start login"| node_auth
node_auth -->|"authorize user"| node_discord
node_discord -->|"return profile"| node_auth
node_players -->|"choose game"| node_room_lobby
node_room_lobby -->|"fetch friends"| node_friends
node_room_lobby -->|"create or join"| node_room_service
node_room_service -.->|"manage connections"| node_relay
node_room_lobby -->|"offer chat"| node_chat
node_room_lobby -->|"sync room"| node_network
node_network -->|"exchange messages"| node_relay
node_relay -->|"deliver state"| node_network
node_network -->|"dispatch actions"| node_game_rules
node_game_rules -->|"publish state"| node_network
node_players -->|"play"| node_ludo
node_players -->|"play"| node_minigolf
node_players -->|"play"| node_blackjack
node_players -->|"play"| node_holdem
node_players -->|"play"| node_three_card
node_players -->|"play"| node_pool
node_players -->|"play"| node_uno
node_players -->|"play"| node_draw_guess
node_players -->|"play"| node_darts
node_players -->|"play"| node_monopoly
node_players -->|"play"| node_block_baron
node_game_rules -.->|"use helpers"| node_shared_helpers
node_game_rules -.->|"render dealer"| node_dealer_art
node_game_rules -.->|"render dealer"| node_dealer_3d
node_game_rules -.->|"render dice"| node_dice_3d
node_game_rules -.->|"use styles"| node_styles
node_menu -->|"serve game pages"| node_game_rules

click node_menu "https://github.com/echodot07/games/blob/main/public/index.html"
click node_auth "https://github.com/echodot07/games/blob/main/server.js"
click node_friends "https://github.com/echodot07/games/blob/main/server.js"
click node_room_lobby "https://github.com/echodot07/games/blob/main/public/games/net.js"
click node_room_service "https://github.com/echodot07/games/blob/main/server.js"
click node_chat "https://github.com/echodot07/games/blob/main/public/games/net.js"
click node_relay "https://github.com/echodot07/games/blob/main/server.js"
click node_network "https://github.com/echodot07/games/blob/main/public/games/net.js"
click node_game_rules "https://github.com/echodot07/games/tree/main/public/games"
click node_ludo "https://github.com/echodot07/games/blob/main/public/games/ludo.html"
click node_minigolf "https://github.com/echodot07/games/blob/main/public/games/minigolf.html"
click node_blackjack "https://github.com/echodot07/games/blob/main/public/games/blackjack.html"
click node_holdem "https://github.com/echodot07/games/blob/main/public/games/holdem.html"
click node_three_card "https://github.com/echodot07/games/blob/main/public/games/three-card.html"
click node_pool "https://github.com/echodot07/games/blob/main/public/games/eight-ball.html"
click node_uno "https://github.com/echodot07/games/blob/main/public/games/uno.html"
click node_draw_guess "https://github.com/echodot07/games/blob/main/public/games/draw-guess.html"
click node_darts "https://github.com/echodot07/games/blob/main/public/games/darts.html"
click node_monopoly "https://github.com/echodot07/games/blob/main/public/games/world-monopoly.html"
click node_block_baron "https://github.com/echodot07/games/blob/main/public/games/block-baron.html"
click node_shared_helpers "https://github.com/echodot07/games/blob/main/public/games/common.js"
click node_dealer_art "https://github.com/echodot07/games/blob/main/public/games/dealer.js"
click node_dealer_3d "https://github.com/echodot07/games/blob/main/public/games/dealer3d.js"
click node_dice_3d "https://github.com/echodot07/games/blob/main/public/games/dice3d.js"
click node_styles "https://github.com/echodot07/games/blob/main/public/games/common.css"

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_menu,node_auth toneBlue
class node_friends,node_room_lobby,node_room_service,node_chat,node_relay toneAmber
class node_game_rules,node_ludo,node_minigolf,node_blackjack,node_holdem,node_three_card,node_pool,node_uno,node_draw_guess,node_darts,node_monopoly,node_block_baron toneMint
class node_network,node_shared_helpers,node_dealer_art,node_dealer_3d,node_dice_3d,node_styles toneRose
class node_players,node_discord toneIndigo
```

## Components

### Entry and identity

- [Login and menu](https://github.com/echodot07/games/blob/main/public/index.html): `public/index.html`
- [Login and sessions](https://github.com/echodot07/games/blob/main/server.js): `server.js`

### Social and rooms

- [Friends and presence](https://github.com/echodot07/games/blob/main/server.js): `server.js`
- [Room lobby](https://github.com/echodot07/games/blob/main/public/games/net.js): `public/games/net.js`
- [Rooms and codes](https://github.com/echodot07/games/blob/main/server.js): `server.js`
- [Room chat](https://github.com/echodot07/games/blob/main/public/games/net.js): `public/games/net.js`
- [WebSocket relay](https://github.com/echodot07/games/blob/main/server.js): `server.js`

### Game experience

- [Host game rules](https://github.com/echodot07/games/tree/main/public/games): `public/games`
- [Ludo](https://github.com/echodot07/games/blob/main/public/games/ludo.html): `public/games/ludo.html`
- [Minigolf](https://github.com/echodot07/games/blob/main/public/games/minigolf.html): `public/games/minigolf.html`
- [Blackjack](https://github.com/echodot07/games/blob/main/public/games/blackjack.html): `public/games/blackjack.html`
- [Texas Hold'em](https://github.com/echodot07/games/blob/main/public/games/holdem.html): `public/games/holdem.html`
- [Three Card Poker](https://github.com/echodot07/games/blob/main/public/games/three-card.html): `public/games/three-card.html`
- [8 Ball Pool](https://github.com/echodot07/games/blob/main/public/games/eight-ball.html): `public/games/eight-ball.html`
- [Uno](https://github.com/echodot07/games/blob/main/public/games/uno.html): `public/games/uno.html`
- [Draw and Guess](https://github.com/echodot07/games/blob/main/public/games/draw-guess.html): `public/games/draw-guess.html`
- [Darts](https://github.com/echodot07/games/blob/main/public/games/darts.html): `public/games/darts.html`
- [World Monopoly](https://github.com/echodot07/games/blob/main/public/games/world-monopoly.html): `public/games/world-monopoly.html`
- [Block Baron](https://github.com/echodot07/games/blob/main/public/games/block-baron.html): `public/games/block-baron.html`

### Shared runtime

- [Online sync client](https://github.com/echodot07/games/blob/main/public/games/net.js): `public/games/net.js`
- [Shared game helpers](https://github.com/echodot07/games/blob/main/public/games/common.js): `public/games/common.js`
- [Dealer visuals](https://github.com/echodot07/games/blob/main/public/games/dealer.js): `public/games/dealer.js`
- [3D dealer](https://github.com/echodot07/games/blob/main/public/games/dealer3d.js): `public/games/dealer3d.js`
- [3D dice](https://github.com/echodot07/games/blob/main/public/games/dice3d.js): `public/games/dice3d.js`
- [Game styles](https://github.com/echodot07/games/blob/main/public/games/common.css): `public/games/common.css`

### Other components

- **Players**
- **Discord OAuth**

## Connections

- Players → Login and menu: open site (evidence: `README.md`)
- Login and menu → Login and sessions: start login (evidence: `README.md`)
- Login and sessions → Discord OAuth: authorize user (evidence: `server.js`)
- Discord OAuth → Login and sessions: return profile (evidence: `server.js`)
- Players → Room lobby: choose game (evidence: `README.md`)
- Room lobby → Friends and presence: fetch friends (evidence: `public/games/net.js`)
- Room lobby → Rooms and codes: create or join (evidence: `README.md`)
- Rooms and codes → WebSocket relay: manage connections (evidence: `server.js`)
- Room lobby → Room chat: offer chat (evidence: `public/games/net.js`)
- Room lobby → Online sync client: sync room (evidence: `README.md`)
- Online sync client → WebSocket relay: exchange messages (evidence: `README.md`)
- WebSocket relay → Online sync client: deliver state (evidence: `README.md`)
- Online sync client → Host game rules: dispatch actions (evidence: `README.md`)
- Host game rules → Online sync client: publish state (evidence: `README.md`)
- Players → Ludo: play (evidence: `README.md`)
- Players → Minigolf: play (evidence: `README.md`)
- Players → Blackjack: play (evidence: `README.md`)
- Players → Texas Hold'em: play (evidence: `README.md`)
- Players → Three Card Poker: play (evidence: `README.md`)
- Players → 8 Ball Pool: play (evidence: `README.md`)
- Players → Uno: play (evidence: `README.md`)
- Players → Draw and Guess: play (evidence: `README.md`)
- Players → Darts: play (evidence: `README.md`)
- Players → World Monopoly: play (evidence: `README.md`)
- Players → Block Baron: play (evidence: `README.md`)
- Host game rules → Shared game helpers: use helpers
- Host game rules → Dealer visuals: render dealer
- Host game rules → 3D dealer: render dealer
- Host game rules → 3D dice: render dice
- Host game rules → Game styles: use styles
- Login and menu → Host game rules: serve game pages
