# enigmaspy/atomnote architecture

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

- Interactive diagram: https://gitdiagram.com/enigmaspy/atomnote
- Repository: https://github.com/enigmaspy/atomnote

## Overview

AtomNote is an Electron knowledge-management environment for organizing a worldline as atoms and note-like electrons, with graph navigation, Markdown editing, structural warnings, and study tools. The main workflow runs from the Garden UI through the preload/IPC boundary to directory parsing and note access; parsed data then drives navigation, editing, and study. The README documents safe metadata IPC and a two-level directory rule. Some IPC handlers, storage services, and graph/study views were not excerpted, so uncertain implementation links are omitted.

Main entry points: [`src/renderer/src/views/GardenView.tsx`](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/views/GardenView.tsx) (Garden view), [`src/main/index.ts`](https://github.com/enigmaspy/atomnote/blob/main/src/main/index.ts) (Main process), [`src/main/services/worldline/worldline-parser.ts`](https://github.com/enigmaspy/atomnote/blob/main/src/main/services/worldline/worldline-parser.ts) (Worldline parser), [`src/main/services/atom/atom-parser.ts`](https://github.com/enigmaspy/atomnote/blob/main/src/main/services/atom/atom-parser.ts) (Atom parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_renderer["Garden interface"]
  node_garden["Garden view<br/>[GardenView.tsx]"]
  node_editor["Note editor<br/>[NoteEditor.tsx]"]
  node_note_meta["Note metadata<br/>[NoteMeta.tsx]"]
  node_worldline_nav["Worldline navigation<br/>[WorldlineNav.tsx]"]
  node_atoms_tree["Atoms tree<br/>[AtomsTree.tsx]"]
  node_worldline_graph["Worldline graph<br/>[WorldlineGraph.tsx]"]
  node_create_atom["Create atom UI"]
  node_worldline_store["Worldline state<br/>[worldlineStore.ts]"]
end

subgraph group_boundary["Electron boundary"]
  node_main_process["Main process<br/>[index.ts]"]
  node_preload["Preload bridge<br/>[index.ts]"]
  node_worldline_ipc["Worldline IPC<br/>[worldline.ipc.ts]"]
  node_electron_ipc["Note file IPC<br/>[electron.ipc.ts]"]
  node_study_ipc["Study IPC<br/>[study.ipc.ts]"]
  node_helpers_ipc["Path helper IPC<br/>[helpers.ipc.ts]"]
end

subgraph group_domain["Worldline parsing"]
  node_worldline_parser["Worldline parser"]
  node_atom_parser["Atom parser<br/>[atom-parser.ts]"]
  node_electron_parser["Electron parser<br/>[electron-parser.ts]"]
end

subgraph group_study["Study workflow"]
  node_study_sync["Study sync"]
  node_study_store["Study state<br/>[studyStore.ts]"]
  node_flashcard_session["Flashcard session"]
  node_flashcard_preview["Flashcard preview"]
  node_quiz_preview["Quiz preview<br/>[QuizPreview.tsx]"]
end

subgraph group_shared["Shared contracts"]
  node_ipc_contract["IPC contract<br/>[ipc-contract.ts]"]
  node_json_storage["JSON metadata I/O<br/>[json.ts]"]
end

node_user(("User"))
node_worldline_files[("Worldline files")]

node_user -->|"uses"| node_garden
node_garden -->|"renders"| node_editor
node_garden -->|"renders"| node_note_meta
node_garden -->|"renders"| node_worldline_nav
node_garden -->|"renders"| node_worldline_graph
node_garden -->|"renders"| node_create_atom
node_garden -->|"wraps"| node_study_sync
node_garden -->|"renders"| node_flashcard_session
node_garden -->|"renders"| node_flashcard_preview
node_garden -->|"renders"| node_quiz_preview
node_worldline_nav -->|"renders"| node_atoms_tree
node_study_sync -->|"reads selection"| node_worldline_store
node_study_sync -->|"loads study"| node_study_store
node_main_process -->|"registers"| node_worldline_ipc
node_main_process -->|"registers"| node_electron_ipc
node_main_process -->|"registers"| node_study_ipc
node_main_process -->|"registers"| node_helpers_ipc
node_preload -->|"uses channels"| node_ipc_contract
node_worldline_ipc -->|"invokes parse"| node_worldline_parser
node_worldline_parser -->|"parses atoms"| node_atom_parser
node_atom_parser -->|"parses notes"| node_electron_parser
node_worldline_parser -->|"reads metadata"| node_worldline_files
node_atom_parser -->|"reads and adopts metadata"| node_worldline_files

click node_garden "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/views/GardenView.tsx"
click node_editor "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/editor/NoteEditor.tsx"
click node_note_meta "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/editor/NoteMeta.tsx"
click node_worldline_nav "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/worldline/WorldlineNav.tsx"
click node_atoms_tree "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/worldline/AtomsTree.tsx"
click node_worldline_graph "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/graph/WorldlineGraph.tsx"
click node_create_atom "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/worldline/CreateAtomModal.tsx"
click node_worldline_store "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/store/worldlineStore.ts"
click node_main_process "https://github.com/enigmaspy/atomnote/blob/main/src/main/index.ts"
click node_preload "https://github.com/enigmaspy/atomnote/blob/main/src/preload/index.ts"
click node_worldline_ipc "https://github.com/enigmaspy/atomnote/blob/main/src/main/ipc/worldline.ipc.ts"
click node_electron_ipc "https://github.com/enigmaspy/atomnote/blob/main/src/main/ipc/electron.ipc.ts"
click node_study_ipc "https://github.com/enigmaspy/atomnote/blob/main/src/main/ipc/study.ipc.ts"
click node_helpers_ipc "https://github.com/enigmaspy/atomnote/blob/main/src/main/ipc/helpers.ipc.ts"
click node_worldline_parser "https://github.com/enigmaspy/atomnote/blob/main/src/main/services/worldline/worldline-parser.ts"
click node_atom_parser "https://github.com/enigmaspy/atomnote/blob/main/src/main/services/atom/atom-parser.ts"
click node_electron_parser "https://github.com/enigmaspy/atomnote/blob/main/src/main/services/electron/electron-parser.ts"
click node_study_sync "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/providers/StudySyncManager.tsx"
click node_study_store "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/store/studyStore.ts"
click node_flashcard_session "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/Study/FlashcardSession.tsx"
click node_flashcard_preview "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/Study/FlashcardsPreview.tsx"
click node_quiz_preview "https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/Study/QuizPreview.tsx"
click node_ipc_contract "https://github.com/enigmaspy/atomnote/blob/main/src/shared/ipc-contract.ts"
click node_json_storage "https://github.com/enigmaspy/atomnote/blob/main/src/shared/utils/json.ts"

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_garden,node_editor,node_note_meta,node_worldline_nav,node_atoms_tree,node_worldline_graph,node_create_atom,node_worldline_store,node_user toneBlue
class node_main_process,node_preload,node_worldline_ipc,node_electron_ipc,node_study_ipc,node_helpers_ipc,node_worldline_files toneAmber
class node_worldline_parser,node_atom_parser,node_electron_parser toneMint
class node_study_sync,node_study_store,node_flashcard_session,node_flashcard_preview,node_quiz_preview toneRose
class node_ipc_contract,node_json_storage toneIndigo
```

## Components

### Garden interface

- [Garden view](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/views/GardenView.tsx): `src/renderer/src/views/GardenView.tsx`
- [Note editor](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/editor/NoteEditor.tsx): `src/renderer/src/components/editor/NoteEditor.tsx`
- [Note metadata](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/editor/NoteMeta.tsx): `src/renderer/src/components/editor/NoteMeta.tsx`
- [Worldline navigation](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/worldline/WorldlineNav.tsx): `src/renderer/src/components/worldline/WorldlineNav.tsx`
- [Atoms tree](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/worldline/AtomsTree.tsx): `src/renderer/src/components/worldline/AtomsTree.tsx`
- [Worldline graph](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/graph/WorldlineGraph.tsx): `src/renderer/src/components/graph/WorldlineGraph.tsx`
- [Create atom UI](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/worldline/CreateAtomModal.tsx): `src/renderer/src/components/worldline/CreateAtomModal.tsx`
- [Worldline state](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/store/worldlineStore.ts): `src/renderer/src/store/worldlineStore.ts`

### Electron boundary

- [Main process](https://github.com/enigmaspy/atomnote/blob/main/src/main/index.ts): `src/main/index.ts`
- [Preload bridge](https://github.com/enigmaspy/atomnote/blob/main/src/preload/index.ts): `src/preload/index.ts`
- [Worldline IPC](https://github.com/enigmaspy/atomnote/blob/main/src/main/ipc/worldline.ipc.ts): `src/main/ipc/worldline.ipc.ts`
- [Note file IPC](https://github.com/enigmaspy/atomnote/blob/main/src/main/ipc/electron.ipc.ts): `src/main/ipc/electron.ipc.ts`
- [Study IPC](https://github.com/enigmaspy/atomnote/blob/main/src/main/ipc/study.ipc.ts): `src/main/ipc/study.ipc.ts`
- [Path helper IPC](https://github.com/enigmaspy/atomnote/blob/main/src/main/ipc/helpers.ipc.ts): `src/main/ipc/helpers.ipc.ts`

### Worldline parsing

- [Worldline parser](https://github.com/enigmaspy/atomnote/blob/main/src/main/services/worldline/worldline-parser.ts): `src/main/services/worldline/worldline-parser.ts`
- [Atom parser](https://github.com/enigmaspy/atomnote/blob/main/src/main/services/atom/atom-parser.ts): `src/main/services/atom/atom-parser.ts`
- [Electron parser](https://github.com/enigmaspy/atomnote/blob/main/src/main/services/electron/electron-parser.ts): `src/main/services/electron/electron-parser.ts`

### Study workflow

- [Study sync](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/providers/StudySyncManager.tsx): `src/renderer/src/components/providers/StudySyncManager.tsx`
- [Study state](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/store/studyStore.ts): `src/renderer/src/store/studyStore.ts`
- [Flashcard session](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/Study/FlashcardSession.tsx): `src/renderer/src/components/Study/FlashcardSession.tsx`
- [Flashcard preview](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/Study/FlashcardsPreview.tsx): `src/renderer/src/components/Study/FlashcardsPreview.tsx`
- [Quiz preview](https://github.com/enigmaspy/atomnote/blob/main/src/renderer/src/components/Study/QuizPreview.tsx): `src/renderer/src/components/Study/QuizPreview.tsx`

### Shared contracts

- [IPC contract](https://github.com/enigmaspy/atomnote/blob/main/src/shared/ipc-contract.ts): `src/shared/ipc-contract.ts`
- [JSON metadata I/O](https://github.com/enigmaspy/atomnote/blob/main/src/shared/utils/json.ts): `src/shared/utils/json.ts`

### Other components

- **User**
- **Worldline files**

## Connections

- User → Garden view: uses
- Garden view → Note editor: renders (evidence: `src/renderer/src/views/GardenView.tsx`)
- Garden view → Note metadata: renders (evidence: `src/renderer/src/views/GardenView.tsx`)
- Garden view → Worldline navigation: renders (evidence: `src/renderer/src/views/GardenView.tsx`)
- Garden view → Worldline graph: renders (evidence: `src/renderer/src/views/GardenView.tsx`)
- Garden view → Create atom UI: renders (evidence: `src/renderer/src/views/GardenView.tsx`)
- Garden view → Study sync: wraps (evidence: `src/renderer/src/views/GardenView.tsx`)
- Garden view → Flashcard session: renders (evidence: `src/renderer/src/views/GardenView.tsx`)
- Garden view → Flashcard preview: renders (evidence: `src/renderer/src/views/GardenView.tsx`)
- Garden view → Quiz preview: renders (evidence: `src/renderer/src/views/GardenView.tsx`)
- Worldline navigation → Atoms tree: renders (evidence: `src/renderer/src/components/worldline/WorldlineNav.tsx`)
- Study sync → Worldline state: reads selection (evidence: `src/renderer/src/components/providers/StudySyncManager.tsx`)
- Study sync → Study state: loads study (evidence: `src/renderer/src/components/providers/StudySyncManager.tsx`)
- Main process → Worldline IPC: registers (evidence: `src/main/index.ts`)
- Main process → Note file IPC: registers (evidence: `src/main/index.ts`)
- Main process → Study IPC: registers (evidence: `src/main/index.ts`)
- Main process → Path helper IPC: registers (evidence: `src/main/index.ts`)
- Preload bridge → IPC contract: uses channels (evidence: `src/preload/index.ts`)
- Worldline IPC → Worldline parser: invokes parse (evidence: `src/main/ipc/worldline.ipc.ts`)
- Worldline parser → Atom parser: parses atoms (evidence: `src/main/services/worldline/worldline-parser.ts`)
- Atom parser → Electron parser: parses notes (evidence: `src/main/services/atom/atom-parser.ts`)
- Worldline parser → Worldline files: reads metadata (evidence: `src/main/services/worldline/worldline-parser.ts`)
- Atom parser → Worldline files: reads and adopts metadata (evidence: `src/main/services/atom/atom-parser.ts`)
