# zachvivier/jot architecture

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

- Interactive diagram: https://gitdiagram.com/zachvivier/jot
- Repository: https://github.com/zachvivier/jot

## Overview

Jot is a native macOS plain-text and Markdown note editor. The main workflow is to create or open a note, edit it, and explicitly save it to ~/notes; the drawer lists saved notes and opens selected files. Markdown can be enabled per note and previewed, while notes can also be shared or moved to Trash. The graph reflects documented capabilities where excerpts are incomplete; save/load and some UI wiring are therefore represented only where supported by the README or sampled code.

Main entry points: [`Sources/NoteWindowController.swift`](https://github.com/zachvivier/jot/blob/main/Sources/NoteWindowController.swift) (Note window), [`Sources/AppDelegate.swift`](https://github.com/zachvivier/jot/blob/main/Sources/AppDelegate.swift) (App lifecycle), [`Sources/NoteStore.swift`](https://github.com/zachvivier/jot/blob/main/Sources/NoteStore.swift) (Note store), [`Sources/SidebarViews.swift`](https://github.com/zachvivier/jot/blob/main/Sources/SidebarViews.swift) (Sidebar views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and windows"]
  node_runtime["App entry<br/>[main.swift]"]
  node_appdelegate["App lifecycle<br/>[AppDelegate.swift]"]
  node_window["Note window"]
end

subgraph group_editing["Editing and preview"]
  node_editor["Text editor"]
  node_markdown["Markdown renderer"]
  node_preview["Markdown preview"]
end

subgraph group_notes["Notes and files"]
  node_store["Note store<br/>[NoteStore.swift]"]
  node_folder[("~/notes files")]
  node_openpanel["Open file panel<br/>[AppDelegate.swift]"]
end

subgraph group_sidebar["Drawer and sharing"]
  node_sidebar["Sidebar views<br/>[SidebarViews.swift]"]
  node_drawer["Notes drawer<br/>[SidebarViews.swift]"]
  node_shortcuts["Shortcuts panel<br/>[SidebarViews.swift]"]
  node_share["macOS share services"]
end

node_user(("User"))
node_finder["Finder"]

node_user -->|"launches"| node_runtime
node_runtime -->|"starts"| node_appdelegate
node_appdelegate -->|"creates windows"| node_window
node_user -->|"requests new or open"| node_appdelegate
node_appdelegate -->|"presents"| node_openpanel
node_appdelegate -->|"loads file"| node_window
node_user -->|"edits text"| node_editor
node_editor -->|"marks changes"| node_window
node_user -->|"saves note"| node_window
node_window -->|"saves or trashes"| node_store
node_store -->|"writes and lists"| node_folder
node_window -->|"loads note list"| node_store
node_window -->|"renders source"| node_markdown
node_markdown -->|"returns styled text"| node_preview
node_user -->|"opens panels"| node_sidebar
node_window -->|"shows panels"| node_sidebar
node_sidebar -->|"provides"| node_drawer
node_sidebar -->|"provides"| node_shortcuts
node_drawer -->|"reloads notes"| node_store
node_drawer -->|"requests note open"| node_appdelegate
node_window -.->|"offers note"| node_share
node_appdelegate -->|"opens notes folder"| node_finder
node_appdelegate -->|"ensures folder"| node_store

click node_runtime "https://github.com/zachvivier/jot/blob/main/Sources/main.swift"
click node_appdelegate "https://github.com/zachvivier/jot/blob/main/Sources/AppDelegate.swift"
click node_window "https://github.com/zachvivier/jot/blob/main/Sources/NoteWindowController.swift"
click node_editor "https://github.com/zachvivier/jot/blob/main/Sources/NoteWindowController.swift"
click node_markdown "https://github.com/zachvivier/jot/blob/main/Sources/MarkdownRenderer.swift"
click node_preview "https://github.com/zachvivier/jot/blob/main/Sources/NoteWindowController.swift"
click node_store "https://github.com/zachvivier/jot/blob/main/Sources/NoteStore.swift"
click node_openpanel "https://github.com/zachvivier/jot/blob/main/Sources/AppDelegate.swift"
click node_sidebar "https://github.com/zachvivier/jot/blob/main/Sources/SidebarViews.swift"
click node_drawer "https://github.com/zachvivier/jot/blob/main/Sources/SidebarViews.swift"
click node_shortcuts "https://github.com/zachvivier/jot/blob/main/Sources/SidebarViews.swift"

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_runtime,node_appdelegate,node_window,node_user toneBlue
class node_editor,node_markdown,node_preview toneAmber
class node_store,node_folder,node_openpanel toneMint
class node_sidebar,node_drawer,node_shortcuts,node_share toneRose
class node_finder toneIndigo
```

## Components

### App and windows

- [App entry](https://github.com/zachvivier/jot/blob/main/Sources/main.swift): `Sources/main.swift`
- [App lifecycle](https://github.com/zachvivier/jot/blob/main/Sources/AppDelegate.swift): `Sources/AppDelegate.swift`
- [Note window](https://github.com/zachvivier/jot/blob/main/Sources/NoteWindowController.swift): `Sources/NoteWindowController.swift`

### Editing and preview

- [Text editor](https://github.com/zachvivier/jot/blob/main/Sources/NoteWindowController.swift): `Sources/NoteWindowController.swift`
- [Markdown renderer](https://github.com/zachvivier/jot/blob/main/Sources/MarkdownRenderer.swift): `Sources/MarkdownRenderer.swift`
- [Markdown preview](https://github.com/zachvivier/jot/blob/main/Sources/NoteWindowController.swift): `Sources/NoteWindowController.swift`

### Notes and files

- [Note store](https://github.com/zachvivier/jot/blob/main/Sources/NoteStore.swift): `Sources/NoteStore.swift`
- **~/notes files**
- [Open file panel](https://github.com/zachvivier/jot/blob/main/Sources/AppDelegate.swift): `Sources/AppDelegate.swift`

### Drawer and sharing

- [Sidebar views](https://github.com/zachvivier/jot/blob/main/Sources/SidebarViews.swift): `Sources/SidebarViews.swift`
- [Notes drawer](https://github.com/zachvivier/jot/blob/main/Sources/SidebarViews.swift): `Sources/SidebarViews.swift`
- [Shortcuts panel](https://github.com/zachvivier/jot/blob/main/Sources/SidebarViews.swift): `Sources/SidebarViews.swift`
- **macOS share services**

### Other components

- **User**
- **Finder**

## Connections

- User → App entry: launches
- App entry → App lifecycle: starts
- App lifecycle → Note window: creates windows
- User → App lifecycle: requests new or open
- App lifecycle → Open file panel: presents
- App lifecycle → Note window: loads file
- User → Text editor: edits text
- Text editor → Note window: marks changes
- User → Note window: saves note
- Note window → Note store: saves or trashes
- Note store → ~/notes files: writes and lists
- Note window → Note store: loads note list
- Note window → Markdown renderer: renders source
- Markdown renderer → Markdown preview: returns styled text
- User → Sidebar views: opens panels
- Note window → Sidebar views: shows panels
- Sidebar views → Notes drawer: provides
- Sidebar views → Shortcuts panel: provides
- Notes drawer → Note store: reloads notes
- Notes drawer → App lifecycle: requests note open
- Note window → macOS share services: offers note
- App lifecycle → Finder: opens notes folder
- App lifecycle → Note store: ensures folder
