# treybell/notesapp architecture

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

- Interactive diagram: https://gitdiagram.com/treybell/notesapp
- Repository: https://github.com/treybell/notesapp

## Overview

Scrybl is a collaborative drawing app: users browse or create a canvas, draw or erase on it, and receive live updates; canvas strokes and canvas listings are persisted through Supabase. The graph covers the sampled client and server paths. Home-page feature copy documents live collaboration and erasing, while the sampled drawing component shows those behaviors; implementation details beyond the excerpts are not assumed.

Main entry points: [`client/src/DrawingPad.jsx`](https://github.com/treybell/notesapp/blob/main/client/src/DrawingPad.jsx) (Drawing pad), [`client/src/App.jsx`](https://github.com/treybell/notesapp/blob/main/client/src/App.jsx) (Route dispatch), [`server/index.js`](https://github.com/treybell/notesapp/blob/main/server/index.js) (WebSocket handler), [`client/src/HomePage.jsx`](https://github.com/treybell/notesapp/blob/main/client/src/HomePage.jsx) (Canvas home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_bootstrap["Client bootstrap<br/>[main.jsx]"]
  node_router["Route dispatch<br/>[App.jsx]"]
  node_home["Canvas home<br/>[HomePage.jsx]"]
  node_drawing["Drawing pad<br/>[DrawingPad.jsx]"]
end

subgraph group_server["Application server"]
  node_ws["WebSocket handler<br/>[index.js]"]
  node_http["Canvas listing API<br/>[index.js]"]
end

subgraph group_storage["Canvas storage"]
  node_db[("Supabase canvases and strokes")]
end

node_user(("Canvas user"))

node_user -->|"opens app"| node_bootstrap
node_bootstrap -->|"renders"| node_router
node_router -->|"routes home"| node_home
node_router -->|"routes canvas"| node_drawing
node_user -->|"browses or creates"| node_home
node_home -->|"fetches canvases"| node_http
node_http -->|"reads canvases"| node_db
node_user -->|"draws or clears"| node_drawing
node_drawing -->|"sends canvas events"| node_ws
node_ws -->|"loads and stores strokes"| node_db
node_ws -->|"broadcasts canvas updates"| node_drawing

click node_bootstrap "https://github.com/treybell/notesapp/blob/main/client/src/main.jsx"
click node_router "https://github.com/treybell/notesapp/blob/main/client/src/App.jsx"
click node_home "https://github.com/treybell/notesapp/blob/main/client/src/HomePage.jsx"
click node_drawing "https://github.com/treybell/notesapp/blob/main/client/src/DrawingPad.jsx"
click node_ws "https://github.com/treybell/notesapp/blob/main/server/index.js"
click node_http "https://github.com/treybell/notesapp/blob/main/server/index.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_bootstrap,node_router,node_home,node_drawing,node_user toneBlue
class node_ws,node_http toneAmber
class node_db toneMint
```

## Components

### React client

- [Client bootstrap](https://github.com/treybell/notesapp/blob/main/client/src/main.jsx): `client/src/main.jsx`
- [Route dispatch](https://github.com/treybell/notesapp/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Canvas home](https://github.com/treybell/notesapp/blob/main/client/src/HomePage.jsx): `client/src/HomePage.jsx`
- [Drawing pad](https://github.com/treybell/notesapp/blob/main/client/src/DrawingPad.jsx): `client/src/DrawingPad.jsx`

### Application server

- [WebSocket handler](https://github.com/treybell/notesapp/blob/main/server/index.js): `server/index.js`
- [Canvas listing API](https://github.com/treybell/notesapp/blob/main/server/index.js): `server/index.js`

### Canvas storage

- **Supabase canvases and strokes**

### Other components

- **Canvas user**

## Connections

- Canvas user → Client bootstrap: opens app (evidence: `client/src/main.jsx`)
- Client bootstrap → Route dispatch: renders (evidence: `client/src/main.jsx`)
- Route dispatch → Canvas home: routes home (evidence: `client/src/App.jsx`)
- Route dispatch → Drawing pad: routes canvas (evidence: `client/src/App.jsx`)
- Canvas user → Canvas home: browses or creates (evidence: `client/src/HomePage.jsx`)
- Canvas home → Canvas listing API: fetches canvases (evidence: `client/src/HomePage.jsx`)
- Canvas listing API → Supabase canvases and strokes: reads canvases (evidence: `server/index.js`)
- Canvas user → Drawing pad: draws or clears (evidence: `client/src/DrawingPad.jsx`)
- Drawing pad → WebSocket handler: sends canvas events (evidence: `client/src/DrawingPad.jsx`)
- WebSocket handler → Supabase canvases and strokes: loads and stores strokes (evidence: `server/index.js`)
- WebSocket handler → Drawing pad: broadcasts canvas updates (evidence: `server/index.js`)
