# wccwcm/klic-calendar architecture

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

- Interactive diagram: https://gitdiagram.com/wccwcm/klic-calendar
- Repository: https://github.com/wccwcm/klic-calendar

## Overview

Calendar is a local-first desktop app for calendars, notes, and recurring life records. The main path runs from the Dioxus interface through the application command service and use cases to domain models and SQLite, with provider integrations available for synchronization. The README also identifies notes, life dashboards, imports/exports, and AI as product capabilities; paths for unsampled branches are included only where the tree supports them. Edges reflect explicit README or excerpt/index evidence; unsampled wiring is omitted.

Main entry points: [`crates/application/src/service.rs`](https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/service.rs) (Command service), [`app/src/views.rs`](https://github.com/wccwcm/klic-calendar/blob/main/app/src/views.rs) (Calendar and panels), [`crates/application/src/sync/coordinator.rs`](https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/sync/coordinator.rs) (Sync coordination), [`crates/ai/src/rig_engine.rs`](https://github.com/wccwcm/klic-calendar/blob/main/crates/ai/src/rig_engine.rs) (LLM engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop experience"]
  node_shell["Dioxus shell<br/>[main.rs]"]
  node_views["Calendar and panels<br/>[views.rs]"]
  node_state["UI state<br/>[state.rs]"]
  node_viewmodel["View shaping<br/>[viewmodel.rs]"]
  node_notes_ui["Notes workspace<br/>[note_workspace.rs]"]
  node_editor["Markdown editor<br/>[index.js]"]
  node_ai_panel["AI panel<br/>[ai_panel.rs]"]
end

subgraph group_app["Application workflows"]
  node_service["Command service<br/>[service.rs]"]
  node_calendar_uc["Calendar workflows<br/>[create_event.rs]"]
  node_tasks_uc["Task workflows<br/>[manage_tasks.rs]"]
  node_life_uc["Life records and insights<br/>[manage_life.rs]"]
  node_life_io["Life import and export<br/>[life_io.rs]"]
  node_sync["Sync coordination<br/>[coordinator.rs]"]
end

subgraph group_data["Domain and persistence"]
  node_domain["Domain models<br/>[event.rs]"]
  node_store[("SQLite store<br/>[db.rs]")]
  node_event_repo["Event persistence"]
  node_note_repo["Note persistence<br/>[note_repository.rs]"]
  node_life_repo["Life persistence<br/>[life_repository.rs]"]
end

subgraph group_providers["External integrations"]
  node_google["Google providers<br/>[provider.rs]"]
  node_caldav["CalDAV provider<br/>[lib.rs]"]
  node_ics["ICS import/export<br/>[lib.rs]"]
  node_microsoft["Microsoft provider<br/>[provider.rs]"]
end

subgraph group_ai["AI assistance"]
  node_ai_engine["LLM engine<br/>[rig_engine.rs]"]
  node_mcp["MCP tools<br/>[mcp.rs]"]
end

node_person(("User"))
node_remote{{"Calendar services"}}
node_llm{{"LLM services"}}

node_person -->|"uses"| node_views
node_shell -->|"dispatches commands"| node_service
node_views -->|"requests data"| node_service
node_views -->|"updates"| node_state
node_views -->|"shapes results"| node_viewmodel
node_notes_ui -->|"embeds"| node_editor
node_service -->|"dispatches"| node_calendar_uc
node_service -->|"dispatches"| node_tasks_uc
node_service -.->|"dispatches"| node_life_uc
node_life_uc -.->|"uses"| node_life_io
node_calendar_uc -.->|"applies rules"| node_domain
node_tasks_uc -->|"updates tasks"| node_domain
node_service -->|"reads and writes"| node_event_repo
node_service -->|"reads and writes"| node_note_repo
node_service -->|"uses port"| node_life_repo
node_event_repo -->|"persists"| node_store
node_note_repo -->|"persists"| node_store
node_sync -.->|"dispatches sync"| node_google
node_sync -.->|"dispatches sync"| node_caldav
node_sync -.->|"dispatches sync"| node_microsoft
node_ics -.->|"imports or exports"| node_person
node_google -.->|"syncs with"| node_remote
node_caldav -.->|"syncs with"| node_remote
node_microsoft -.->|"integrates"| node_remote
node_ai_panel -.->|"requests assistance"| node_ai_engine
node_ai_engine -->|"connects tools"| node_mcp
node_ai_engine -.->|"sends prompt"| node_llm

click node_shell "https://github.com/wccwcm/klic-calendar/blob/main/app/src/main.rs"
click node_views "https://github.com/wccwcm/klic-calendar/blob/main/app/src/views.rs"
click node_state "https://github.com/wccwcm/klic-calendar/blob/main/app/src/state.rs"
click node_viewmodel "https://github.com/wccwcm/klic-calendar/blob/main/app/src/viewmodel.rs"
click node_notes_ui "https://github.com/wccwcm/klic-calendar/blob/main/app/src/components/note_workspace.rs"
click node_editor "https://github.com/wccwcm/klic-calendar/blob/main/app/editor/src/index.js"
click node_service "https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/service.rs"
click node_calendar_uc "https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/usecases/create_event.rs"
click node_tasks_uc "https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/usecases/manage_tasks.rs"
click node_life_uc "https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/usecases/manage_life.rs"
click node_life_io "https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/usecases/life_io.rs"
click node_sync "https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/sync/coordinator.rs"
click node_domain "https://github.com/wccwcm/klic-calendar/blob/main/crates/domain/src/event.rs"
click node_store "https://github.com/wccwcm/klic-calendar/blob/main/crates/storage/src/db.rs"
click node_event_repo "https://github.com/wccwcm/klic-calendar/blob/main/crates/storage/src/event_repository.rs"
click node_note_repo "https://github.com/wccwcm/klic-calendar/blob/main/crates/storage/src/note_repository.rs"
click node_life_repo "https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/ports/life_repository.rs"
click node_google "https://github.com/wccwcm/klic-calendar/blob/main/crates/provider-google/src/provider.rs"
click node_caldav "https://github.com/wccwcm/klic-calendar/blob/main/crates/provider-caldav/src/lib.rs"
click node_ics "https://github.com/wccwcm/klic-calendar/blob/main/crates/provider-ics/src/lib.rs"
click node_microsoft "https://github.com/wccwcm/klic-calendar/blob/main/crates/provider-microsoft/src/provider.rs"
click node_ai_panel "https://github.com/wccwcm/klic-calendar/blob/main/app/src/components/ai_panel.rs"
click node_ai_engine "https://github.com/wccwcm/klic-calendar/blob/main/crates/ai/src/rig_engine.rs"
click node_mcp "https://github.com/wccwcm/klic-calendar/blob/main/crates/ai/src/mcp.rs"

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_shell,node_views,node_state,node_viewmodel,node_notes_ui,node_editor,node_ai_panel,node_person toneBlue
class node_service,node_calendar_uc,node_tasks_uc,node_life_uc,node_life_io,node_sync toneAmber
class node_domain,node_store,node_event_repo,node_note_repo,node_life_repo toneMint
class node_google,node_caldav,node_ics,node_microsoft toneRose
class node_ai_engine,node_mcp,node_remote,node_llm toneIndigo
```

## Components

### Desktop experience

- [Dioxus shell](https://github.com/wccwcm/klic-calendar/blob/main/app/src/main.rs): `app/src/main.rs`
- [Calendar and panels](https://github.com/wccwcm/klic-calendar/blob/main/app/src/views.rs): `app/src/views.rs`
- [UI state](https://github.com/wccwcm/klic-calendar/blob/main/app/src/state.rs): `app/src/state.rs`
- [View shaping](https://github.com/wccwcm/klic-calendar/blob/main/app/src/viewmodel.rs): `app/src/viewmodel.rs`
- [Notes workspace](https://github.com/wccwcm/klic-calendar/blob/main/app/src/components/note_workspace.rs): `app/src/components/note_workspace.rs`
- [Markdown editor](https://github.com/wccwcm/klic-calendar/blob/main/app/editor/src/index.js): `app/editor/src/index.js`
- [AI panel](https://github.com/wccwcm/klic-calendar/blob/main/app/src/components/ai_panel.rs): `app/src/components/ai_panel.rs`

### Application workflows

- [Command service](https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/service.rs): `crates/application/src/service.rs`
- [Calendar workflows](https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/usecases/create_event.rs): `crates/application/src/usecases/create_event.rs`
- [Task workflows](https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/usecases/manage_tasks.rs): `crates/application/src/usecases/manage_tasks.rs`
- [Life records and insights](https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/usecases/manage_life.rs): `crates/application/src/usecases/manage_life.rs`
- [Life import and export](https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/usecases/life_io.rs): `crates/application/src/usecases/life_io.rs`
- [Sync coordination](https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/sync/coordinator.rs): `crates/application/src/sync/coordinator.rs`

### Domain and persistence

- [Domain models](https://github.com/wccwcm/klic-calendar/blob/main/crates/domain/src/event.rs): `crates/domain/src/event.rs`
- [SQLite store](https://github.com/wccwcm/klic-calendar/blob/main/crates/storage/src/db.rs): `crates/storage/src/db.rs`
- [Event persistence](https://github.com/wccwcm/klic-calendar/blob/main/crates/storage/src/event_repository.rs): `crates/storage/src/event_repository.rs`
- [Note persistence](https://github.com/wccwcm/klic-calendar/blob/main/crates/storage/src/note_repository.rs): `crates/storage/src/note_repository.rs`
- [Life persistence](https://github.com/wccwcm/klic-calendar/blob/main/crates/application/src/ports/life_repository.rs): `crates/application/src/ports/life_repository.rs`

### External integrations

- [Google providers](https://github.com/wccwcm/klic-calendar/blob/main/crates/provider-google/src/provider.rs): `crates/provider-google/src/provider.rs`
- [CalDAV provider](https://github.com/wccwcm/klic-calendar/blob/main/crates/provider-caldav/src/lib.rs): `crates/provider-caldav/src/lib.rs`
- [ICS import/export](https://github.com/wccwcm/klic-calendar/blob/main/crates/provider-ics/src/lib.rs): `crates/provider-ics/src/lib.rs`
- [Microsoft provider](https://github.com/wccwcm/klic-calendar/blob/main/crates/provider-microsoft/src/provider.rs): `crates/provider-microsoft/src/provider.rs`

### AI assistance

- [LLM engine](https://github.com/wccwcm/klic-calendar/blob/main/crates/ai/src/rig_engine.rs): `crates/ai/src/rig_engine.rs`
- [MCP tools](https://github.com/wccwcm/klic-calendar/blob/main/crates/ai/src/mcp.rs): `crates/ai/src/mcp.rs`

### Other components

- **User**
- **Calendar services**
- **LLM services**

## Connections

- User → Calendar and panels: uses (evidence: `README.md`)
- Dioxus shell → Command service: dispatches commands (evidence: `app/src/main.rs`)
- Calendar and panels → Command service: requests data (evidence: `app/src/views.rs`)
- Calendar and panels → UI state: updates (evidence: `app/src/views.rs`)
- Calendar and panels → View shaping: shapes results (evidence: `app/src/views.rs`)
- Notes workspace → Markdown editor: embeds (evidence: `README.md`)
- Command service → Calendar workflows: dispatches (evidence: `crates/application/src/service.rs`)
- Command service → Task workflows: dispatches (evidence: `crates/application/src/service.rs`)
- Command service → Life records and insights: dispatches (evidence: `crates/application/src/service.rs`)
- Life records and insights → Life import and export: uses
- Calendar workflows → Domain models: applies rules
- Task workflows → Domain models: updates tasks (evidence: `crates/application/src/usecases/manage_tasks.rs`)
- Command service → Event persistence: reads and writes (evidence: `crates/application/src/service.rs`)
- Command service → Note persistence: reads and writes (evidence: `crates/application/src/service.rs`)
- Command service → Life persistence: uses port (evidence: `crates/application/src/service.rs`)
- Event persistence → SQLite store: persists (evidence: `crates/storage/src/event_repository.rs`)
- Note persistence → SQLite store: persists (evidence: `crates/storage/src/note_repository.rs`)
- Sync coordination → Google providers: dispatches sync
- Sync coordination → CalDAV provider: dispatches sync
- Sync coordination → Microsoft provider: dispatches sync
- ICS import/export → User: imports or exports (evidence: `README.md`)
- Google providers → Calendar services: syncs with (evidence: `README.md`)
- CalDAV provider → Calendar services: syncs with (evidence: `README.md`)
- Microsoft provider → Calendar services: integrates (evidence: `README.md`)
- AI panel → LLM engine: requests assistance
- LLM engine → MCP tools: connects tools (evidence: `crates/ai/src/rig_engine.rs`)
- LLM engine → LLM services: sends prompt
