# kiran-mondal/pachisi architecture

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

- Interactive diagram: https://gitdiagram.com/kiran-mondal/pachisi
- Repository: https://github.com/kiran-mondal/pachisi

## Overview

Pachisi is a browser-based Pachisi/Chaupar game with player setup, local or bot play, and a dice-driven board experience. The documented user flow is to open the site, configure a game, start it, roll, and progress tokens toward victory. The excerpts show the UI start handler initializing a 3D board, and the game client requesting rolls from a Ruby API. README-documented gameplay capabilities are retained, but their implementation details are not verified in the sampled code.

Main entry points: [`script.js`](https://github.com/kiran-mondal/pachisi/blob/main/script.js) (Setup and UI), [`game/game.js`](https://github.com/kiran-mondal/pachisi/blob/main/game/game.js) (Token Movement), [`index.html`](https://github.com/kiran-mondal/pachisi/blob/main/index.html) (Game Site), [`backend/app.rb`](https://github.com/kiran-mondal/pachisi/blob/main/backend/app.rb) (Dice Roll API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Experience"]
  node_site["Game Site<br/>[index.html]"]
  node_ui["Setup and UI<br/>[script.js]"]
  node_projects["Projects Page<br/>[index.html]"]
end

subgraph group_game["Game Play"]
  node_board["3D Board<br/>[game.js]"]
  node_game_modes["Game Modes<br/>[game.js]"]
  node_player_setup["Player Setup<br/>[game.js]"]
  node_tokens["Token Movement<br/>[game.js]"]
  node_turns["Turns and Captures<br/>[game.js]"]
  node_winning["Win Condition<br/>[game.js]"]
  node_roll_client["Roll Client<br/>[game.js]"]
end

subgraph group_services["Game Services"]
  node_roll_api["Dice Roll API<br/>[app.rb]"]
end

subgraph group_extras["Project Extras"]
  node_penpot_handler["Penpot Handler<br/>[penpot.js]"]
end

node_player(("Player"))
node_penpot["Penpot"]

node_player -->|"opens"| node_site
node_site -.->|"presents"| node_ui
node_ui -->|"initializes"| node_board
node_player -->|"configures"| node_player_setup
node_player_setup -->|"selects"| node_game_modes
node_game_modes -->|"governs movement"| node_tokens
node_player -->|"requests roll"| node_roll_client
node_roll_client -->|"fetches roll"| node_roll_api
node_roll_api -->|"returns dice"| node_roll_client
node_turns -->|"captures tokens"| node_tokens
node_tokens -->|"progresses toward"| node_winning
node_ui -->|"navigates to"| node_projects
node_penpot_handler -->|"fetches file"| node_penpot

click node_site "https://github.com/kiran-mondal/pachisi/blob/main/index.html"
click node_ui "https://github.com/kiran-mondal/pachisi/blob/main/script.js"
click node_projects "https://github.com/kiran-mondal/pachisi/blob/main/projects/index.html"
click node_board "https://github.com/kiran-mondal/pachisi/blob/main/game/game.js"
click node_game_modes "https://github.com/kiran-mondal/pachisi/blob/main/game/game.js"
click node_player_setup "https://github.com/kiran-mondal/pachisi/blob/main/game/game.js"
click node_tokens "https://github.com/kiran-mondal/pachisi/blob/main/game/game.js"
click node_turns "https://github.com/kiran-mondal/pachisi/blob/main/game/game.js"
click node_winning "https://github.com/kiran-mondal/pachisi/blob/main/game/game.js"
click node_roll_client "https://github.com/kiran-mondal/pachisi/blob/main/game/game.js"
click node_roll_api "https://github.com/kiran-mondal/pachisi/blob/main/backend/app.rb"
click node_penpot_handler "https://github.com/kiran-mondal/pachisi/blob/main/api/penpot.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_site,node_ui,node_projects toneBlue
class node_board,node_game_modes,node_player_setup,node_tokens,node_turns,node_winning,node_roll_client toneAmber
class node_roll_api toneMint
class node_penpot_handler toneRose
class node_player,node_penpot toneIndigo
```

## Components

### Web Experience

- [Game Site](https://github.com/kiran-mondal/pachisi/blob/main/index.html): `index.html`
- [Setup and UI](https://github.com/kiran-mondal/pachisi/blob/main/script.js): `script.js`
- [Projects Page](https://github.com/kiran-mondal/pachisi/blob/main/projects/index.html): `projects/index.html`

### Game Play

- [3D Board](https://github.com/kiran-mondal/pachisi/blob/main/game/game.js): `game/game.js`
- [Game Modes](https://github.com/kiran-mondal/pachisi/blob/main/game/game.js): `game/game.js`
- [Player Setup](https://github.com/kiran-mondal/pachisi/blob/main/game/game.js): `game/game.js`
- [Token Movement](https://github.com/kiran-mondal/pachisi/blob/main/game/game.js): `game/game.js`
- [Turns and Captures](https://github.com/kiran-mondal/pachisi/blob/main/game/game.js): `game/game.js`
- [Win Condition](https://github.com/kiran-mondal/pachisi/blob/main/game/game.js): `game/game.js`
- [Roll Client](https://github.com/kiran-mondal/pachisi/blob/main/game/game.js): `game/game.js`

### Game Services

- [Dice Roll API](https://github.com/kiran-mondal/pachisi/blob/main/backend/app.rb): `backend/app.rb`

### Project Extras

- [Penpot Handler](https://github.com/kiran-mondal/pachisi/blob/main/api/penpot.js): `api/penpot.js`

### Other components

- **Player**
- **Penpot**

## Connections

- Player → Game Site: opens (evidence: `README.md`)
- Game Site → Setup and UI: presents
- Setup and UI → 3D Board: initializes (evidence: `script.js`)
- Player → Player Setup: configures (evidence: `README.md`)
- Player Setup → Game Modes: selects (evidence: `README.md`)
- Game Modes → Token Movement: governs movement (evidence: `README.md`)
- Player → Roll Client: requests roll (evidence: `game/game.js`)
- Roll Client → Dice Roll API: fetches roll (evidence: `game/game.js`)
- Dice Roll API → Roll Client: returns dice (evidence: `game/game.js`)
- Turns and Captures → Token Movement: captures tokens (evidence: `README.md`)
- Token Movement → Win Condition: progresses toward (evidence: `README.md`)
- Setup and UI → Projects Page: navigates to (evidence: `script.js`)
- Penpot Handler → Penpot: fetches file (evidence: `api/penpot.js`)
