# rebots-online/sanctissimissa-lite architecture

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

- Interactive diagram: https://gitdiagram.com/rebots-online/sanctissimissa-lite
- Repository: https://github.com/rebots-online/sanctissimissa-lite
- Video tour (about a minute): https://gitdiagram.com/rebots-online/sanctissimissa-lite/video

## Overview

SanctissiMissa is a liturgical corpus explorer for the Traditional Latin Mass and Divine Office. The main workflow begins in the app, resolves a selected date against the perpetual calendar and corpus, then presents the Mass as a navigable map and bilingual reader; meaning lookup adds concordance and vector similarity. Separate branches provide the Office, scripture exploration, annotations and journal, and optional companion chat. The README documents several capabilities whose detailed UI wiring was not sampled, so those links are marked unverified rather than inferred as direct calls.

Main entry points: [`src/App.tsx`](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/App.tsx) (App shell), [`src/core/data/corpusDb.ts`](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/data/corpusDb.ts) (Corpus query layer), [`src/core/data/liturgicalDay.ts`](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/data/liturgicalDay.ts) (Day resolver), [`reusable-chatbot/core/engine-types.ts`](https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/core/engine-types.ts) (Engine contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app["App shell<br/>[App.tsx]"]
end

subgraph group_liturgy["Liturgical corpus"]
  node_calendar["Perpetual calendar<br/>[computus.ts]"]
  node_day["Day resolver<br/>[liturgicalDay.ts]"]
  node_corpus[("Corpus query layer<br/>[corpusDb.ts]")]
  node_massordo["Mass ordo<br/>[massOrdo.ts]"]
  node_subway["Mass subway map<br/>[SubwayMap.tsx]"]
  node_reader["Bilingual reader<br/>[ReaderView.tsx]"]
  node_office["Office view<br/>[OfficeView.tsx]"]
  node_officeengine["Office construction<br/>[engine.ts]"]
  node_calendarview["Calendar view<br/>[CalendarView.tsx]"]
end

subgraph group_study["Study and notes"]
  node_meaning["Meaning lookup<br/>[MeaningPanel.tsx]"]
  node_embedding["Vector embeddings<br/>[embed.ts]"]
  node_annotations[("Annotations<br/>[store.ts]")]
  node_journal["Journal sidecar<br/>[JournalSidecar.tsx]"]
  node_bible["Scripture view<br/>[BibleView.tsx]"]
end

subgraph group_companion["Companion AI"]
  node_chat["Chat interface<br/>[ChatView.tsx]"]
  node_session["Chat session<br/>[session.ts]"]
  node_controller["Chat controller<br/>[chat-controller.ts]"]
  node_enginecontract["Engine contract<br/>[engine-types.ts]"]
  node_hosted["Hosted engine<br/>[index.ts]"]
  node_native["Native engine<br/>[index.ts]"]
  node_webllm["WebLLM engine<br/>[index.ts]"]
end

subgraph group_platform["Runtime services"]
  node_themes["Theme preferences<br/>[themes.ts]"]
  node_modelstore["Model downloads"]
  node_diagnostics[("Diagnostics<br/>[store.ts]")]
  node_updates["PWA updates<br/>[pwaUpdate.ts]"]
end

node_user(("Reader"))

node_user -->|"opens"| node_app
node_app -->|"resolves date"| node_day
node_app -->|"maps week key"| node_calendar
node_app -->|"loads corpus"| node_corpus
node_app -->|"renders map"| node_subway
node_app -->|"renders reader"| node_reader
node_app -->|"renders calendar"| node_calendarview
node_app -->|"renders Office"| node_office
node_app -->|"renders lookup"| node_meaning
node_app -->|"applies theme"| node_themes
node_app -->|"resolves selected day"| node_day
node_day -->|"uses computus"| node_calendar
node_day -->|"queries day files"| node_corpus
node_corpus -->|"normalizes query"| node_embedding
node_corpus -->|"queries ordo"| node_massordo
node_office -.->|"constructs hours"| node_officeengine
node_officeengine -->|"resolves day"| node_day
node_officeengine -->|"reads office files"| node_corpus
node_meaning -.->|"queries meaning"| node_corpus
node_meaning -.->|"finds similar text"| node_embedding
node_app -.->|"offers scripture view"| node_bible
node_app -.->|"supports annotations"| node_annotations
node_app -.->|"offers margin notes"| node_journal
node_app -.->|"offers companion chat"| node_chat
node_chat -.->|"manages conversation"| node_session
node_session -->|"uses controller"| node_controller
node_controller -->|"calls engine"| node_enginecontract
node_hosted -->|"implements contract"| node_enginecontract
node_native -->|"implements contract"| node_enginecontract
node_webllm -.->|"implements contract"| node_enginecontract
node_app -->|"handles update"| node_updates
node_app -.->|"captures diagnostics"| node_diagnostics
node_app -.->|"supports model downloads"| node_modelstore

click node_app "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/App.tsx"
click node_calendar "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/calendar/computus.ts"
click node_day "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/data/liturgicalDay.ts"
click node_corpus "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/data/corpusDb.ts"
click node_massordo "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/model/massOrdo.ts"
click node_subway "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/SubwayMap.tsx"
click node_reader "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/ReaderView.tsx"
click node_office "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/OfficeView.tsx"
click node_officeengine "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/office/engine.ts"
click node_calendarview "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/CalendarView.tsx"
click node_meaning "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/MeaningPanel.tsx"
click node_embedding "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/vector/embed.ts"
click node_annotations "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/annotations/store.ts"
click node_journal "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/JournalSidecar.tsx"
click node_bible "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/BibleView.tsx"
click node_chat "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/ChatView.tsx"
click node_session "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/chat/session.ts"
click node_controller "https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/core/chat-controller.ts"
click node_enginecontract "https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/core/engine-types.ts"
click node_hosted "https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/engines/hosted-openrouter/index.ts"
click node_native "https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/engines/native/index.ts"
click node_webllm "https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/engines/webllm/index.ts"
click node_themes "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/theme/themes.ts"
click node_modelstore "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/model-store/download-manager.ts"
click node_diagnostics "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/diagnostics/store.ts"
click node_updates "https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/pwa/pwaUpdate.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_app toneBlue
class node_calendar,node_day,node_corpus,node_massordo,node_subway,node_reader,node_office,node_officeengine,node_calendarview toneAmber
class node_meaning,node_embedding,node_annotations,node_journal,node_bible toneMint
class node_chat,node_session,node_controller,node_enginecontract,node_hosted,node_native,node_webllm toneRose
class node_themes,node_modelstore,node_diagnostics,node_updates,node_user toneIndigo
```

## Components

### App and navigation

- [App shell](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/App.tsx): `src/App.tsx`

### Liturgical corpus

- [Perpetual calendar](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/calendar/computus.ts): `src/core/calendar/computus.ts`
- [Day resolver](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/data/liturgicalDay.ts): `src/core/data/liturgicalDay.ts`
- [Corpus query layer](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/data/corpusDb.ts): `src/core/data/corpusDb.ts`
- [Mass ordo](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/model/massOrdo.ts): `src/core/model/massOrdo.ts`
- [Mass subway map](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/SubwayMap.tsx): `src/ui/SubwayMap.tsx`
- [Bilingual reader](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/ReaderView.tsx): `src/ui/ReaderView.tsx`
- [Office view](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/OfficeView.tsx): `src/ui/OfficeView.tsx`
- [Office construction](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/office/engine.ts): `src/core/office/engine.ts`
- [Calendar view](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/CalendarView.tsx): `src/ui/CalendarView.tsx`

### Study and notes

- [Meaning lookup](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/MeaningPanel.tsx): `src/ui/MeaningPanel.tsx`
- [Vector embeddings](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/vector/embed.ts): `src/core/vector/embed.ts`
- [Annotations](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/annotations/store.ts): `src/core/annotations/store.ts`
- [Journal sidecar](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/JournalSidecar.tsx): `src/ui/JournalSidecar.tsx`
- [Scripture view](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/BibleView.tsx): `src/ui/BibleView.tsx`

### Companion AI

- [Chat interface](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/ui/ChatView.tsx): `src/ui/ChatView.tsx`
- [Chat session](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/chat/session.ts): `src/core/chat/session.ts`
- [Chat controller](https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/core/chat-controller.ts): `reusable-chatbot/core/chat-controller.ts`
- [Engine contract](https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/core/engine-types.ts): `reusable-chatbot/core/engine-types.ts`
- [Hosted engine](https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/engines/hosted-openrouter/index.ts): `reusable-chatbot/engines/hosted-openrouter/index.ts`
- [Native engine](https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/engines/native/index.ts): `reusable-chatbot/engines/native/index.ts`
- [WebLLM engine](https://github.com/rebots-online/sanctissimissa-lite/blob/master/reusable-chatbot/engines/webllm/index.ts): `reusable-chatbot/engines/webllm/index.ts`

### Runtime services

- [Theme preferences](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/theme/themes.ts): `src/core/theme/themes.ts`
- [Model downloads](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/model-store/download-manager.ts): `src/core/model-store/download-manager.ts`
- [Diagnostics](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/core/diagnostics/store.ts): `src/core/diagnostics/store.ts`
- [PWA updates](https://github.com/rebots-online/sanctissimissa-lite/blob/master/src/pwa/pwaUpdate.ts): `src/pwa/pwaUpdate.ts`

### Other components

- **Reader**

## Connections

- Reader → App shell: opens (evidence: `README.md`)
- App shell → Day resolver: resolves date (evidence: `src/App.tsx`)
- App shell → Perpetual calendar: maps week key (evidence: `src/App.tsx`)
- App shell → Corpus query layer: loads corpus (evidence: `src/App.tsx`)
- App shell → Mass subway map: renders map (evidence: `src/App.tsx`)
- App shell → Bilingual reader: renders reader (evidence: `src/App.tsx`)
- App shell → Calendar view: renders calendar (evidence: `src/App.tsx`)
- App shell → Office view: renders Office (evidence: `src/App.tsx`)
- App shell → Meaning lookup: renders lookup (evidence: `src/App.tsx`)
- App shell → Theme preferences: applies theme (evidence: `src/App.tsx`)
- App shell → Day resolver: resolves selected day (evidence: `src/App.tsx`)
- Day resolver → Perpetual calendar: uses computus (evidence: `src/core/data/liturgicalDay.ts`)
- Day resolver → Corpus query layer: queries day files (evidence: `src/core/data/liturgicalDay.ts`)
- Corpus query layer → Vector embeddings: normalizes query (evidence: `src/core/data/corpusDb.ts`)
- Corpus query layer → Mass ordo: queries ordo (evidence: `src/core/data/corpusDb.ts`)
- Office view → Office construction: constructs hours
- Office construction → Day resolver: resolves day (evidence: `src/core/office/engine.ts`)
- Office construction → Corpus query layer: reads office files (evidence: `src/core/office/engine.ts`)
- Meaning lookup → Corpus query layer: queries meaning
- Meaning lookup → Vector embeddings: finds similar text
- App shell → Scripture view: offers scripture view (evidence: `README.md`)
- App shell → Annotations: supports annotations (evidence: `README.md`)
- App shell → Journal sidecar: offers margin notes (evidence: `README.md`)
- App shell → Chat interface: offers companion chat (evidence: `README.md`)
- Chat interface → Chat session: manages conversation
- Chat session → Chat controller: uses controller (evidence: `src/core/chat/session.ts`)
- Chat controller → Engine contract: calls engine (evidence: `reusable-chatbot/core/chat-controller.ts`)
- Hosted engine → Engine contract: implements contract (evidence: `reusable-chatbot/engines/hosted-openrouter/index.ts`)
- Native engine → Engine contract: implements contract (evidence: `reusable-chatbot/engines/native/index.ts`)
- WebLLM engine → Engine contract: implements contract
- App shell → PWA updates: handles update (evidence: `src/App.tsx`)
- App shell → Diagnostics: captures diagnostics (evidence: `src/App.tsx`)
- App shell → Model downloads: supports model downloads
