Documentation
Architecture
System Overview

System Overview

High-level architecture

Loading diagram…

Key design decisions

Offline-first with local state as primary

The client Zustand store is the source of truth for the UI. IndexedDB backs it for persistence across page reloads. The server is consulted for reconciliation, not for every read.

Push-on-mutation, pull-on-focus sync

  • Push: triggered by local mutations, batched and debounced.
  • Pull: happens once on load and again when the browser tab regains focus. No background polling timer.

This eliminates idle network traffic while still keeping multiple clients in sync.

Layered storage with clear role separation

Each storage layer (IDB, D1, KV, R2) has a distinct job. See Storage Layers for details.

AI is split into focused endpoints

Each AI workflow has its own API route with appropriate safety controls. See AI Overview.

Optimistic updates throughout

All user actions update local state immediately, then push to the server asynchronously. The UI never blocks on a network round-trip.

Component map

ComponentDescription
BoardCanvas6000×30000 canvas with draggable note cards
DocumentEditorPrimary editing surface (note + Jira item editors)
SidebarShellLeft sidebar: Board / Jira Backlog / Notes Directory tabs
AiPanelRight slide-out AI chat drawer
SubagentNoteFloating AI assistant panel
BoardHydratorInitialises local state from IDB and D1 on mount
D1SyncManagerHandles push/pull sync lifecycle
ChangeLoggerDebounced changelog writer to R2

See also