# dffmonolith/intervals architecture

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

- Interactive diagram: https://gitdiagram.com/dffmonolith/intervals
- Repository: https://github.com/dffmonolith/intervals

## Overview

Intervals is a browser-based ear-training app. The main workflow is to choose an exercise and settings, hear a piano reference or interval, then sing or identify the target and review feedback. The README describes the app’s capabilities, but its implementation in index.html was not sampled; those internal relationships are therefore documented at the product level. The service worker’s caching behavior is visible in its excerpt.

Main entry points: [`index.html`](https://github.com/dffmonolith/intervals/blob/main/index.html) (Intervals app), [`sw.js`](https://github.com/dffmonolith/intervals/blob/main/sw.js) (Service worker), [`manifest.webmanifest`](https://github.com/dffmonolith/intervals/blob/main/manifest.webmanifest) (App manifest), [`intervals-piano-samples.json`](https://github.com/dffmonolith/intervals/blob/main/intervals-piano-samples.json) (Piano samples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_practice["Practice modes"]
  node_app["Intervals app<br/>[index.html]"]
  node_sing["Sing mode<br/>[index.html]"]
  node_name["Name it mode<br/>[index.html]"]
  node_setup["Practice setup<br/>[index.html]"]
  node_solfege["Solfège mode<br/>[index.html]"]
end

subgraph group_audio["Audio and notation"]
  node_piano["Piano playback<br/>[index.html]"]
  node_samples["Piano samples"]
  node_pitch["Pitch detection<br/>[index.html]"]
  node_tuner["Tuner<br/>[index.html]"]
  node_staff["Staff display<br/>[index.html]"]
end

subgraph group_learning["Learning and progress"]
  node_feedback["Answer feedback<br/>[index.html]"]
  node_progress["Progress and CSV<br/>[index.html]"]
  node_help["Built-in guide<br/>[index.html]"]
end

subgraph group_offline["Offline app"]
  node_worker["Service worker<br/>[sw.js]"]
  node_manifest["App manifest"]
  node_offline_cache[("Cache storage")]
end

node_singer(("Learner"))
node_web_audio["Web Audio API"]
node_microphone["Microphone"]
node_browser_storage[("Browser storage")]

node_singer -->|"uses"| node_app
node_app -->|"offers"| node_sing
node_app -->|"offers"| node_name
node_app -->|"configures"| node_setup
node_sing -->|"supports"| node_solfege
node_name -->|"supports"| node_solfege
node_sing -->|"plays reference"| node_piano
node_name -->|"plays intervals"| node_piano
node_piano -->|"uses samples"| node_samples
node_piano -->|"plays through"| node_web_audio
node_sing -->|"listens through"| node_microphone
node_tuner -->|"listens through"| node_microphone
node_microphone -->|"provides audio"| node_pitch
node_pitch -->|"scores pitch"| node_feedback
node_name -->|"checks answer"| node_feedback
node_solfege -->|"shows notes"| node_staff
node_feedback -->|"records results"| node_progress
node_progress -->|"stores privately"| node_browser_storage
node_progress -->|"exports CSV"| node_singer
node_app -->|"provides guide"| node_help
node_app -.->|"registers for offline use"| node_worker
node_worker -->|"caches resources"| node_offline_cache
node_worker -->|"caches"| node_manifest
node_worker -->|"caches"| node_samples
node_worker -->|"serves cached app"| node_app
node_manifest -->|"sets start page"| node_app

click node_app "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_sing "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_name "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_setup "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_solfege "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_piano "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_samples "https://github.com/dffmonolith/intervals/blob/main/intervals-piano-samples.json"
click node_pitch "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_tuner "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_staff "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_feedback "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_progress "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_help "https://github.com/dffmonolith/intervals/blob/main/index.html"
click node_worker "https://github.com/dffmonolith/intervals/blob/main/sw.js"
click node_manifest "https://github.com/dffmonolith/intervals/blob/main/manifest.webmanifest"

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,node_sing,node_name,node_setup,node_solfege toneBlue
class node_piano,node_samples,node_pitch,node_tuner,node_staff,node_browser_storage toneAmber
class node_feedback,node_progress,node_help,node_web_audio toneMint
class node_worker,node_manifest,node_offline_cache toneRose
class node_singer,node_microphone toneIndigo
```

## Components

### Practice modes

- [Intervals app](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`
- [Sing mode](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`
- [Name it mode](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`
- [Practice setup](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`
- [Solfège mode](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`

### Audio and notation

- [Piano playback](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`
- [Piano samples](https://github.com/dffmonolith/intervals/blob/main/intervals-piano-samples.json): `intervals-piano-samples.json`
- [Pitch detection](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`
- [Tuner](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`
- [Staff display](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`

### Learning and progress

- [Answer feedback](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`
- [Progress and CSV](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`
- [Built-in guide](https://github.com/dffmonolith/intervals/blob/main/index.html): `index.html`

### Offline app

- [Service worker](https://github.com/dffmonolith/intervals/blob/main/sw.js): `sw.js`
- [App manifest](https://github.com/dffmonolith/intervals/blob/main/manifest.webmanifest): `manifest.webmanifest`
- **Cache storage**

### Other components

- **Learner**
- **Web Audio API**
- **Microphone**
- **Browser storage**

## Connections

- Learner → Intervals app: uses (evidence: `README.md`)
- Intervals app → Sing mode: offers (evidence: `README.md`)
- Intervals app → Name it mode: offers (evidence: `README.md`)
- Intervals app → Practice setup: configures (evidence: `README.md`)
- Sing mode → Solfège mode: supports (evidence: `README.md`)
- Name it mode → Solfège mode: supports (evidence: `README.md`)
- Sing mode → Piano playback: plays reference (evidence: `README.md`)
- Name it mode → Piano playback: plays intervals (evidence: `README.md`)
- Piano playback → Piano samples: uses samples (evidence: `README.md`)
- Piano playback → Web Audio API: plays through (evidence: `README.md`)
- Sing mode → Microphone: listens through (evidence: `README.md`)
- Tuner → Microphone: listens through (evidence: `README.md`)
- Microphone → Pitch detection: provides audio (evidence: `README.md`)
- Pitch detection → Answer feedback: scores pitch (evidence: `README.md`)
- Name it mode → Answer feedback: checks answer (evidence: `README.md`)
- Solfège mode → Staff display: shows notes (evidence: `README.md`)
- Answer feedback → Progress and CSV: records results (evidence: `README.md`)
- Progress and CSV → Browser storage: stores privately (evidence: `README.md`)
- Progress and CSV → Learner: exports CSV (evidence: `README.md`)
- Intervals app → Built-in guide: provides guide (evidence: `README.md`)
- Intervals app → Service worker: registers for offline use
- Service worker → Cache storage: caches resources (evidence: `sw.js`)
- Service worker → App manifest: caches (evidence: `sw.js`)
- Service worker → Piano samples: caches (evidence: `sw.js`)
- Service worker → Intervals app: serves cached app (evidence: `sw.js`)
- App manifest → Intervals app: sets start page
