# hanak13/fuzzy-lamp architecture

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

- Interactive diagram: https://gitdiagram.com/hanak13/fuzzy-lamp
- Repository: https://github.com/hanak13/fuzzy-lamp

## Overview

This is an offline-first collaborative whiteboard: users create or open boards, draw and arrange canvas objects, optionally present or collaborate over LAN, then save, share, or export their work. The graph covers the documented feature areas and the central backend/storage path. Several frontend modules were not excerpted, so their internal call relationships are omitted rather than inferred from filenames or co-location.

Main entry points: [`templates`](https://github.com/hanak13/fuzzy-lamp/tree/master/templates) (Board pages), [`static/js/boards.js`](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/boards.js) (Board management), [`app.py`](https://github.com/hanak13/fuzzy-lamp/blob/master/app.py) (HTTP and WebSocket API), [`static/js/collab.js`](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/collab.js) (LAN collaboration client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_pages["Board pages"]
  node_api["HTTP and WebSocket API<br/>[app.py]"]
end

subgraph group_canvas["Canvas editing"]
  node_core["Canvas runtime<br/>[core.js]"]
  node_interactions["Canvas interactions<br/>[interactions.js]"]
  node_tools["Drawing tools<br/>[tools.js]"]
  node_commands["Commands and history<br/>[commands.js]"]
  node_objects["Objects and layers<br/>[objects.js]"]
  node_shapes["Shapes library<br/>[shapes.js]"]
end

subgraph group_features["Board features"]
  node_boards["Board management<br/>[boards.js]"]
  node_notes["Sticky notes<br/>[notes.js]"]
  node_icons["Vector icons<br/>[icons.js]"]
  node_extras["Minimap and extras<br/>[extras.js]"]
  node_steps["Step presentations<br/>[steps.js]"]
  node_slides["Slide presentations<br/>[slides.js]"]
  node_modes["Editing modes<br/>[modes.js]"]
  node_ui["Application interface<br/>[ui.js]"]
end

subgraph group_collab["Collaboration"]
  node_collab_client["LAN collaboration client<br/>[collab.js]"]
  node_rooms["Collaboration rooms<br/>[app.py]"]
end

subgraph group_storage["Persistence and output"]
  node_database[("SQLite board store<br/>[db.py]")]
  node_export["Board export<br/>[export.js]"]
end

node_user(("Whiteboard user"))

node_user -->|"opens board"| node_pages
node_pages -->|"requests pages"| node_api
node_pages -.->|"provides canvas"| node_core
node_api -->|"reads and writes"| node_database
node_boards -->|"loads and saves"| node_api
node_boards -.->|"persists board data"| node_database
node_interactions -->|"creates step box"| node_steps
node_user -->|"draws and erases"| node_tools
node_user -->|"adds shapes"| node_shapes
node_user -->|"adds notes"| node_notes
node_user -->|"adds icons"| node_icons
node_user -->|"manages layers"| node_objects
node_user -->|"undoes and edits"| node_commands
node_user -->|"presents slides"| node_slides
node_user -->|"plays steps"| node_steps
node_user -->|"navigates minimap"| node_extras
node_user -->|"exports board"| node_export
node_collab_client -->|"syncs over WebSocket"| node_rooms
node_rooms -->|"broadcasts updates"| node_collab_client
node_export -->|"downloads result"| node_user
node_modes -.->|"configures canvas"| node_core
node_ui -.->|"offers board controls"| node_boards

click node_pages "https://github.com/hanak13/fuzzy-lamp/tree/master/templates"
click node_api "https://github.com/hanak13/fuzzy-lamp/blob/master/app.py"
click node_core "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/core.js"
click node_interactions "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/interactions.js"
click node_tools "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/tools.js"
click node_commands "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/commands.js"
click node_objects "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/objects.js"
click node_shapes "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/shapes.js"
click node_boards "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/boards.js"
click node_notes "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/notes.js"
click node_icons "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/icons.js"
click node_extras "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/extras.js"
click node_steps "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/steps.js"
click node_slides "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/slides.js"
click node_modes "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/modes.js"
click node_ui "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/ui.js"
click node_collab_client "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/collab.js"
click node_rooms "https://github.com/hanak13/fuzzy-lamp/blob/master/app.py"
click node_database "https://github.com/hanak13/fuzzy-lamp/blob/master/db.py"
click node_export "https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/export.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_pages,node_api,node_user toneBlue
class node_core,node_interactions,node_tools,node_commands,node_objects,node_shapes toneAmber
class node_boards,node_notes,node_icons,node_extras,node_steps,node_slides,node_modes,node_ui toneMint
class node_collab_client,node_rooms toneRose
class node_database,node_export toneIndigo
```

## Components

### Web app

- [Board pages](https://github.com/hanak13/fuzzy-lamp/tree/master/templates): `templates`
- [HTTP and WebSocket API](https://github.com/hanak13/fuzzy-lamp/blob/master/app.py): `app.py`

### Canvas editing

- [Canvas runtime](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/core.js): `static/js/core.js`
- [Canvas interactions](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/interactions.js): `static/js/interactions.js`
- [Drawing tools](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/tools.js): `static/js/tools.js`
- [Commands and history](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/commands.js): `static/js/commands.js`
- [Objects and layers](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/objects.js): `static/js/objects.js`
- [Shapes library](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/shapes.js): `static/js/shapes.js`

### Board features

- [Board management](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/boards.js): `static/js/boards.js`
- [Sticky notes](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/notes.js): `static/js/notes.js`
- [Vector icons](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/icons.js): `static/js/icons.js`
- [Minimap and extras](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/extras.js): `static/js/extras.js`
- [Step presentations](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/steps.js): `static/js/steps.js`
- [Slide presentations](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/slides.js): `static/js/slides.js`
- [Editing modes](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/modes.js): `static/js/modes.js`
- [Application interface](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/ui.js): `static/js/ui.js`

### Collaboration

- [LAN collaboration client](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/collab.js): `static/js/collab.js`
- [Collaboration rooms](https://github.com/hanak13/fuzzy-lamp/blob/master/app.py): `app.py`

### Persistence and output

- [SQLite board store](https://github.com/hanak13/fuzzy-lamp/blob/master/db.py): `db.py`
- [Board export](https://github.com/hanak13/fuzzy-lamp/blob/master/static/js/export.js): `static/js/export.js`

### Other components

- **Whiteboard user**

## Connections

- Whiteboard user → Board pages: opens board (evidence: `README.md`)
- Board pages → HTTP and WebSocket API: requests pages (evidence: `app.py`)
- Board pages → Canvas runtime: provides canvas
- HTTP and WebSocket API → SQLite board store: reads and writes (evidence: `app.py`)
- Board management → HTTP and WebSocket API: loads and saves (evidence: `static/js/boards.js`)
- Board management → SQLite board store: persists board data
- Canvas interactions → Step presentations: creates step box (evidence: `static/js/interactions.js`)
- Whiteboard user → Drawing tools: draws and erases (evidence: `README.md`)
- Whiteboard user → Shapes library: adds shapes (evidence: `README.md`)
- Whiteboard user → Sticky notes: adds notes (evidence: `README.md`)
- Whiteboard user → Vector icons: adds icons (evidence: `README.md`)
- Whiteboard user → Objects and layers: manages layers (evidence: `README.md`)
- Whiteboard user → Commands and history: undoes and edits (evidence: `README.md`)
- Whiteboard user → Slide presentations: presents slides (evidence: `README.md`)
- Whiteboard user → Step presentations: plays steps (evidence: `README.md`)
- Whiteboard user → Minimap and extras: navigates minimap (evidence: `README.md`)
- Whiteboard user → Board export: exports board (evidence: `README.md`)
- LAN collaboration client → Collaboration rooms: syncs over WebSocket (evidence: `README.md`)
- Collaboration rooms → LAN collaboration client: broadcasts updates (evidence: `app.py`)
- Board export → Whiteboard user: downloads result (evidence: `README.md`)
- Editing modes → Canvas runtime: configures canvas
- Application interface → Board management: offers board controls
