# evan5467/groove architecture

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

- Interactive diagram: https://gitdiagram.com/evan5467/groove
- Repository: https://github.com/evan5467/groove

## Overview

Tempo is an offline-first Android study-routine app. A learner unlocks the encrypted library, adds typed notes or files, and Tempo extracts and structures the material into topics; the planner turns topics into dated study and revision sessions that appear in Today and weekly views. State and the vault persist encrypted records locally, while on-device reminders and encrypted backup/restore support ongoing use. The main flow is supported by the excerpts and README; some secondary UI wiring and restore details are unsampled, so those links are omitted.

Main entry points: [`src/views.js`](https://github.com/evan5467/groove/blob/main/src/views.js) (Views and workflows), [`src/io/ingest.js`](https://github.com/evan5467/groove/blob/main/src/io/ingest.js) (Ingest pipeline), [`src/state.js`](https://github.com/evan5467/groove/blob/main/src/state.js) (App state), [`src/main.js`](https://github.com/evan5467/groove/blob/main/src/main.js) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and interface"]
  node_entry["App entry<br/>[main.js]"]
  node_views["Views and workflows<br/>[views.js]"]
  node_dom["Safe DOM and sheets<br/>[dom.js]"]
  node_state["App state<br/>[state.js]"]
end

subgraph group_learning["Study content"]
  node_files["File validation<br/>[files.js]"]
  node_parser["Outline parser<br/>[parse.js]"]
  node_ai["AI structuring<br/>[ai.js]"]
  node_starter["Starter library<br/>[starter.js]"]
  node_schema["Data validation<br/>[schema.js]"]
end

subgraph group_planning["Planning and reminders"]
  node_planner["Study planner<br/>[plan.js]"]
  node_remind["Reminder schedule<br/>[remind.js]"]
  node_notify["Phone notifications<br/>[notify.js]"]
end

subgraph group_security["Local data and privacy"]
  node_vault["Encrypted vault<br/>[vault.js]"]
  node_crypto["Encryption<br/>[crypto.js]"]
  node_storage[("IndexedDB storage<br/>[storage.js]")]
  node_backup["Encrypted backup<br/>[backup.js]"]
end

subgraph group_ingestion["Material ingestion"]
  node_ingest["Ingest pipeline<br/>[ingest.js]"]
  node_ocr["On-device OCR<br/>[ocr.js]"]
  node_pdf["PDF extraction<br/>[pdf.js]"]
  node_image["Image preparation<br/>[image.js]"]
end

node_learner(("Learner"))
node_ai_service{{"AI provider"}}

node_learner -->|"opens app"| node_entry
node_entry -->|"boots and renders"| node_state
node_entry -->|"renders"| node_views
node_views -->|"builds interface"| node_dom
node_learner -->|"uses study workflows"| node_views
node_views -->|"updates study state"| node_state
node_views -->|"submits material"| node_ingest
node_ingest -->|"validates files"| node_files
node_ingest -->|"prepares images"| node_image
node_ingest -->|"recognizes text"| node_ocr
node_ingest -->|"extracts PDF text"| node_pdf
node_ingest -->|"structures text"| node_parser
node_ingest -->|"requests structuring"| node_ai
node_ai -.->|"sends extracted text"| node_ai_service
node_state -->|"sanitizes records"| node_schema
node_state -->|"loads starter content"| node_starter
node_state -->|"generates plans"| node_planner
node_views -->|"builds plan"| node_planner
node_state -->|"loads and saves"| node_vault
node_vault -->|"encrypts records"| node_crypto
node_vault -.->|"persists ciphertext"| node_storage
node_entry -->|"syncs reminders"| node_notify
node_state -->|"clears reminders"| node_notify
node_notify -->|"computes schedule"| node_remind
node_views -->|"shows overdue work"| node_remind
node_views -->|"shares backup"| node_backup
node_entry -->|"cleans cached backups"| node_backup

click node_entry "https://github.com/evan5467/groove/blob/main/src/main.js"
click node_views "https://github.com/evan5467/groove/blob/main/src/views.js"
click node_dom "https://github.com/evan5467/groove/blob/main/src/dom.js"
click node_state "https://github.com/evan5467/groove/blob/main/src/state.js"
click node_ingest "https://github.com/evan5467/groove/blob/main/src/io/ingest.js"
click node_ocr "https://github.com/evan5467/groove/blob/main/src/io/ocr.js"
click node_pdf "https://github.com/evan5467/groove/blob/main/src/io/pdf.js"
click node_image "https://github.com/evan5467/groove/blob/main/src/io/image.js"
click node_files "https://github.com/evan5467/groove/blob/main/src/core/files.js"
click node_parser "https://github.com/evan5467/groove/blob/main/src/core/parse.js"
click node_ai "https://github.com/evan5467/groove/blob/main/src/core/ai.js"
click node_starter "https://github.com/evan5467/groove/blob/main/src/core/starter.js"
click node_schema "https://github.com/evan5467/groove/blob/main/src/core/schema.js"
click node_planner "https://github.com/evan5467/groove/blob/main/src/core/plan.js"
click node_remind "https://github.com/evan5467/groove/blob/main/src/core/remind.js"
click node_notify "https://github.com/evan5467/groove/blob/main/src/io/notify.js"
click node_vault "https://github.com/evan5467/groove/blob/main/src/core/vault.js"
click node_crypto "https://github.com/evan5467/groove/blob/main/src/core/crypto.js"
click node_storage "https://github.com/evan5467/groove/blob/main/src/core/storage.js"
click node_backup "https://github.com/evan5467/groove/blob/main/src/backup.js"

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_entry,node_views,node_dom,node_state toneBlue
class node_files,node_parser,node_ai,node_starter,node_schema toneAmber
class node_planner,node_remind,node_notify toneMint
class node_vault,node_crypto,node_storage,node_backup toneRose
class node_ingest,node_ocr,node_pdf,node_image,node_learner,node_ai_service toneIndigo
```

## Components

### App and interface

- [App entry](https://github.com/evan5467/groove/blob/main/src/main.js): `src/main.js`
- [Views and workflows](https://github.com/evan5467/groove/blob/main/src/views.js): `src/views.js`
- [Safe DOM and sheets](https://github.com/evan5467/groove/blob/main/src/dom.js): `src/dom.js`
- [App state](https://github.com/evan5467/groove/blob/main/src/state.js): `src/state.js`

### Study content

- [File validation](https://github.com/evan5467/groove/blob/main/src/core/files.js): `src/core/files.js`
- [Outline parser](https://github.com/evan5467/groove/blob/main/src/core/parse.js): `src/core/parse.js`
- [AI structuring](https://github.com/evan5467/groove/blob/main/src/core/ai.js): `src/core/ai.js`
- [Starter library](https://github.com/evan5467/groove/blob/main/src/core/starter.js): `src/core/starter.js`
- [Data validation](https://github.com/evan5467/groove/blob/main/src/core/schema.js): `src/core/schema.js`

### Planning and reminders

- [Study planner](https://github.com/evan5467/groove/blob/main/src/core/plan.js): `src/core/plan.js`
- [Reminder schedule](https://github.com/evan5467/groove/blob/main/src/core/remind.js): `src/core/remind.js`
- [Phone notifications](https://github.com/evan5467/groove/blob/main/src/io/notify.js): `src/io/notify.js`

### Local data and privacy

- [Encrypted vault](https://github.com/evan5467/groove/blob/main/src/core/vault.js): `src/core/vault.js`
- [Encryption](https://github.com/evan5467/groove/blob/main/src/core/crypto.js): `src/core/crypto.js`
- [IndexedDB storage](https://github.com/evan5467/groove/blob/main/src/core/storage.js): `src/core/storage.js`
- [Encrypted backup](https://github.com/evan5467/groove/blob/main/src/backup.js): `src/backup.js`

### Material ingestion

- [Ingest pipeline](https://github.com/evan5467/groove/blob/main/src/io/ingest.js): `src/io/ingest.js`
- [On-device OCR](https://github.com/evan5467/groove/blob/main/src/io/ocr.js): `src/io/ocr.js`
- [PDF extraction](https://github.com/evan5467/groove/blob/main/src/io/pdf.js): `src/io/pdf.js`
- [Image preparation](https://github.com/evan5467/groove/blob/main/src/io/image.js): `src/io/image.js`

### Other components

- **Learner**
- **AI provider**

## Connections

- Learner → App entry: opens app (evidence: `README.md`)
- App entry → App state: boots and renders (evidence: `src/main.js`)
- App entry → Views and workflows: renders (evidence: `src/main.js`)
- Views and workflows → Safe DOM and sheets: builds interface (evidence: `src/views.js`)
- Learner → Views and workflows: uses study workflows (evidence: `README.md`)
- Views and workflows → App state: updates study state (evidence: `src/views.js`)
- Views and workflows → Ingest pipeline: submits material (evidence: `src/views.js`)
- Ingest pipeline → File validation: validates files (evidence: `src/io/ingest.js`)
- Ingest pipeline → Image preparation: prepares images (evidence: `src/io/ingest.js`)
- Ingest pipeline → On-device OCR: recognizes text (evidence: `src/io/ingest.js`)
- Ingest pipeline → PDF extraction: extracts PDF text (evidence: `src/io/ingest.js`)
- Ingest pipeline → Outline parser: structures text (evidence: `src/io/ingest.js`)
- Ingest pipeline → AI structuring: requests structuring (evidence: `src/io/ingest.js`)
- AI structuring → AI provider: sends extracted text (evidence: `README.md`)
- App state → Data validation: sanitizes records (evidence: `src/state.js`)
- App state → Starter library: loads starter content (evidence: `src/state.js`)
- App state → Study planner: generates plans (evidence: `src/state.js`)
- Views and workflows → Study planner: builds plan (evidence: `src/views.js`)
- App state → Encrypted vault: loads and saves (evidence: `src/state.js`)
- Encrypted vault → Encryption: encrypts records (evidence: `src/core/vault.js`)
- Encrypted vault → IndexedDB storage: persists ciphertext
- App entry → Phone notifications: syncs reminders (evidence: `src/main.js`)
- App state → Phone notifications: clears reminders (evidence: `src/state.js`)
- Phone notifications → Reminder schedule: computes schedule (evidence: `src/io/notify.js`)
- Views and workflows → Reminder schedule: shows overdue work (evidence: `src/views.js`)
- Views and workflows → Encrypted backup: shares backup (evidence: `src/views.js`)
- App entry → Encrypted backup: cleans cached backups (evidence: `src/main.js`)
