# jaspreet210/pixelglobe architecture

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

- Interactive diagram: https://gitdiagram.com/jaspreet210/pixelglobe
- Repository: https://github.com/jaspreet210/pixelglobe

## Overview

#### Purpose and topology
This repository is a collaborative canvas application with a Vite/React client and a Node.js server. The client provides local, global, and private-room canvas modes; the server is the backend entry point for shared-session behavior.

#### Client bootstrap and application shell
The browser application starts at `client/src/main.jsx`, mounts the top-level UI in `client/src/App.jsx`, and applies global presentation from `client/src/index.css` and `client/src/App.css`. `client/index.html` is the Vite HTML host.

#### Canvas modes and navigation boundary
Canvas experiences are separated by page-level components:
- `client/src/pages/Lobby.jsx` is the likely session/mode selection surface.
- `client/src/pages/LocalCanvas.jsx` owns single-browser/local drawing behavior.
- `client/src/pages/GlobalCanvas.jsx` represents a shared global canvas.
- `client/src/pages/PrivateRoom.jsx` represents scoped or inviteable room sessions.

This page split is the main boundary between local state and networked/shared canvas contexts.

#### Shared drawing workspace
`client/src/components/SharedCanvas.jsx` is the central reusable canvas component, likely parameterized by the selected page or room context. It concentrates drawing/rendering and shared-canvas interaction semantics so local, global, and private modes can reuse the same workspace implementation.

#### Interaction and export stages
`client/src/components/Toolbar.jsx` provides drawing controls and tool selection adjacent to the canvas. `client/src/components/ExportModal.jsx` handles output/export interaction. These components form distinct control and output boundaries around `SharedCanvas.jsx`, rather than embedding those concerns in each canvas page.

#### Server and real-time boundary
`server/index.js` is the backend runtime entry point. It is the repository’s likely authority for connection/session coordination and propagation of canvas updates between clients. Browser code should treat this server as the boundary for global canvas and private-room synchronization; `LocalCanvas.jsx` can remain independent of that path.

#### Runtime and deployment
The client uses React and Vite, defined by `client/package.json` and `client/vite.config.js`. The backend runtime is Node.js, defined by `server/package.json`. `Dockerfile` provides the containerization boundary for deployment, likely packaging one or both runtimes into a deployable service.

Main entry points: [`client/src/components/SharedCanvas.jsx`](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/components/SharedCanvas.jsx) (Shared canvas), [`client/src/pages/Lobby.jsx`](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/pages/Lobby.jsx) (Lobby), [`client/src/main.jsx`](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/main.jsx) (Client bootstrap), [`client/src/App.jsx`](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/App.jsx) (Application shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React/Vite client"]
  node_html["Vite HTML host<br/>HTML entry<br/>[index.html]"]
  node_main["Client bootstrap<br/>React entry<br/>[main.jsx]"]
  node_app["Application shell<br/>React root<br/>[App.jsx]"]
  node_index_css["Global styles<br/>CSS<br/>[index.css]"]
  node_app_css["App styles<br/>CSS<br/>[App.css]"]
  node_canvas["Shared canvas<br/>drawing workspace<br/>[SharedCanvas.jsx]"]
  node_toolbar["Toolbar<br/>drawing controls<br/>[Toolbar.jsx]"]
  node_export["Export modal<br/>output UI<br/>[ExportModal.jsx]"]
end

subgraph group_modes["Canvas modes"]
  node_lobby["Lobby<br/>mode selection page<br/>[Lobby.jsx]"]
  node_local["Local canvas<br/>canvas page<br/>[LocalCanvas.jsx]"]
  node_global["Global canvas<br/>shared canvas page<br/>[GlobalCanvas.jsx]"]
  node_private["Private room<br/>room canvas page<br/>[PrivateRoom.jsx]"]
end

subgraph group_server["Server runtime"]
  node_server_entry{{"Session sync server<br/>Node.js entry<br/>[index.js]"}}
end

node_docker["Container deployment<br/>Docker image"]

node_html -->|"loads"| node_main
node_main -->|"mounts"| node_app
node_main -->|"applies"| node_index_css
node_app -->|"applies"| node_app_css
node_app -->|"presents"| node_lobby
node_lobby -->|"selects local mode"| node_local
node_lobby -->|"selects global mode"| node_global
node_lobby -->|"selects room mode"| node_private
node_local -->|"uses"| node_canvas
node_global -->|"uses"| node_canvas
node_private -->|"uses"| node_canvas
node_toolbar -->|"controls drawing"| node_canvas
node_canvas -->|"exports output"| node_export
node_global -->|"synchronizes updates"| node_server_entry
node_private -->|"synchronizes room updates"| node_server_entry
node_docker -->|"packages runtime"| node_server_entry

click node_html "https://github.com/jaspreet210/pixelglobe/blob/main/client/index.html"
click node_main "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/main.jsx"
click node_app "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/App.jsx"
click node_index_css "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/index.css"
click node_app_css "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/App.css"
click node_lobby "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/pages/Lobby.jsx"
click node_local "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/pages/LocalCanvas.jsx"
click node_global "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/pages/GlobalCanvas.jsx"
click node_private "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/pages/PrivateRoom.jsx"
click node_canvas "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/components/SharedCanvas.jsx"
click node_toolbar "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/components/Toolbar.jsx"
click node_export "https://github.com/jaspreet210/pixelglobe/blob/main/client/src/components/ExportModal.jsx"
click node_server_entry "https://github.com/jaspreet210/pixelglobe/blob/main/server/index.js"
click node_docker "https://github.com/jaspreet210/pixelglobe/blob/main/Dockerfile"

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_html,node_main,node_app,node_index_css,node_app_css,node_canvas,node_toolbar,node_export toneBlue
class node_lobby,node_local,node_global,node_private toneAmber
class node_server_entry toneMint
class node_docker toneNeutral
```

## Components

### React/Vite client

- [Vite HTML host](https://github.com/jaspreet210/pixelglobe/blob/main/client/index.html): HTML entry · `client/index.html`
- [Client bootstrap](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/main.jsx): React entry · `client/src/main.jsx`
- [Application shell](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/App.jsx): React root · `client/src/App.jsx`
- [Global styles](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/index.css): CSS · `client/src/index.css`
- [App styles](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/App.css): CSS · `client/src/App.css`
- [Shared canvas](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/components/SharedCanvas.jsx): drawing workspace · Reusable drawing and canvas-interaction implementation. · `client/src/components/SharedCanvas.jsx`
- [Toolbar](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/components/Toolbar.jsx): drawing controls · `client/src/components/Toolbar.jsx`
- [Export modal](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/components/ExportModal.jsx): output UI · `client/src/components/ExportModal.jsx`

### Canvas modes

Page-level boundary between local and shared contexts.

- [Lobby](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/pages/Lobby.jsx): mode selection page · `client/src/pages/Lobby.jsx`
- [Local canvas](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/pages/LocalCanvas.jsx): canvas page · Single-browser drawing mode. · `client/src/pages/LocalCanvas.jsx`
- [Global canvas](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/pages/GlobalCanvas.jsx): shared canvas page · `client/src/pages/GlobalCanvas.jsx`
- [Private room](https://github.com/jaspreet210/pixelglobe/blob/main/client/src/pages/PrivateRoom.jsx): room canvas page · `client/src/pages/PrivateRoom.jsx`

### Server runtime

- [Session sync server](https://github.com/jaspreet210/pixelglobe/blob/main/server/index.js): Node.js entry · Coordinates connections, sessions, and canvas update propagation. · `server/index.js`

### Other components

- [Container deployment](https://github.com/jaspreet210/pixelglobe/blob/main/Dockerfile): Docker image · `Dockerfile`

## Connections

- Vite HTML host → Client bootstrap: loads
- Client bootstrap → Application shell: mounts
- Client bootstrap → Global styles: applies
- Application shell → App styles: applies
- Application shell → Lobby: presents
- Lobby → Local canvas: selects local mode
- Lobby → Global canvas: selects global mode
- Lobby → Private room: selects room mode
- Local canvas → Shared canvas: uses
- Global canvas → Shared canvas: uses
- Private room → Shared canvas: uses
- Toolbar → Shared canvas: controls drawing
- Shared canvas → Export modal: exports output
- Global canvas → Session sync server: synchronizes updates
- Private room → Session sync server: synchronizes room updates
- Container deployment → Session sync server: packages runtime
