# sarveshwaran20/orbit-matrix architecture

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

- Interactive diagram: https://gitdiagram.com/sarveshwaran20/orbit-matrix
- Repository: https://github.com/sarveshwaran20/orbit-matrix

## Overview

Orbit is a browser-based spatial workspace for arranging and connecting Google Workspace files on an infinite canvas. Users create or import cards, organize them visually, and can present or focus on them; workspace layouts can be saved, revisited, shared, and rewound through history. The README describes Google authentication, Drive/Calendar utilities, guest mode, and AI-generated research and canvas commands. The excerpts show canvas, state, and AI behavior, but do not establish how every documented integration is wired. `server.js` is included as a substantial source file; its excerpt shows browser DOM and storage code, not a backend service.

Main entry points: [`script.js`](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js) (Canvas & Nodes), [`orbit-ai.js`](https://github.com/sarveshwaran20/orbit-matrix/blob/main/orbit-ai.js) (AI Intent & Commands), [`index.html`](https://github.com/sarveshwaran20/orbit-matrix/blob/main/index.html) (Browser App), [`server.js`](https://github.com/sarveshwaran20/orbit-matrix/blob/main/server.js) (Client Runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Spatial Workspace"]
  node_canvas["Canvas &amp; Nodes<br/>[script.js]"]
  node_threads["Visual Threads<br/>[script.js]"]
  node_presentation["Presentation &amp; Focus<br/>[script.js]"]
  node_viewport["Viewport &amp; Minimap<br/>[script.js]"]
  node_app_shell["Browser App<br/>[index.html]"]
end

subgraph group_state["Workspace State"]
  node_workspace_state["Workspace History<br/>[script.js]"]
  node_sharing["Layout Sharing<br/>[script.js]"]
  node_browser_storage[("Local Workspace Storage<br/>[script.js]")]
  node_alternate_client["Client Runtime<br/>[server.js]"]
end

subgraph group_integrations["Google Integrations"]
  node_google_auth["Google Sign-in<br/>[script.js]"]
  node_drive["Google Drive &amp; Picker<br/>[script.js]"]
  node_side_utilities["Calendar &amp; Side Panel<br/>[script.js]"]
end

subgraph group_assistant["Orbit AI"]
  node_ai_commands["AI Intent &amp; Commands<br/>[orbit-ai.js]"]
  node_research["Research Decks<br/>[orbit-ai.js]"]
end

node_user(("Workspace User"))
node_google_services["Google Workspace APIs"]
node_public_apis["Public Research APIs"]

node_user -->|"uses"| node_app_shell
node_app_shell -->|"hosts"| node_canvas
node_user -->|"arranges"| node_canvas
node_canvas -->|"connects nodes"| node_threads
node_canvas -->|"updates view"| node_viewport
node_user -->|"presents"| node_presentation
node_user -->|"scrubs history"| node_workspace_state
node_workspace_state -->|"persists locally"| node_browser_storage
node_user -->|"shares layout"| node_sharing
node_sharing -->|"encodes layout"| node_workspace_state
node_user -->|"signs in"| node_google_auth
node_google_auth -->|"authenticates with"| node_google_services
node_drive -->|"reads and creates files"| node_google_services
node_side_utilities -->|"accesses services"| node_google_services
node_user -->|"prompts"| node_ai_commands
node_ai_commands -->|"orchestrates"| node_canvas
node_ai_commands -->|"generates content"| node_research
node_research -->|"fetches research"| node_public_apis
node_alternate_client -.->|"uses local state"| node_browser_storage

click node_canvas "https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js"
click node_threads "https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js"
click node_presentation "https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js"
click node_viewport "https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js"
click node_app_shell "https://github.com/sarveshwaran20/orbit-matrix/blob/main/index.html"
click node_workspace_state "https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js"
click node_sharing "https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js"
click node_browser_storage "https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js"
click node_alternate_client "https://github.com/sarveshwaran20/orbit-matrix/blob/main/server.js"
click node_google_auth "https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js"
click node_drive "https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js"
click node_side_utilities "https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js"
click node_ai_commands "https://github.com/sarveshwaran20/orbit-matrix/blob/main/orbit-ai.js"
click node_research "https://github.com/sarveshwaran20/orbit-matrix/blob/main/orbit-ai.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_canvas,node_threads,node_presentation,node_viewport,node_app_shell,node_user toneBlue
class node_workspace_state,node_sharing,node_browser_storage,node_alternate_client toneAmber
class node_google_auth,node_drive,node_side_utilities,node_google_services,node_public_apis toneMint
class node_ai_commands,node_research toneRose
```

## Components

### Spatial Workspace

- [Canvas & Nodes](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js): `script.js`
- [Visual Threads](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js): `script.js`
- [Presentation & Focus](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js): `script.js`
- [Viewport & Minimap](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js): `script.js`
- [Browser App](https://github.com/sarveshwaran20/orbit-matrix/blob/main/index.html): `index.html`

### Workspace State

- [Workspace History](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js): `script.js`
- [Layout Sharing](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js): `script.js`
- [Local Workspace Storage](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js): `script.js`
- [Client Runtime](https://github.com/sarveshwaran20/orbit-matrix/blob/main/server.js): `server.js`

### Google Integrations

- [Google Sign-in](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js): `script.js`
- [Google Drive & Picker](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js): `script.js`
- [Calendar & Side Panel](https://github.com/sarveshwaran20/orbit-matrix/blob/main/script.js): `script.js`

### Orbit AI

- [AI Intent & Commands](https://github.com/sarveshwaran20/orbit-matrix/blob/main/orbit-ai.js): `orbit-ai.js`
- [Research Decks](https://github.com/sarveshwaran20/orbit-matrix/blob/main/orbit-ai.js): `orbit-ai.js`

### Other components

- **Workspace User**
- **Google Workspace APIs**
- **Public Research APIs**

## Connections

- Workspace User → Browser App: uses (evidence: `README.md`)
- Browser App → Canvas & Nodes: hosts (evidence: `README.md`)
- Workspace User → Canvas & Nodes: arranges (evidence: `README.md`)
- Canvas & Nodes → Visual Threads: connects nodes (evidence: `script.js`)
- Canvas & Nodes → Viewport & Minimap: updates view (evidence: `script.js`)
- Workspace User → Presentation & Focus: presents (evidence: `README.md`)
- Workspace User → Workspace History: scrubs history (evidence: `script.js`)
- Workspace History → Local Workspace Storage: persists locally (evidence: `README.md`)
- Workspace User → Layout Sharing: shares layout (evidence: `script.js`)
- Layout Sharing → Workspace History: encodes layout (evidence: `script.js`)
- Workspace User → Google Sign-in: signs in (evidence: `README.md`)
- Google Sign-in → Google Workspace APIs: authenticates with (evidence: `README.md`)
- Google Drive & Picker → Google Workspace APIs: reads and creates files (evidence: `script.js`)
- Calendar & Side Panel → Google Workspace APIs: accesses services (evidence: `README.md`)
- Workspace User → AI Intent & Commands: prompts (evidence: `orbit-ai.js`)
- AI Intent & Commands → Canvas & Nodes: orchestrates (evidence: `orbit-ai.js`)
- AI Intent & Commands → Research Decks: generates content (evidence: `orbit-ai.js`)
- Research Decks → Public Research APIs: fetches research (evidence: `orbit-ai.js`)
- Client Runtime → Local Workspace Storage: uses local state (evidence: `server.js`)
