# usernamehaze/bot architecture

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

- Interactive diagram: https://gitdiagram.com/usernamehaze/bot
- Repository: https://github.com/usernamehaze/bot

## Overview

Cassie is a browser-based study companion, with an installable web app and a browser extension. The main workflow is a learner asking by text or voice, receiving step-by-step teaching, and using related drawings, 3D views, labs, or a work board. Separate branches cover study materials, pictures, and the extension’s page-aware help. The README documents these capabilities, but most runtime wiring was not excerpted; uncertain links are omitted rather than inferred. The server’s specific request flow is not established by the supplied excerpts.

Main entry points: [`web/app.js`](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/app.js) (App experience), [`web/cassie-bot.js`](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/cassie-bot.js) (Teaching chat), [`web/livedraw.js`](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/livedraw.js) (Drawing kits), [`web/labs/labs.js`](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/labs/labs.js) (Labs catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_app["App experience<br/>[app.js]"]
  node_teaching["Teaching chat<br/>[cassie-bot.js]"]
  node_voice["Voice interaction<br/>[voice.js]"]
  node_server["Cassie server<br/>[worker.src.js]"]
  node_pictures["Picture lookup<br/>[cassie-bot.js]"]
end

subgraph group_visual["Visual learning"]
  node_drawings["Drawing kits<br/>[livedraw.js]"]
  node_drawingbook["Drawing book<br/>[drawbook.js]"]
  node_modelview["3D model views<br/>[isoview.js]"]
  node_bodyexplore["Body explorer<br/>[body3d.js]"]
  node_cellexplore["Cell explorer<br/>[cell3d.js]"]
  node_labcatalog["Labs catalog<br/>[labs.js]"]
  node_labmodules["Interactive labs"]
  node_labpreviews["Lab previews<br/>[previews.js]"]
end

subgraph group_study["Study tools"]
  node_board["Work board<br/>[board.js]"]
  node_studytools["Study tools<br/>[tools.js]"]
  node_progress["Study progress<br/>[study-room.js]"]
end

subgraph group_extension["Browser extension"]
  node_extcontent["Page selection<br/>[content.js]"]
  node_extbackground["Extension coordinator<br/>[background.js]"]
  node_extpanel["Extension panel<br/>[panel.js]"]
  node_extboard["Floating board<br/>[board.js]"]
  node_extdraw["Extension drawings<br/>[sketch.js]"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_app
node_learner -->|"selects page content"| node_extcontent
node_app -.->|"opens teaching"| node_teaching
node_teaching -.->|"requests AI help"| node_server
node_learner -->|"asks by voice"| node_voice
node_teaching -->|"requests a drawing"| node_drawings
node_drawings -->|"uses checked content"| node_drawingbook
node_drawings -->|"shows 3D models"| node_modelview
node_app -->|"finds pictures"| node_pictures
node_learner -->|"opens labs"| node_labcatalog
node_labcatalog -->|"dispatches labs"| node_labmodules
node_labcatalog -.->|"shows previews"| node_labpreviews
node_labmodules -.->|"opens body view"| node_bodyexplore
node_labmodules -.->|"opens cell view"| node_cellexplore
node_learner -->|"works problems"| node_board
node_learner -->|"makes study materials"| node_studytools
node_learner -->|"tracks learning"| node_progress
node_extcontent -.->|"sends page context"| node_extbackground
node_extbackground -.->|"opens help panel"| node_extpanel
node_extpanel -->|"shows floating board"| node_extboard
node_extpanel -->|"shows drawings"| node_extdraw

click node_app "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/app.js"
click node_teaching "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/cassie-bot.js"
click node_voice "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/voice.js"
click node_server "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/server/worker.src.js"
click node_pictures "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/cassie-bot.js"
click node_drawings "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/livedraw.js"
click node_drawingbook "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/drawbook.js"
click node_modelview "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/isoview.js"
click node_bodyexplore "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/explore/body3d.js"
click node_cellexplore "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/explore/cell3d.js"
click node_labcatalog "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/labs/labs.js"
click node_labmodules "https://github.com/usernamehaze/bot/tree/claude/brave-tesla-ofygom/web/labs"
click node_labpreviews "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/labs/previews.js"
click node_board "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/board.js"
click node_studytools "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/labs/tools.js"
click node_progress "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/study-room.js"
click node_extcontent "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/extension/content.js"
click node_extbackground "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/extension/background.js"
click node_extpanel "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/extension/panel.js"
click node_extboard "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/extension/board.js"
click node_extdraw "https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/extension/sketch.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_teaching,node_voice,node_server,node_pictures toneBlue
class node_drawings,node_drawingbook,node_modelview,node_bodyexplore,node_cellexplore,node_labcatalog,node_labmodules,node_labpreviews toneAmber
class node_board,node_studytools,node_progress toneMint
class node_extcontent,node_extbackground,node_extpanel,node_extboard,node_extdraw toneRose
class node_learner toneIndigo
```

## Components

### Web app

- [App experience](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/app.js): `web/app.js`
- [Teaching chat](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/cassie-bot.js): `web/cassie-bot.js`
- [Voice interaction](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/voice.js): `web/voice.js`
- [Cassie server](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/server/worker.src.js): `server/worker.src.js`
- [Picture lookup](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/cassie-bot.js): `web/cassie-bot.js`

### Visual learning

- [Drawing kits](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/livedraw.js): `web/livedraw.js`
- [Drawing book](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/drawbook.js): `web/drawbook.js`
- [3D model views](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/isoview.js): `web/isoview.js`
- [Body explorer](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/explore/body3d.js): `web/explore/body3d.js`
- [Cell explorer](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/explore/cell3d.js): `web/explore/cell3d.js`
- [Labs catalog](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/labs/labs.js): `web/labs/labs.js`
- [Interactive labs](https://github.com/usernamehaze/bot/tree/claude/brave-tesla-ofygom/web/labs): `web/labs`
- [Lab previews](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/labs/previews.js): `web/labs/previews.js`

### Study tools

- [Work board](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/board.js): `web/board.js`
- [Study tools](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/labs/tools.js): `web/labs/tools.js`
- [Study progress](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/web/study-room.js): `web/study-room.js`

### Browser extension

- [Page selection](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/extension/content.js): `extension/content.js`
- [Extension coordinator](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/extension/background.js): `extension/background.js`
- [Extension panel](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/extension/panel.js): `extension/panel.js`
- [Floating board](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/extension/board.js): `extension/board.js`
- [Extension drawings](https://github.com/usernamehaze/bot/blob/claude/brave-tesla-ofygom/extension/sketch.js): `extension/sketch.js`

### Other components

- **Learner**

## Connections

- Learner → App experience: uses (evidence: `README.md`)
- Learner → Page selection: selects page content (evidence: `README.md`)
- App experience → Teaching chat: opens teaching
- Teaching chat → Cassie server: requests AI help
- Learner → Voice interaction: asks by voice (evidence: `README.md`)
- Teaching chat → Drawing kits: requests a drawing (evidence: `README.md`)
- Drawing kits → Drawing book: uses checked content (evidence: `README.md`)
- Drawing kits → 3D model views: shows 3D models (evidence: `README.md`)
- App experience → Picture lookup: finds pictures (evidence: `README.md`)
- Learner → Labs catalog: opens labs (evidence: `README.md`)
- Labs catalog → Interactive labs: dispatches labs (evidence: `web/labs/labs.js`)
- Labs catalog → Lab previews: shows previews (evidence: `web/labs/labs.js`)
- Interactive labs → Body explorer: opens body view
- Interactive labs → Cell explorer: opens cell view
- Learner → Work board: works problems (evidence: `README.md`)
- Learner → Study tools: makes study materials (evidence: `README.md`)
- Learner → Study progress: tracks learning (evidence: `README.md`)
- Page selection → Extension coordinator: sends page context
- Extension coordinator → Extension panel: opens help panel
- Extension panel → Floating board: shows floating board (evidence: `README.md`)
- Extension panel → Extension drawings: shows drawings (evidence: `README.md`)
