# hmidqorbani/jb architecture

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

- Interactive diagram: https://gitdiagram.com/hmidqorbani/jb
- Repository: https://github.com/hmidqorbani/jb

## Overview

Jeresh Bede is a browser-based 3D cube-smashing game, served by a small Express/EJS application. A player loads the game page, interacts with the canvas, and receives gameplay, score, and menu updates. The browser implementation is a large script rather than separate modules; the graph separates its visible responsibilities while retaining their shared source path. The root-level script.js is also a substantial core file, but the excerpts do not establish how it relates to the served copy.

Main entry points: [`project with node js/public/js/script.js`](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js) (Browser game), [`project with node js/game-server.js`](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/game-server.js) (Express server), [`project with node js/views/game.ejs`](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/views/game.ejs) (Game page), [`project with node js/public`](https://github.com/hmidqorbani/jb/tree/main/project%20with%20node%20js/public) (Static assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web delivery"]
  node_express["Express server<br/>[game-server.js]"]
  node_gamepage["Game page<br/>[game.ejs]"]
  node_static["Static assets"]
end

subgraph group_gameplay["Game runtime"]
  node_client["Browser game<br/>[script.js]"]
  node_targets["Targets<br/>[script.js]"]
  node_geometry["3D entities<br/>[script.js]"]
  node_fragments["Target fragments<br/>[script.js]"]
  node_sparks["Spark effects<br/>[script.js]"]
  node_input["Canvas input<br/>[script.js]"]
  node_rootcopy["Root game script<br/>[script.js]"]
end

subgraph group_presentation["Player interface"]
  node_score["Score and modes<br/>[script.js]"]
  node_menus["Menus<br/>[script.js]"]
  node_hud["Game HUD<br/>[script.js]"]
  node_canvas["Canvas styling<br/>[style.css]"]
end

node_player(("Player"))

node_player -->|"requests game"| node_express
node_express -->|"renders page"| node_gamepage
node_express -->|"serves assets"| node_static
node_player -->|"uses canvas"| node_input
node_input -->|"dispatches input"| node_client
node_client -->|"updates targets"| node_targets
node_targets -->|"creates entities"| node_geometry
node_client -->|"creates bursts"| node_fragments
node_client -->|"creates sparks"| node_sparks
node_client -->|"updates score"| node_score
node_score -->|"refreshes display"| node_hud
node_score -->|"ends game"| node_menus

click node_express "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/game-server.js"
click node_gamepage "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/views/game.ejs"
click node_static "https://github.com/hmidqorbani/jb/tree/main/project%20with%20node%20js/public"
click node_client "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js"
click node_targets "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js"
click node_geometry "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js"
click node_fragments "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js"
click node_sparks "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js"
click node_input "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js"
click node_score "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js"
click node_menus "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js"
click node_hud "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js"
click node_canvas "https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/css/style.css"
click node_rootcopy "https://github.com/hmidqorbani/jb/blob/main/script.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_express,node_gamepage,node_static toneBlue
class node_client,node_targets,node_geometry,node_fragments,node_sparks,node_input,node_rootcopy toneAmber
class node_score,node_menus,node_hud,node_canvas toneMint
class node_player toneIndigo
```

## Components

### Web delivery

- [Express server](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/game-server.js): `project with node js/game-server.js`
- [Game page](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/views/game.ejs): `project with node js/views/game.ejs`
- [Static assets](https://github.com/hmidqorbani/jb/tree/main/project%20with%20node%20js/public): `project with node js/public`

### Game runtime

- [Browser game](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js): `project with node js/public/js/script.js`
- [Targets](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js): `project with node js/public/js/script.js`
- [3D entities](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js): `project with node js/public/js/script.js`
- [Target fragments](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js): `project with node js/public/js/script.js`
- [Spark effects](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js): `project with node js/public/js/script.js`
- [Canvas input](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js): `project with node js/public/js/script.js`
- [Root game script](https://github.com/hmidqorbani/jb/blob/main/script.js): `script.js`

### Player interface

- [Score and modes](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js): `project with node js/public/js/script.js`
- [Menus](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js): `project with node js/public/js/script.js`
- [Game HUD](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/js/script.js): `project with node js/public/js/script.js`
- [Canvas styling](https://github.com/hmidqorbani/jb/blob/main/project%20with%20node%20js/public/css/style.css): `project with node js/public/css/style.css`

### Other components

- **Player**

## Connections

- Player → Express server: requests game (evidence: `project with node js/game-server.js`)
- Express server → Game page: renders page (evidence: `project with node js/game-server.js`)
- Express server → Static assets: serves assets (evidence: `project with node js/game-server.js`)
- Player → Canvas input: uses canvas (evidence: `project with node js/public/js/script.js`)
- Canvas input → Browser game: dispatches input (evidence: `project with node js/public/js/script.js`)
- Browser game → Targets: updates targets (evidence: `project with node js/public/js/script.js`)
- Targets → 3D entities: creates entities (evidence: `project with node js/public/js/script.js`)
- Browser game → Target fragments: creates bursts (evidence: `project with node js/public/js/script.js`)
- Browser game → Spark effects: creates sparks (evidence: `project with node js/public/js/script.js`)
- Browser game → Score and modes: updates score (evidence: `project with node js/public/js/script.js`)
- Score and modes → Game HUD: refreshes display (evidence: `project with node js/public/js/script.js`)
- Score and modes → Menus: ends game (evidence: `project with node js/public/js/script.js`)
