# siro098/notesmith architecture

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

- Interactive diagram: https://gitdiagram.com/siro098/notesmith
- Repository: https://github.com/siro098/notesmith

## Overview

Notesmith is a local-first music-score library and practice app for ensembles. Musicians import and organize PDF scores, open them in a reader to annotate or navigate setlists, and use the metronome or memorization trainer to practice; IndexedDB keeps scores and related data on-device, with backup and restore. The graph follows the sampled app composition and documented features. Some feature-to-storage links are not shown in the excerpts, so they are omitted rather than inferred.

Main entry points: [`src/App.tsx`](https://github.com/siro098/notesmith/blob/main/src/App.tsx) (App shell), [`src/components/TrainerView.tsx`](https://github.com/siro098/notesmith/blob/main/src/components/TrainerView.tsx) (Memorization trainer), [`src/main.tsx`](https://github.com/siro098/notesmith/blob/main/src/main.tsx) (Web app entry), [`src/components/ScoreReader.tsx`](https://github.com/siro098/notesmith/blob/main/src/components/ScoreReader.tsx) (Score reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and experience"]
  node_entry["Web app entry<br/>[main.tsx]"]
  node_app_shell["App shell<br/>[App.tsx]"]
  node_language["Language context<br/>[i18n.tsx]"]
  node_viewport["Responsive viewport<br/>[useViewport.ts]"]
  node_licenses["License information"]
end

subgraph group_scores["Scores and performances"]
  node_library["PDF library<br/>[LibraryView.tsx]"]
  node_reader["Score reader<br/>[ScoreReader.tsx]"]
  node_setlists["Setlists<br/>[SetlistsView.tsx]"]
  node_pdf_service["PDF processing<br/>[pdfService.ts]"]
end

subgraph group_practice["Practice tools"]
  node_metronome_panel["Metronome controls<br/>[MetronomePanel.tsx]"]
  node_metronome_engine["Audio metronome<br/>[metronomeEngine.ts]"]
  node_trainer["Memorization trainer<br/>[TrainerView.tsx]"]
  node_staff_detector["Staff detection<br/>[staffDetector.ts]"]
  node_srs["Spaced repetition<br/>[srs.ts]"]
end

subgraph group_platform["Local data and platform"]
  node_database[("Local IndexedDB<br/>[db.ts]")]
  node_models["Domain data types<br/>[types.ts]"]
  node_identifiers["ID generation<br/>[id.ts]"]
  node_android["Android host<br/>[MainActivity.java]"]
end

node_musician(("Musician"))

node_musician -->|"opens app"| node_entry
node_entry -->|"renders"| node_app_shell
node_entry -->|"provides language"| node_language
node_app_shell -->|"renders"| node_library
node_app_shell -->|"renders"| node_reader
node_app_shell -->|"renders"| node_setlists
node_app_shell -->|"renders"| node_trainer
node_app_shell -->|"renders"| node_metronome_panel
node_app_shell -->|"reads and updates"| node_database
node_app_shell -->|"extracts previews"| node_pdf_service
node_app_shell -->|"creates IDs"| node_identifiers
node_app_shell -->|"uses viewport"| node_viewport
node_app_shell -->|"displays licenses"| node_licenses
node_metronome_panel -->|"controls"| node_metronome_engine
node_reader -->|"loads and saves annotations"| node_database
node_reader -->|"loads score pages"| node_pdf_service
node_trainer -->|"loads study data"| node_database
node_trainer -->|"loads score pages"| node_pdf_service
node_trainer -->|"requests detection"| node_staff_detector
node_trainer -->|"reviews cards"| node_srs
node_trainer -->|"loads sheet theme"| node_reader
node_staff_detector -->|"loads PDF"| node_pdf_service
node_staff_detector -->|"builds study cards"| node_srs
node_srs -->|"creates card IDs"| node_identifiers
node_database -->|"stores typed records"| node_models
node_android -.->|"hosts app"| node_entry

click node_entry "https://github.com/siro098/notesmith/blob/main/src/main.tsx"
click node_app_shell "https://github.com/siro098/notesmith/blob/main/src/App.tsx"
click node_language "https://github.com/siro098/notesmith/blob/main/src/i18n.tsx"
click node_viewport "https://github.com/siro098/notesmith/blob/main/src/utils/useViewport.ts"
click node_licenses "https://github.com/siro098/notesmith/blob/main/src/data/thirdPartyLicenses.ts"
click node_library "https://github.com/siro098/notesmith/blob/main/src/components/LibraryView.tsx"
click node_reader "https://github.com/siro098/notesmith/blob/main/src/components/ScoreReader.tsx"
click node_setlists "https://github.com/siro098/notesmith/blob/main/src/components/SetlistsView.tsx"
click node_pdf_service "https://github.com/siro098/notesmith/blob/main/src/utils/pdfService.ts"
click node_metronome_panel "https://github.com/siro098/notesmith/blob/main/src/components/MetronomePanel.tsx"
click node_metronome_engine "https://github.com/siro098/notesmith/blob/main/src/audio/metronomeEngine.ts"
click node_trainer "https://github.com/siro098/notesmith/blob/main/src/components/TrainerView.tsx"
click node_staff_detector "https://github.com/siro098/notesmith/blob/main/src/utils/staffDetector.ts"
click node_srs "https://github.com/siro098/notesmith/blob/main/src/utils/srs.ts"
click node_database "https://github.com/siro098/notesmith/blob/main/src/db.ts"
click node_models "https://github.com/siro098/notesmith/blob/main/src/types.ts"
click node_identifiers "https://github.com/siro098/notesmith/blob/main/src/utils/id.ts"
click node_android "https://github.com/siro098/notesmith/blob/main/android/app/src/main/java/com/liebl/notesmith/MainActivity.java"

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_app_shell,node_language,node_viewport,node_licenses toneBlue
class node_library,node_reader,node_setlists,node_pdf_service toneAmber
class node_metronome_panel,node_metronome_engine,node_trainer,node_staff_detector,node_srs toneMint
class node_database,node_models,node_identifiers,node_android toneRose
class node_musician toneIndigo
```

## Components

### App and experience

- [Web app entry](https://github.com/siro098/notesmith/blob/main/src/main.tsx): `src/main.tsx`
- [App shell](https://github.com/siro098/notesmith/blob/main/src/App.tsx): `src/App.tsx`
- [Language context](https://github.com/siro098/notesmith/blob/main/src/i18n.tsx): `src/i18n.tsx`
- [Responsive viewport](https://github.com/siro098/notesmith/blob/main/src/utils/useViewport.ts): `src/utils/useViewport.ts`
- [License information](https://github.com/siro098/notesmith/blob/main/src/data/thirdPartyLicenses.ts): `src/data/thirdPartyLicenses.ts`

### Scores and performances

- [PDF library](https://github.com/siro098/notesmith/blob/main/src/components/LibraryView.tsx): `src/components/LibraryView.tsx`
- [Score reader](https://github.com/siro098/notesmith/blob/main/src/components/ScoreReader.tsx): `src/components/ScoreReader.tsx`
- [Setlists](https://github.com/siro098/notesmith/blob/main/src/components/SetlistsView.tsx): `src/components/SetlistsView.tsx`
- [PDF processing](https://github.com/siro098/notesmith/blob/main/src/utils/pdfService.ts): `src/utils/pdfService.ts`

### Practice tools

- [Metronome controls](https://github.com/siro098/notesmith/blob/main/src/components/MetronomePanel.tsx): `src/components/MetronomePanel.tsx`
- [Audio metronome](https://github.com/siro098/notesmith/blob/main/src/audio/metronomeEngine.ts): `src/audio/metronomeEngine.ts`
- [Memorization trainer](https://github.com/siro098/notesmith/blob/main/src/components/TrainerView.tsx): `src/components/TrainerView.tsx`
- [Staff detection](https://github.com/siro098/notesmith/blob/main/src/utils/staffDetector.ts): `src/utils/staffDetector.ts`
- [Spaced repetition](https://github.com/siro098/notesmith/blob/main/src/utils/srs.ts): `src/utils/srs.ts`

### Local data and platform

- [Local IndexedDB](https://github.com/siro098/notesmith/blob/main/src/db.ts): `src/db.ts`
- [Domain data types](https://github.com/siro098/notesmith/blob/main/src/types.ts): `src/types.ts`
- [ID generation](https://github.com/siro098/notesmith/blob/main/src/utils/id.ts): `src/utils/id.ts`
- [Android host](https://github.com/siro098/notesmith/blob/main/android/app/src/main/java/com/liebl/notesmith/MainActivity.java): `android/app/src/main/java/com/liebl/notesmith/MainActivity.java`

### Other components

- **Musician**

## Connections

- Musician → Web app entry: opens app (evidence: `README.md`)
- Web app entry → App shell: renders (evidence: `src/main.tsx`)
- Web app entry → Language context: provides language (evidence: `src/main.tsx`)
- App shell → PDF library: renders (evidence: `src/App.tsx`)
- App shell → Score reader: renders (evidence: `src/App.tsx`)
- App shell → Setlists: renders (evidence: `src/App.tsx`)
- App shell → Memorization trainer: renders (evidence: `src/App.tsx`)
- App shell → Metronome controls: renders (evidence: `src/App.tsx`)
- App shell → Local IndexedDB: reads and updates (evidence: `src/App.tsx`)
- App shell → PDF processing: extracts previews (evidence: `src/App.tsx`)
- App shell → ID generation: creates IDs (evidence: `src/App.tsx`)
- App shell → Responsive viewport: uses viewport (evidence: `src/App.tsx`)
- App shell → License information: displays licenses (evidence: `src/App.tsx`)
- Metronome controls → Audio metronome: controls (evidence: `src/components/MetronomePanel.tsx`)
- Score reader → Local IndexedDB: loads and saves annotations (evidence: `src/components/ScoreReader.tsx`)
- Score reader → PDF processing: loads score pages (evidence: `src/components/ScoreReader.tsx`)
- Memorization trainer → Local IndexedDB: loads study data (evidence: `src/components/TrainerView.tsx`)
- Memorization trainer → PDF processing: loads score pages (evidence: `src/components/TrainerView.tsx`)
- Memorization trainer → Staff detection: requests detection (evidence: `src/components/TrainerView.tsx`)
- Memorization trainer → Spaced repetition: reviews cards (evidence: `src/components/TrainerView.tsx`)
- Memorization trainer → Score reader: loads sheet theme (evidence: `src/components/TrainerView.tsx`)
- Staff detection → PDF processing: loads PDF (evidence: `src/utils/staffDetector.ts`)
- Staff detection → Spaced repetition: builds study cards (evidence: `src/utils/staffDetector.ts`)
- Spaced repetition → ID generation: creates card IDs (evidence: `src/utils/srs.ts`)
- Local IndexedDB → Domain data types: stores typed records (evidence: `src/db.ts`)
- Android host → Web app entry: hosts app (evidence: `README.md`)
