# naisarg-25/lier-s-card architecture

> Architecture diagram of the GitHub repository naisarg-25/lier-s-card, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/naisarg-25/lier-s-card
- Repository: https://github.com/naisarg-25/lier-s-card

## Overview

Liar’s Cards is a browser-based multiplayer bluffing card game. Players create or join a friends, random-matchmaking, or AI room, wait in its lobby, then play a server-managed card game. The sampled code shows the homepage initiating room actions, lobby updates and game-start navigation, and the server managing room sessions and game state. The game client’s detailed action wiring is only partially excerpted, so that link is marked unverified. The repository also includes game guidance pages, ads, analytics, and a health-check keep-alive.

Main entry points: [`server.js`](https://github.com/naisarg-25/lier-s-card/blob/main/server.js) (Room Sessions), [`public/js/lobby.js`](https://github.com/naisarg-25/lier-s-card/blob/main/public/js/lobby.js) (Lobby Client), [`public/js/game.js`](https://github.com/naisarg-25/lier-s-card/blob/main/public/js/game.js) (Game Client), [`public/js/main.js`](https://github.com/naisarg-25/lier-s-card/blob/main/public/js/main.js) (Home Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and Rooms"]
  node_home["Home Page<br/>[index.html]"]
  node_home_client["Home Actions<br/>[main.js]"]
  node_lobby_page["Lobby Page<br/>[lobby.html]"]
  node_lobby_client["Lobby Client<br/>[lobby.js]"]
  node_room_server["Room Sessions<br/>[server.js]"]
  node_room_store[("Room State<br/>[server.js]")]
end

subgraph group_play["Game Runtime"]
  node_game_page["Game Page<br/>[game.html]"]
  node_game_client["Game Client<br/>[game.js]"]
  node_game_rules["Game Rules<br/>[server.js]"]
end

subgraph group_content["Game Guidance"]
  node_howto["How to Play<br/>[how-to-play.html]"]
  node_friends_guide["Friends Guide"]
  node_strategy["Bluffing Strategy"]
end

subgraph group_services["Site Services"]
  node_ads["Ad Loader<br/>[ads.js]"]
  node_analytics["Analytics<br/>[analytics.js]"]
  node_keepalive["Health Pinger<br/>[keep-alive.js]"]
end

node_player(("Player"))
node_ad_network["Ad Network"]
node_analytics_platform["Analytics Platform"]

node_player -->|"opens"| node_home
node_home_client -->|"requests rooms"| node_room_server
node_room_server -->|"updates sessions"| node_room_store
node_lobby_client -->|"manages lobby"| node_room_server
node_room_server -->|"sends updates"| node_lobby_client
node_room_server -->|"starts game"| node_game_page
node_game_client -.->|"sends game actions"| node_room_server
node_room_server -->|"sends game state"| node_game_client
node_room_server -->|"dispatches turns"| node_game_rules
node_keepalive -->|"checks health"| node_room_server
node_ads -->|"loads ads"| node_ad_network
node_analytics -->|"sends events"| node_analytics_platform
node_room_server -->|"serves page"| node_howto
node_room_server -->|"serves page"| node_friends_guide
node_room_server -->|"serves page"| node_strategy

click node_home "https://github.com/naisarg-25/lier-s-card/blob/main/public/index.html"
click node_home_client "https://github.com/naisarg-25/lier-s-card/blob/main/public/js/main.js"
click node_lobby_page "https://github.com/naisarg-25/lier-s-card/blob/main/public/lobby.html"
click node_lobby_client "https://github.com/naisarg-25/lier-s-card/blob/main/public/js/lobby.js"
click node_room_server "https://github.com/naisarg-25/lier-s-card/blob/main/server.js"
click node_room_store "https://github.com/naisarg-25/lier-s-card/blob/main/server.js"
click node_game_page "https://github.com/naisarg-25/lier-s-card/blob/main/public/game.html"
click node_game_client "https://github.com/naisarg-25/lier-s-card/blob/main/public/js/game.js"
click node_game_rules "https://github.com/naisarg-25/lier-s-card/blob/main/server.js"
click node_howto "https://github.com/naisarg-25/lier-s-card/blob/main/public/how-to-play.html"
click node_friends_guide "https://github.com/naisarg-25/lier-s-card/blob/main/public/play-with-friends.html"
click node_strategy "https://github.com/naisarg-25/lier-s-card/blob/main/public/bluffing-strategy.html"
click node_ads "https://github.com/naisarg-25/lier-s-card/blob/main/public/js/ads.js"
click node_analytics "https://github.com/naisarg-25/lier-s-card/blob/main/public/js/analytics.js"
click node_keepalive "https://github.com/naisarg-25/lier-s-card/blob/main/public/js/keep-alive.js"

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_home,node_home_client,node_lobby_page,node_lobby_client,node_room_server,node_room_store toneBlue
class node_game_page,node_game_client,node_game_rules toneAmber
class node_howto,node_friends_guide,node_strategy toneMint
class node_ads,node_analytics,node_keepalive toneRose
class node_player,node_ad_network,node_analytics_platform toneIndigo
```

## Components

### Entry and Rooms

- [Home Page](https://github.com/naisarg-25/lier-s-card/blob/main/public/index.html): `public/index.html`
- [Home Actions](https://github.com/naisarg-25/lier-s-card/blob/main/public/js/main.js): `public/js/main.js`
- [Lobby Page](https://github.com/naisarg-25/lier-s-card/blob/main/public/lobby.html): `public/lobby.html`
- [Lobby Client](https://github.com/naisarg-25/lier-s-card/blob/main/public/js/lobby.js): `public/js/lobby.js`
- [Room Sessions](https://github.com/naisarg-25/lier-s-card/blob/main/server.js): `server.js`
- [Room State](https://github.com/naisarg-25/lier-s-card/blob/main/server.js): `server.js`

### Game Runtime

- [Game Page](https://github.com/naisarg-25/lier-s-card/blob/main/public/game.html): `public/game.html`
- [Game Client](https://github.com/naisarg-25/lier-s-card/blob/main/public/js/game.js): `public/js/game.js`
- [Game Rules](https://github.com/naisarg-25/lier-s-card/blob/main/server.js): `server.js`

### Game Guidance

- [How to Play](https://github.com/naisarg-25/lier-s-card/blob/main/public/how-to-play.html): `public/how-to-play.html`
- [Friends Guide](https://github.com/naisarg-25/lier-s-card/blob/main/public/play-with-friends.html): `public/play-with-friends.html`
- [Bluffing Strategy](https://github.com/naisarg-25/lier-s-card/blob/main/public/bluffing-strategy.html): `public/bluffing-strategy.html`

### Site Services

- [Ad Loader](https://github.com/naisarg-25/lier-s-card/blob/main/public/js/ads.js): `public/js/ads.js`
- [Analytics](https://github.com/naisarg-25/lier-s-card/blob/main/public/js/analytics.js): `public/js/analytics.js`
- [Health Pinger](https://github.com/naisarg-25/lier-s-card/blob/main/public/js/keep-alive.js): `public/js/keep-alive.js`

### Other components

- **Player**
- **Ad Network**
- **Analytics Platform**

## Connections

- Player → Home Page: opens
- Home Actions → Room Sessions: requests rooms (evidence: `public/js/main.js`)
- Room Sessions → Room State: updates sessions (evidence: `server.js`)
- Lobby Client → Room Sessions: manages lobby (evidence: `public/js/lobby.js`)
- Room Sessions → Lobby Client: sends updates (evidence: `server.js`)
- Room Sessions → Game Page: starts game
- Game Client → Room Sessions: sends game actions
- Room Sessions → Game Client: sends game state (evidence: `server.js`)
- Room Sessions → Game Rules: dispatches turns (evidence: `server.js`)
- Health Pinger → Room Sessions: checks health (evidence: `public/js/keep-alive.js`)
- Ad Loader → Ad Network: loads ads (evidence: `public/js/ads.js`)
- Analytics → Analytics Platform: sends events (evidence: `public/js/analytics.js`)
- Room Sessions → How to Play: serves page (evidence: `server.js`)
- Room Sessions → Friends Guide: serves page (evidence: `server.js`)
- Room Sessions → Bluffing Strategy: serves page (evidence: `server.js`)
