# liamcain/obsidian-calendar-plugin architecture

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

- Interactive diagram: https://gitdiagram.com/liamcain/obsidian-calendar-plugin
- Repository: https://github.com/liamcain/obsidian-calendar-plugin

## Overview

This Obsidian plugin provides a calendar for navigating daily notes, creating missing notes, and visualizing note metadata; optional weekly-note support adds a parallel calendar workflow. The user opens the calendar, selects a day or week, and the view opens an existing note or delegates creation. Calendar metadata sources add writing, task, streak, and tag indicators. The graph reflects the sampled runtime and README capabilities; creation internals and some integration details are represented only at their documented or imported boundaries.

Main entry points: [`src/view.ts`](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/view.ts) (Calendar view), [`src/ui/stores.ts`](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/stores.ts) (Note and selection stores), [`src/ui/sources/index.ts`](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/index.ts) (Source registry), [`src/main.ts`](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/main.ts) (Plugin entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Plugin lifecycle"]
  node_plugin["Plugin entry<br/>[main.ts]"]
  node_settings["Plugin settings<br/>[settings.ts]"]
end

subgraph group_calendar["Calendar interaction"]
  node_view["Calendar view<br/>[view.ts]"]
  node_calendar_ui["Calendar UI<br/>[Calendar.svelte]"]
  node_file_menu["Note context menu<br/>[fileMenu.ts]"]
end

subgraph group_notes["Note workflows"]
  node_daily_io["Daily note creation<br/>[dailyNotes.ts]"]
  node_weekly_io["Weekly note creation<br/>[weeklyNotes.ts]"]
  node_confirm_modal["Creation confirmation<br/>[modal.ts]"]
end

subgraph group_metadata["Calendar metadata"]
  node_note_stores[("Note and selection stores<br/>[stores.ts]")]
  node_streak["Note presence<br/>[streak.ts]"]
  node_tags["Tag markers<br/>[tags.ts]"]
  node_tasks["Incomplete tasks<br/>[tasks.ts]"]
  node_word_count["Writing meter<br/>[wordCount.ts]"]
  node_source_utils["Metadata utilities<br/>[utils.ts]"]
  node_source_registry["Source registry<br/>[index.ts]"]
end

node_user(("Obsidian user"))
node_host["Obsidian host"]
node_daily_notes_api["Daily notes interface"]

node_user -->|"uses"| node_host
node_host -->|"loads"| node_plugin
node_plugin -->|"registers view"| node_view
node_plugin -->|"adds settings"| node_settings
node_user -->|"navigates calendar"| node_view
node_view -->|"renders"| node_calendar_ui
node_view -->|"imports sources"| node_source_registry
node_source_registry -->|"exports source"| node_streak
node_source_registry -->|"exports source"| node_tags
node_source_registry -->|"exports source"| node_tasks
node_source_registry -->|"exports source"| node_word_count
node_view -->|"creates daily note"| node_daily_io
node_view -->|"creates weekly note"| node_weekly_io
node_view -->|"shows menu"| node_file_menu
node_view -->|"reads and updates"| node_note_stores
node_calendar_ui -->|"reads calendar state"| node_note_stores
node_plugin -->|"subscribes settings"| node_note_stores
node_settings -->|"writes options"| node_plugin
node_note_stores -->|"indexes notes"| node_daily_notes_api
node_streak -->|"reads note indexes"| node_note_stores
node_tags -->|"reads note indexes"| node_note_stores
node_tasks -->|"reads note indexes"| node_note_stores
node_word_count -->|"reads note indexes"| node_note_stores
node_streak -->|"uses classes"| node_source_utils
node_tags -->|"partitions tags"| node_source_utils
node_word_count -->|"counts and clamps"| node_source_utils
node_user -->|"creates missing note"| node_daily_io
node_user -->|"opens weekly note"| node_weekly_io
node_daily_io -.->|"may confirm"| node_confirm_modal

click node_plugin "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/main.ts"
click node_settings "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/settings.ts"
click node_view "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/view.ts"
click node_calendar_ui "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/Calendar.svelte"
click node_file_menu "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/fileMenu.ts"
click node_note_stores "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/stores.ts"
click node_daily_io "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/io/dailyNotes.ts"
click node_weekly_io "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/io/weeklyNotes.ts"
click node_confirm_modal "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/modal.ts"
click node_streak "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/streak.ts"
click node_tags "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/tags.ts"
click node_tasks "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/tasks.ts"
click node_word_count "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/wordCount.ts"
click node_source_utils "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/utils.ts"
click node_source_registry "https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/index.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_plugin,node_settings,node_user toneBlue
class node_view,node_calendar_ui,node_file_menu toneAmber
class node_daily_io,node_weekly_io,node_confirm_modal toneMint
class node_note_stores,node_streak,node_tags,node_tasks,node_word_count,node_source_utils,node_source_registry toneRose
class node_host,node_daily_notes_api toneIndigo
```

## Components

### Plugin lifecycle

- [Plugin entry](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/main.ts): `src/main.ts`
- [Plugin settings](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/settings.ts): `src/settings.ts`

### Calendar interaction

- [Calendar view](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/view.ts): `src/view.ts`
- [Calendar UI](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/Calendar.svelte): `src/ui/Calendar.svelte`
- [Note context menu](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/fileMenu.ts): `src/ui/fileMenu.ts`

### Note workflows

- [Daily note creation](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/io/dailyNotes.ts): `src/io/dailyNotes.ts`
- [Weekly note creation](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/io/weeklyNotes.ts): `src/io/weeklyNotes.ts`
- [Creation confirmation](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/modal.ts): `src/ui/modal.ts`

### Calendar metadata

- [Note and selection stores](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/stores.ts): `src/ui/stores.ts`
- [Note presence](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/streak.ts): `src/ui/sources/streak.ts`
- [Tag markers](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/tags.ts): `src/ui/sources/tags.ts`
- [Incomplete tasks](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/tasks.ts): `src/ui/sources/tasks.ts`
- [Writing meter](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/wordCount.ts): `src/ui/sources/wordCount.ts`
- [Metadata utilities](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/utils.ts): `src/ui/utils.ts`
- [Source registry](https://github.com/liamcain/obsidian-calendar-plugin/blob/master/src/ui/sources/index.ts): `src/ui/sources/index.ts`

### Other components

- **Obsidian user**
- **Obsidian host**
- **Daily notes interface**

## Connections

- Obsidian user → Obsidian host: uses (evidence: `README.md`)
- Obsidian host → Plugin entry: loads (evidence: `src/main.ts`)
- Plugin entry → Calendar view: registers view (evidence: `src/main.ts`)
- Plugin entry → Plugin settings: adds settings (evidence: `src/main.ts`)
- Obsidian user → Calendar view: navigates calendar (evidence: `README.md`)
- Calendar view → Calendar UI: renders (evidence: `src/view.ts`)
- Calendar view → Source registry: imports sources (evidence: `src/view.ts`)
- Source registry → Note presence: exports source (evidence: `src/ui/sources/index.ts`)
- Source registry → Tag markers: exports source (evidence: `src/ui/sources/index.ts`)
- Source registry → Incomplete tasks: exports source (evidence: `src/ui/sources/index.ts`)
- Source registry → Writing meter: exports source (evidence: `src/ui/sources/index.ts`)
- Calendar view → Daily note creation: creates daily note (evidence: `src/view.ts`)
- Calendar view → Weekly note creation: creates weekly note (evidence: `src/view.ts`)
- Calendar view → Note context menu: shows menu (evidence: `src/view.ts`)
- Calendar view → Note and selection stores: reads and updates (evidence: `src/view.ts`)
- Calendar UI → Note and selection stores: reads calendar state (evidence: `src/ui/Calendar.svelte`)
- Plugin entry → Note and selection stores: subscribes settings (evidence: `src/main.ts`)
- Plugin settings → Plugin entry: writes options (evidence: `src/settings.ts`)
- Note and selection stores → Daily notes interface: indexes notes (evidence: `src/ui/stores.ts`)
- Note presence → Note and selection stores: reads note indexes (evidence: `src/ui/sources/streak.ts`)
- Tag markers → Note and selection stores: reads note indexes (evidence: `src/ui/sources/tags.ts`)
- Incomplete tasks → Note and selection stores: reads note indexes (evidence: `src/ui/sources/tasks.ts`)
- Writing meter → Note and selection stores: reads note indexes (evidence: `src/ui/sources/wordCount.ts`)
- Note presence → Metadata utilities: uses classes (evidence: `src/ui/sources/streak.ts`)
- Tag markers → Metadata utilities: partitions tags (evidence: `src/ui/sources/tags.ts`)
- Writing meter → Metadata utilities: counts and clamps (evidence: `src/ui/sources/wordCount.ts`)
- Obsidian user → Daily note creation: creates missing note (evidence: `README.md`)
- Obsidian user → Weekly note creation: opens weekly note (evidence: `README.md`)
- Daily note creation → Creation confirmation: may confirm
