# eitaar/yot architecture

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

- Interactive diagram: https://gitdiagram.com/eitaar/yot
- Repository: https://github.com/eitaar/yot

## Overview

yot is a single-user calendar product: a browser user pairs with a PIN, then uses the Vue calendar UI to manage calendars, events, tags, imports, and images through the authenticated REST API. The backend services persist domain data in SQLite and publish changes to an event bus for the SSE feed. MCP exposes calendar tools over stdio and can relay mutations to the HTTP server’s feed. The graph retains documented OAuth, plugin, and ask capabilities; unsampled route internals are represented at their exact paths, and edges are limited to README or source-index evidence.

Main entry points: [`src/rest/mod.rs`](https://github.com/eitaar/yot/blob/main/src/rest/mod.rs) (REST router), [`src/mcp/server.rs`](https://github.com/eitaar/yot/blob/main/src/mcp/server.rs) (MCP tools), [`src/db/mod.rs`](https://github.com/eitaar/yot/blob/main/src/db/mod.rs) (SQLite database), [`src/services/event.rs`](https://github.com/eitaar/yot/blob/main/src/services/event.rs) (Event service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser application"]
  node_webapp["Vue application<br/>[App.vue]"]
  node_calendarui["Calendar views<br/>[CalendarView.vue]"]
  node_webapi["Web API client<br/>[client.ts]"]
  node_authui["Pairing UI<br/>[PairView.vue]"]
end

subgraph group_http["HTTP and identity"]
  node_rest["REST router<br/>[mod.rs]"]
  node_auth["API authentication<br/>[middleware.rs]"]
  node_pairing["PIN pairing<br/>[pairing.rs]"]
  node_oauth["OAuth endpoints<br/>[oauth.rs]"]
end

subgraph group_domain["Calendar services"]
  node_calroutes["Calendar routes<br/>[calendars.rs]"]
  node_eventroutes["Event routes<br/>[events.rs]"]
  node_importroutes["Import routes<br/>[import.rs]"]
  node_uploadroutes["Image uploads<br/>[uploads.rs]"]
  node_tagroutes["Tag routes<br/>[tags.rs]"]
  node_plugins["Plugin sources<br/>[plugins.rs]"]
  node_ask["Ask API<br/>[ask.rs]"]
  node_calendar["Calendar service<br/>[calendar.rs]"]
  node_events["Event service<br/>[event.rs]"]
  node_import["ICS import<br/>[import.rs]"]
  node_images["Image service<br/>[image.rs]"]
  node_tags["Tag service<br/>[tag.rs]"]
  node_pluginservice["Plugin service<br/>[plugin_source.rs]"]
end

subgraph group_realtime["Realtime and MCP"]
  node_bus["Event bus<br/>[event_bus.rs]"]
  node_stream["SSE feed<br/>[stream.rs]"]
  node_mcp["MCP tools<br/>[server.rs]"]
  node_relay["MCP SSE relay<br/>[relay.rs]"]
end

subgraph group_storage["Persistence"]
  node_db[("SQLite database<br/>[mod.rs]")]
  node_schema["Database schema<br/>[schema.rs]"]
end

node_user(("Calendar user"))

node_user -->|"uses"| node_webapp
node_webapp -.->|"renders"| node_calendarui
node_calendarui -.->|"requests"| node_webapi
node_webapp -.->|"offers pairing"| node_authui
node_webapi -->|"calls REST"| node_rest
node_authui -->|"redeems PIN"| node_rest
node_rest -->|"guards routes"| node_auth
node_rest -->|"routes to"| node_calroutes
node_rest -->|"routes to"| node_eventroutes
node_rest -->|"routes to"| node_importroutes
node_rest -->|"routes to"| node_uploadroutes
node_rest -->|"routes to"| node_tagroutes
node_rest -->|"routes to"| node_plugins
node_rest -->|"routes to"| node_ask
node_rest -->|"exposes"| node_oauth
node_auth -->|"authenticates via"| node_db
node_auth -->|"uses"| node_pairing
node_calroutes -->|"delegates"| node_calendar
node_eventroutes -->|"delegates"| node_events
node_importroutes -->|"delegates"| node_import
node_uploadroutes -->|"delegates"| node_images
node_tagroutes -->|"delegates"| node_tags
node_plugins -->|"uses"| node_pluginservice
node_calendar -->|"reads and writes"| node_db
node_events -->|"reads and writes"| node_db
node_events -->|"checks calendar"| node_calendar
node_import -->|"imports into"| node_db
node_images -.->|"stores metadata"| node_db
node_tags -->|"reads and writes"| node_db
node_pluginservice -->|"uses schema"| node_db
node_db -->|"initializes"| node_schema
node_rest -->|"routes to"| node_stream
node_stream -->|"streams events"| node_bus
node_user -->|"connects via stdio"| node_mcp
node_mcp -->|"calls"| node_calendar
node_mcp -->|"calls"| node_events
node_mcp -->|"calls"| node_import
node_mcp -->|"calls"| node_images
node_mcp -.->|"calls"| node_tags
node_mcp -->|"emits changes"| node_bus
node_relay -->|"subscribes"| node_bus
node_relay -->|"relays to feed"| node_stream

click node_webapp "https://github.com/eitaar/yot/blob/main/web/src/App.vue"
click node_calendarui "https://github.com/eitaar/yot/blob/main/web/src/views/CalendarView.vue"
click node_webapi "https://github.com/eitaar/yot/blob/main/web/src/api/client.ts"
click node_authui "https://github.com/eitaar/yot/blob/main/web/src/views/PairView.vue"
click node_rest "https://github.com/eitaar/yot/blob/main/src/rest/mod.rs"
click node_auth "https://github.com/eitaar/yot/blob/main/src/auth/middleware.rs"
click node_pairing "https://github.com/eitaar/yot/blob/main/src/auth/pairing.rs"
click node_oauth "https://github.com/eitaar/yot/blob/main/src/rest/oauth.rs"
click node_calroutes "https://github.com/eitaar/yot/blob/main/src/rest/calendars.rs"
click node_eventroutes "https://github.com/eitaar/yot/blob/main/src/rest/events.rs"
click node_importroutes "https://github.com/eitaar/yot/blob/main/src/rest/import.rs"
click node_uploadroutes "https://github.com/eitaar/yot/blob/main/src/rest/uploads.rs"
click node_tagroutes "https://github.com/eitaar/yot/blob/main/src/rest/tags.rs"
click node_plugins "https://github.com/eitaar/yot/blob/main/src/rest/plugins.rs"
click node_ask "https://github.com/eitaar/yot/blob/main/src/rest/ask.rs"
click node_calendar "https://github.com/eitaar/yot/blob/main/src/services/calendar.rs"
click node_events "https://github.com/eitaar/yot/blob/main/src/services/event.rs"
click node_import "https://github.com/eitaar/yot/blob/main/src/services/import.rs"
click node_images "https://github.com/eitaar/yot/blob/main/src/services/image.rs"
click node_tags "https://github.com/eitaar/yot/blob/main/src/services/tag.rs"
click node_pluginservice "https://github.com/eitaar/yot/blob/main/src/services/plugin_source.rs"
click node_db "https://github.com/eitaar/yot/blob/main/src/db/mod.rs"
click node_schema "https://github.com/eitaar/yot/blob/main/src/db/schema.rs"
click node_bus "https://github.com/eitaar/yot/blob/main/src/core/event_bus.rs"
click node_stream "https://github.com/eitaar/yot/blob/main/src/rest/stream.rs"
click node_mcp "https://github.com/eitaar/yot/blob/main/src/mcp/server.rs"
click node_relay "https://github.com/eitaar/yot/blob/main/src/mcp/relay.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_webapp,node_calendarui,node_webapi,node_authui,node_user toneBlue
class node_rest,node_auth,node_pairing,node_oauth toneAmber
class node_calroutes,node_eventroutes,node_importroutes,node_uploadroutes,node_tagroutes,node_plugins,node_ask,node_calendar,node_events,node_import,node_images,node_tags,node_pluginservice toneMint
class node_bus,node_stream,node_mcp,node_relay toneRose
class node_db,node_schema toneIndigo
```

## Components

### Browser application

- [Vue application](https://github.com/eitaar/yot/blob/main/web/src/App.vue): `web/src/App.vue`
- [Calendar views](https://github.com/eitaar/yot/blob/main/web/src/views/CalendarView.vue): `web/src/views/CalendarView.vue`
- [Web API client](https://github.com/eitaar/yot/blob/main/web/src/api/client.ts): `web/src/api/client.ts`
- [Pairing UI](https://github.com/eitaar/yot/blob/main/web/src/views/PairView.vue): `web/src/views/PairView.vue`

### HTTP and identity

- [REST router](https://github.com/eitaar/yot/blob/main/src/rest/mod.rs): `src/rest/mod.rs`
- [API authentication](https://github.com/eitaar/yot/blob/main/src/auth/middleware.rs): `src/auth/middleware.rs`
- [PIN pairing](https://github.com/eitaar/yot/blob/main/src/auth/pairing.rs): `src/auth/pairing.rs`
- [OAuth endpoints](https://github.com/eitaar/yot/blob/main/src/rest/oauth.rs): `src/rest/oauth.rs`

### Calendar services

- [Calendar routes](https://github.com/eitaar/yot/blob/main/src/rest/calendars.rs): `src/rest/calendars.rs`
- [Event routes](https://github.com/eitaar/yot/blob/main/src/rest/events.rs): `src/rest/events.rs`
- [Import routes](https://github.com/eitaar/yot/blob/main/src/rest/import.rs): `src/rest/import.rs`
- [Image uploads](https://github.com/eitaar/yot/blob/main/src/rest/uploads.rs): `src/rest/uploads.rs`
- [Tag routes](https://github.com/eitaar/yot/blob/main/src/rest/tags.rs): `src/rest/tags.rs`
- [Plugin sources](https://github.com/eitaar/yot/blob/main/src/rest/plugins.rs): `src/rest/plugins.rs`
- [Ask API](https://github.com/eitaar/yot/blob/main/src/rest/ask.rs): `src/rest/ask.rs`
- [Calendar service](https://github.com/eitaar/yot/blob/main/src/services/calendar.rs): `src/services/calendar.rs`
- [Event service](https://github.com/eitaar/yot/blob/main/src/services/event.rs): `src/services/event.rs`
- [ICS import](https://github.com/eitaar/yot/blob/main/src/services/import.rs): `src/services/import.rs`
- [Image service](https://github.com/eitaar/yot/blob/main/src/services/image.rs): `src/services/image.rs`
- [Tag service](https://github.com/eitaar/yot/blob/main/src/services/tag.rs): `src/services/tag.rs`
- [Plugin service](https://github.com/eitaar/yot/blob/main/src/services/plugin_source.rs): `src/services/plugin_source.rs`

### Realtime and MCP

- [Event bus](https://github.com/eitaar/yot/blob/main/src/core/event_bus.rs): `src/core/event_bus.rs`
- [SSE feed](https://github.com/eitaar/yot/blob/main/src/rest/stream.rs): `src/rest/stream.rs`
- [MCP tools](https://github.com/eitaar/yot/blob/main/src/mcp/server.rs): `src/mcp/server.rs`
- [MCP SSE relay](https://github.com/eitaar/yot/blob/main/src/mcp/relay.rs): `src/mcp/relay.rs`

### Persistence

- [SQLite database](https://github.com/eitaar/yot/blob/main/src/db/mod.rs): `src/db/mod.rs`
- [Database schema](https://github.com/eitaar/yot/blob/main/src/db/schema.rs): `src/db/schema.rs`

### Other components

- **Calendar user**

## Connections

- Calendar user → Vue application: uses (evidence: `README.md`)
- Vue application → Calendar views: renders
- Calendar views → Web API client: requests
- Vue application → Pairing UI: offers pairing
- Web API client → REST router: calls REST (evidence: `README.md`)
- Pairing UI → REST router: redeems PIN (evidence: `README.md`)
- REST router → API authentication: guards routes (evidence: `src/rest/mod.rs`)
- REST router → Calendar routes: routes to (evidence: `src/rest/mod.rs`)
- REST router → Event routes: routes to (evidence: `src/rest/mod.rs`)
- REST router → Import routes: routes to (evidence: `src/rest/mod.rs`)
- REST router → Image uploads: routes to (evidence: `src/rest/mod.rs`)
- REST router → Tag routes: routes to (evidence: `src/rest/mod.rs`)
- REST router → Plugin sources: routes to (evidence: `src/rest/mod.rs`)
- REST router → Ask API: routes to (evidence: `src/rest/mod.rs`)
- REST router → OAuth endpoints: exposes (evidence: `src/rest/mod.rs`)
- API authentication → SQLite database: authenticates via (evidence: `src/auth/middleware.rs`)
- API authentication → PIN pairing: uses (evidence: `src/rest/mod.rs`)
- Calendar routes → Calendar service: delegates (evidence: `README.md`)
- Event routes → Event service: delegates (evidence: `README.md`)
- Import routes → ICS import: delegates (evidence: `README.md`)
- Image uploads → Image service: delegates (evidence: `README.md`)
- Tag routes → Tag service: delegates (evidence: `README.md`)
- Plugin sources → Plugin service: uses (evidence: `src/rest/plugins.rs`)
- Calendar service → SQLite database: reads and writes (evidence: `README.md`)
- Event service → SQLite database: reads and writes (evidence: `README.md`)
- Event service → Calendar service: checks calendar (evidence: `src/services/event.rs`)
- ICS import → SQLite database: imports into (evidence: `README.md`)
- Image service → SQLite database: stores metadata
- Tag service → SQLite database: reads and writes (evidence: `README.md`)
- Plugin service → SQLite database: uses schema (evidence: `src/services/plugin_source.rs`)
- SQLite database → Database schema: initializes (evidence: `src/db/mod.rs`)
- REST router → SSE feed: routes to (evidence: `src/rest/mod.rs`)
- SSE feed → Event bus: streams events (evidence: `README.md`)
- Calendar user → MCP tools: connects via stdio (evidence: `README.md`)
- MCP tools → Calendar service: calls (evidence: `src/mcp/server.rs`)
- MCP tools → Event service: calls (evidence: `src/mcp/server.rs`)
- MCP tools → ICS import: calls (evidence: `src/mcp/server.rs`)
- MCP tools → Image service: calls (evidence: `src/mcp/server.rs`)
- MCP tools → Tag service: calls (evidence: `src/mcp/server.rs`)
- MCP tools → Event bus: emits changes (evidence: `src/mcp/server.rs`)
- MCP SSE relay → Event bus: subscribes (evidence: `src/mcp/relay.rs`)
- MCP SSE relay → SSE feed: relays to feed (evidence: `README.md`)
