# krupani/bollybash architecture

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

- Interactive diagram: https://gitdiagram.com/krupani/bollybash
- Repository: https://github.com/krupani/bollybash

## Overview

Bollyflip is a host-run, browser-based Bollywood movie party game: the host selects a game mode, adds players, presents clues on a shared screen, reveals answers, awards points, and reaches a ranked results screen. The main product stages are the three clue modes, player and score management, tutorial, and results; browser localStorage preserves session state. Source excerpts show the game registry and parts of the shared UI, while README statements support the broader workflow. Some wiring is unsampled, so those relationships are omitted or marked unverified.

Main entry points: [`scripts/games.js`](https://github.com/krupani/bollybash/blob/main/scripts/games.js) (Mode registry), [`scripts/app.js`](https://github.com/krupani/bollybash/blob/main/scripts/app.js) (Game app), [`data/bollyflip.js`](https://github.com/krupani/bollybash/blob/main/data/bollyflip.js) (Flip mode), [`data/bollytwist.js`](https://github.com/krupani/bollybash/blob/main/data/bollytwist.js) (Twist mode)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Game play"]
  node_app["Game app<br/>[app.js]"]
  node_registry["Mode registry<br/>[games.js]"]
end

subgraph group_content["Clue decks"]
  node_flip["Flip mode<br/>[bollyflip.js]"]
  node_twist["Twist mode<br/>[bollytwist.js]"]
  node_jumble["Jumble mode<br/>[bollyjumble.js]"]
end

subgraph group_scores["Players and scores"]
  node_players["Player setup<br/>[app.js]"]
  node_rounds["Round controls<br/>[app.js]"]
  node_leaderboard["Leaderboard and undo<br/>[app.js]"]
  node_results["Results podium<br/>[app.js]"]
end

subgraph group_support["Tutorial and persistence"]
  node_storage[("Saved session<br/>[app.js]")]
  node_tutorial["Interactive tutorial<br/>[app.js]"]
  node_samples["Tutorial samples<br/>[sample.js]"]
end

node_host(("Host and players"))

node_host -->|"plays on"| node_app
node_registry -->|"reads deck"| node_flip
node_registry -->|"reads deck"| node_twist
node_registry -->|"reads deck"| node_jumble
node_app -.->|"uses modes"| node_registry
node_host -->|"adds players"| node_players
node_host -->|"runs rounds"| node_rounds
node_rounds -->|"opens ranking"| node_leaderboard
node_leaderboard -.->|"ends game"| node_results
node_app -->|"persists state"| node_storage
node_host -->|"learns rules"| node_tutorial
node_tutorial -->|"uses examples"| node_samples

click node_app "https://github.com/krupani/bollybash/blob/main/scripts/app.js"
click node_registry "https://github.com/krupani/bollybash/blob/main/scripts/games.js"
click node_flip "https://github.com/krupani/bollybash/blob/main/data/bollyflip.js"
click node_twist "https://github.com/krupani/bollybash/blob/main/data/bollytwist.js"
click node_jumble "https://github.com/krupani/bollybash/blob/main/data/bollyjumble.js"
click node_players "https://github.com/krupani/bollybash/blob/main/scripts/app.js"
click node_rounds "https://github.com/krupani/bollybash/blob/main/scripts/app.js"
click node_leaderboard "https://github.com/krupani/bollybash/blob/main/scripts/app.js"
click node_results "https://github.com/krupani/bollybash/blob/main/scripts/app.js"
click node_storage "https://github.com/krupani/bollybash/blob/main/scripts/app.js"
click node_tutorial "https://github.com/krupani/bollybash/blob/main/scripts/app.js"
click node_samples "https://github.com/krupani/bollybash/blob/main/data/sample.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_app,node_registry toneBlue
class node_flip,node_twist,node_jumble toneAmber
class node_players,node_rounds,node_leaderboard,node_results toneMint
class node_storage,node_tutorial,node_samples toneRose
class node_host toneIndigo
```

## Components

### Game play

- [Game app](https://github.com/krupani/bollybash/blob/main/scripts/app.js): `scripts/app.js`
- [Mode registry](https://github.com/krupani/bollybash/blob/main/scripts/games.js): `scripts/games.js`

### Clue decks

- [Flip mode](https://github.com/krupani/bollybash/blob/main/data/bollyflip.js): `data/bollyflip.js`
- [Twist mode](https://github.com/krupani/bollybash/blob/main/data/bollytwist.js): `data/bollytwist.js`
- [Jumble mode](https://github.com/krupani/bollybash/blob/main/data/bollyjumble.js): `data/bollyjumble.js`

### Players and scores

- [Player setup](https://github.com/krupani/bollybash/blob/main/scripts/app.js): `scripts/app.js`
- [Round controls](https://github.com/krupani/bollybash/blob/main/scripts/app.js): `scripts/app.js`
- [Leaderboard and undo](https://github.com/krupani/bollybash/blob/main/scripts/app.js): `scripts/app.js`
- [Results podium](https://github.com/krupani/bollybash/blob/main/scripts/app.js): `scripts/app.js`

### Tutorial and persistence

- [Saved session](https://github.com/krupani/bollybash/blob/main/scripts/app.js): `scripts/app.js`
- [Interactive tutorial](https://github.com/krupani/bollybash/blob/main/scripts/app.js): `scripts/app.js`
- [Tutorial samples](https://github.com/krupani/bollybash/blob/main/data/sample.js): `data/sample.js`

### Other components

- **Host and players**

## Connections

- Host and players → Game app: plays on (evidence: `README.md`)
- Mode registry → Flip mode: reads deck (evidence: `scripts/games.js`)
- Mode registry → Twist mode: reads deck (evidence: `scripts/games.js`)
- Mode registry → Jumble mode: reads deck (evidence: `scripts/games.js`)
- Game app → Mode registry: uses modes
- Host and players → Player setup: adds players (evidence: `README.md`)
- Host and players → Round controls: runs rounds (evidence: `README.md`)
- Round controls → Leaderboard and undo: opens ranking (evidence: `scripts/app.js`)
- Leaderboard and undo → Results podium: ends game (evidence: `scripts/app.js`)
- Game app → Saved session: persists state (evidence: `README.md`)
- Host and players → Interactive tutorial: learns rules (evidence: `README.md`)
- Interactive tutorial → Tutorial samples: uses examples (evidence: `data/sample.js`)
