# skotm/meteoquake-kyoshinviewer architecture

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

- Interactive diagram: https://gitdiagram.com/skotm/meteoquake-kyoshinviewer
- Repository: https://github.com/skotm/meteoquake-kyoshinviewer

## Overview

MeteoQuake-KyoshinViewer is a browser app for live seismic intensity and earthquake, EEW, and tsunami information. Users open the map-based real-time view, inspect quake records and tsunami advisories, and can search historical events or configure the display. App.jsx is the visible orchestration point for live data and history loading; map and analysis modules support the real-time view. The index and excerpts support the main module relationships, but some wiring and implementations were not sampled, so those links are omitted or marked unverified.

Main entry points: [`src/App.jsx`](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/App.jsx) (App orchestration), [`src/app/MapCanvas.jsx`](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/MapCanvas.jsx) (Live map), [`src/shakeDetection.ts`](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/shakeDetection.ts) (Shake detection), [`src/app/tsunamiData.js`](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/tsunamiData.js) (Tsunami history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App orchestration<br/>[App.jsx]"]
  node_overlay["Map overlays<br/>[mapOverlayUi.jsx]"]
  node_settings["Settings UI<br/>[settingsPanels.jsx]"]
end

subgraph group_live["Live Seismic View"]
  node_realtime["Live stream hook"]
  node_protocol["Stream protocol client"]
  node_map["Live map<br/>[MapCanvas.jsx]"]
  node_shake["Shake detection<br/>[shakeDetection.ts]"]
  node_grid["Grid detection<br/>[gridDetection.ts]"]
  node_weak["Weak-array detection"]
  node_epicenter["Epicenter estimation"]
  node_confidence["Epicenter confidence"]
  node_travel["JMA travel time<br/>[jmaTravelTime.ts]"]
end

subgraph group_earthquake["Earthquake Information"]
  node_quake["Quake history<br/>[quakeCards.js]"]
  node_eqdb["JMA quake database<br/>[eqdb.js]"]
  node_search["Quake search UI<br/>[quakeSearchUi.jsx]"]
end

subgraph group_tsunami["Tsunami Information"]
  node_tsunami["Tsunami history<br/>[tsunamiData.js]"]
  node_tsunamiui["Tsunami view<br/>[tsunamiTideUi.jsx]"]
end

subgraph group_shared["Shared Services"]
  node_loaders["Map data loaders<br/>[mapDataLoaders.js]"]
  node_geo["Geospatial utilities<br/>[geo.js]"]
  node_storage[("Persistent settings<br/>[settingsStorage.js]")]
  node_theme["Theme system<br/>[theme.js]"]
  node_schemes["Intensity color schemes<br/>[colorSchemes.js]"]
end

node_user(("Viewer"))
node_realtime_source(("Strong-motion feeds"))
node_p2p{{"P2P Quake API"}}
node_jma{{"Japan Meteorological Agency"}}

node_user -->|"opens"| node_app
node_app -->|"uses stream"| node_realtime
node_realtime -->|"uses client"| node_protocol
node_app -.->|"renders view"| node_map
node_map -->|"uses detection"| node_shake
node_shake -->|"uses detection"| node_grid
node_shake -->|"uses detection"| node_weak
node_shake -->|"uses timing"| node_travel
node_map -->|"uses estimates"| node_epicenter
node_epicenter -->|"uses confidence"| node_confidence
node_epicenter -->|"uses timing"| node_travel
node_app -->|"loads history"| node_quake
node_app -->|"loads history"| node_tsunami
node_search -->|"searches events"| node_eqdb
node_tsunamiui -->|"reads advisories"| node_tsunami
node_overlay -->|"uses grades"| node_tsunami
node_search -->|"loads names"| node_loaders
node_map -->|"loads map data"| node_loaders
node_map -->|"finds place"| node_geo
node_settings -->|"uses preferences"| node_storage
node_app -->|"persists settings"| node_storage
node_overlay -->|"uses colors"| node_schemes
node_overlay -->|"uses theme"| node_theme
node_realtime_source -.->|"provides observations"| node_realtime
node_p2p -->|"provides records"| node_quake
node_jma -->|"provides advisories"| node_tsunami
node_jma -.->|"provides records"| node_eqdb

click node_app "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/App.jsx"
click node_realtime "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/useRealtimeStream.ts"
click node_protocol "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/realtimeProtocolClient.ts"
click node_map "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/MapCanvas.jsx"
click node_shake "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/shakeDetection.ts"
click node_grid "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/gridDetection.ts"
click node_weak "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/weakArrayDetection.ts"
click node_epicenter "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/epicenterEstimation.ts"
click node_confidence "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/epicenterConfidence.ts"
click node_travel "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/jmaTravelTime.ts"
click node_quake "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/quakeCards.js"
click node_eqdb "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/eqdb.js"
click node_search "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/quakeSearchUi.jsx"
click node_tsunami "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/tsunamiData.js"
click node_tsunamiui "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/tsunamiTideUi.jsx"
click node_overlay "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/mapOverlayUi.jsx"
click node_loaders "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/mapDataLoaders.js"
click node_geo "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/geo.js"
click node_settings "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/settingsPanels.jsx"
click node_storage "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/settingsStorage.js"
click node_theme "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/theme.js"
click node_schemes "https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/colorSchemes.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_app,node_overlay,node_settings,node_user toneBlue
class node_realtime,node_protocol,node_map,node_shake,node_grid,node_weak,node_epicenter,node_confidence,node_travel toneAmber
class node_quake,node_eqdb,node_search,node_p2p toneMint
class node_tsunami,node_tsunamiui toneRose
class node_loaders,node_geo,node_storage,node_theme,node_schemes,node_realtime_source,node_jma toneIndigo
```

## Components

### Application

- [App orchestration](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/App.jsx): `src/App.jsx`
- [Map overlays](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/mapOverlayUi.jsx): `src/app/mapOverlayUi.jsx`
- [Settings UI](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/settingsPanels.jsx): `src/app/settingsPanels.jsx`

### Live Seismic View

- [Live stream hook](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/useRealtimeStream.ts): `src/useRealtimeStream.ts`
- [Stream protocol client](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/realtimeProtocolClient.ts): `src/realtimeProtocolClient.ts`
- [Live map](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/MapCanvas.jsx): `src/app/MapCanvas.jsx`
- [Shake detection](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/shakeDetection.ts): `src/shakeDetection.ts`
- [Grid detection](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/gridDetection.ts): `src/gridDetection.ts`
- [Weak-array detection](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/weakArrayDetection.ts): `src/weakArrayDetection.ts`
- [Epicenter estimation](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/epicenterEstimation.ts): `src/epicenterEstimation.ts`
- [Epicenter confidence](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/epicenterConfidence.ts): `src/epicenterConfidence.ts`
- [JMA travel time](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/jmaTravelTime.ts): `src/jmaTravelTime.ts`

### Earthquake Information

- [Quake history](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/quakeCards.js): `src/app/quakeCards.js`
- [JMA quake database](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/eqdb.js): `src/app/eqdb.js`
- [Quake search UI](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/quakeSearchUi.jsx): `src/app/quakeSearchUi.jsx`

### Tsunami Information

- [Tsunami history](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/tsunamiData.js): `src/app/tsunamiData.js`
- [Tsunami view](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/tsunamiTideUi.jsx): `src/app/tsunamiTideUi.jsx`

### Shared Services

- [Map data loaders](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/mapDataLoaders.js): `src/app/mapDataLoaders.js`
- [Geospatial utilities](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/geo.js): `src/app/geo.js`
- [Persistent settings](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/settingsStorage.js): `src/app/settingsStorage.js`
- [Theme system](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/theme.js): `src/app/theme.js`
- [Intensity color schemes](https://github.com/skotm/meteoquake-kyoshinviewer/blob/main/src/app/colorSchemes.js): `src/app/colorSchemes.js`

### Other components

- **Viewer**
- **Strong-motion feeds**
- **P2P Quake API**
- **Japan Meteorological Agency**

## Connections

- Viewer → App orchestration: opens (evidence: `README.md`)
- App orchestration → Live stream hook: uses stream (evidence: `src/App.jsx`)
- Live stream hook → Stream protocol client: uses client (evidence: `src/useRealtimeStream.ts`)
- App orchestration → Live map: renders view (evidence: `src/App.jsx`)
- Live map → Shake detection: uses detection (evidence: `src/app/MapCanvas.jsx`)
- Shake detection → Grid detection: uses detection (evidence: `src/gridDetection.ts`)
- Shake detection → Weak-array detection: uses detection (evidence: `src/shakeDetection.ts`)
- Shake detection → JMA travel time: uses timing (evidence: `src/shakeDetection.ts`)
- Live map → Epicenter estimation: uses estimates (evidence: `src/app/MapCanvas.jsx`)
- Epicenter estimation → Epicenter confidence: uses confidence (evidence: `src/epicenterEstimation.ts`)
- Epicenter estimation → JMA travel time: uses timing (evidence: `src/epicenterEstimation.ts`)
- App orchestration → Quake history: loads history (evidence: `src/App.jsx`)
- App orchestration → Tsunami history: loads history (evidence: `src/App.jsx`)
- Quake search UI → JMA quake database: searches events (evidence: `src/app/quakeSearchUi.jsx`)
- Tsunami view → Tsunami history: reads advisories (evidence: `src/app/tsunamiTideUi.jsx`)
- Map overlays → Tsunami history: uses grades (evidence: `src/app/mapOverlayUi.jsx`)
- Quake search UI → Map data loaders: loads names (evidence: `src/app/quakeSearchUi.jsx`)
- Live map → Map data loaders: loads map data (evidence: `src/app/MapCanvas.jsx`)
- Live map → Geospatial utilities: finds place (evidence: `src/app/MapCanvas.jsx`)
- Settings UI → Persistent settings: uses preferences (evidence: `src/app/settingsPanels.jsx`)
- App orchestration → Persistent settings: persists settings (evidence: `src/App.jsx`)
- Map overlays → Intensity color schemes: uses colors (evidence: `src/app/mapOverlayUi.jsx`)
- Map overlays → Theme system: uses theme (evidence: `src/app/mapOverlayUi.jsx`)
- Strong-motion feeds → Live stream hook: provides observations (evidence: `README.md`)
- P2P Quake API → Quake history: provides records (evidence: `src/app/quakeCards.js`)
- Japan Meteorological Agency → Tsunami history: provides advisories (evidence: `src/app/tsunamiData.js`)
- Japan Meteorological Agency → JMA quake database: provides records (evidence: `README.md`)
