# skotm/meteoquake architecture

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

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

## Overview

#### Purpose and Delivery

MeteoQuake is a Japanese earthquake, tsunami, weather, and disaster-information viewer. The currently implemented focus is earthquake information sourced from P2P Earthquake Information APIs and Japan Meteorological Agency intensity data; other tabs are under development.

It is a static client-side web application, deployable as a PWA and published through GitHub Pages. Main deployment automation is in `.github/workflows/deploy.yml`.

#### Application Entry and Runtime

Vite boots the React application from `src/main.jsx`, which mounts the root UI component in `src/App.jsx`. Global and application-specific styling are split between `src/index.css` and `src/App.css`.

- `src/main.jsx`
- `src/App.jsx`
- `index.html`
- `vite.config.ts`

The runtime is browser-only: no backend, server routes, or repository-hosted API service is present.

#### Root UI and Feature Composition

`App.jsx` is the architectural center for the current application surface: it owns the visible app composition, likely including the information tabs referenced by the README and their client-side state/control flow. Earthquake viewing is the primary active domain; tsunami, weather, and warning/disaster tabs are planned boundaries rather than implemented service modules in this tree.

- `src/App.jsx`
- `src/App.css`
- `src/index.css`

#### External Information Boundary

The browser application fetches earthquake data from external providers: the P2P Earthquake Information API and JMA’s seismic-intensity database, as described in the README. These are remote-data boundaries: availability, schema changes, request failures, and CORS behavior are handled entirely by the frontend because no proxy/backend exists.

The repository itself packages geographic reference datasets rather than generating them dynamically.

- `public/map/stations_with_amp_revised.json`
- `public/map/prefectures.json`
- `public/map/細分区域.json`

#### Geographic Visualization Assets

Static GeoJSON/JSON files in `public/map` support map-oriented earthquake presentation: world and prefectural outlines, plate boundaries, faults, station data, and regional subdivisions. Vite serves these unchanged from the public asset root, allowing runtime fetches or direct URLs without bundling them into JavaScript.

- `public/map/world.json`
- `public/map/plate-boundaries.json`
- `public/map/faults.geojson`

#### Static Content and Policy Boundary

User-facing legal and notice content is static public content, independently addressable from the application bundle. This keeps operational notices and policy documents outside React component deployment logic.

- `public/notices.md`
- `public/privacy-policy.md`
- `public/terms-of-use.md`

#### Build, Hosting, and PWA Context

The project uses Node/npm with Vite and React, indicated by `package.json`, `package-lock.json`, and `vite.config.ts`. TypeScript configuration exists for tooling/build checking, while the visible app source is JSX. GitHub Actions deploys the generated static site, consistent with the GitHub Pages URL in the README.

- `package.json`
- `vite.config.ts`
- `.github/workflows/deploy.yml`

Main entry points: [`src/App.jsx`](https://github.com/skotm/meteoquake/blob/main/src/App.jsx) (Root application UI), [`src/main.jsx`](https://github.com/skotm/meteoquake/blob/main/src/main.jsx) (React bootstrap), [`index.html`](https://github.com/skotm/meteoquake/blob/main/index.html) (HTML entry), [`vite.config.ts`](https://github.com/skotm/meteoquake/blob/main/vite.config.ts) (Vite build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser application"]
  node_html["HTML entry<br/>Vite entry<br/>[index.html]"]
  node_main["React bootstrap<br/>JSX entry<br/>[main.jsx]"]
  node_app["Root application UI<br/>React component<br/>[App.jsx]"]
  node_app_css["Application styles<br/>CSS<br/>[App.css]"]
  node_global_css["Global styles<br/>CSS<br/>[index.css]"]
end

subgraph group_data["Data boundaries"]
  node_p2p_api{{"P2P Earthquake API<br/>external API"}}
  node_jma_api{{"JMA intensity database<br/>external API"}}
  node_station_data["Station reference data<br/>public JSON"]
  node_prefecture_data["Prefecture boundaries<br/>public JSON<br/>[prefectures.json]"]
  node_subdivision_data["Regional subdivisions<br/>public JSON<br/>[細分区域.json]"]
  node_world_data["World outlines<br/>public JSON<br/>[world.json]"]
  node_plate_data["Plate boundaries<br/>public JSON"]
  node_fault_data["Fault geometry<br/>public GeoJSON<br/>[faults.geojson]"]
  node_legal_content["Notices and policies<br/>public Markdown<br/>[notices.md]"]
end

subgraph group_delivery["Build and delivery"]
  node_vite["Vite build<br/>build tool<br/>[vite.config.ts]"]
  node_npm["Node dependencies<br/>npm project<br/>[package.json]"]
  node_deploy["Pages deployment<br/>GitHub Actions workflow<br/>[deploy.yml]"]
  node_github_pages{{"GitHub Pages<br/>static hosting"}}
end

node_html -->|"loads"| node_main
node_main -->|"mounts"| node_app
node_main -->|"applies"| node_global_css
node_app -->|"uses"| node_app_css
node_app -->|"fetches earthquake data"| node_p2p_api
node_app -->|"fetches intensity data"| node_jma_api
node_app -->|"loads map reference"| node_station_data
node_app -->|"loads map geometry"| node_prefecture_data
node_app -->|"loads regional data"| node_subdivision_data
node_app -->|"loads map geometry"| node_world_data
node_app -->|"loads map geometry"| node_plate_data
node_app -->|"loads map geometry"| node_fault_data
node_npm -->|"provides tooling"| node_vite
node_vite -.->|"builds static site from"| node_html
node_deploy -->|"runs build"| node_vite
node_deploy -->|"publishes"| node_github_pages
node_github_pages -.->|"serves"| node_html
node_github_pages -.->|"serves"| node_legal_content

click node_html "https://github.com/skotm/meteoquake/blob/main/index.html"
click node_main "https://github.com/skotm/meteoquake/blob/main/src/main.jsx"
click node_app "https://github.com/skotm/meteoquake/blob/main/src/App.jsx"
click node_app_css "https://github.com/skotm/meteoquake/blob/main/src/App.css"
click node_global_css "https://github.com/skotm/meteoquake/blob/main/src/index.css"
click node_station_data "https://github.com/skotm/meteoquake/blob/main/public/map/stations_with_amp_revised.json"
click node_prefecture_data "https://github.com/skotm/meteoquake/blob/main/public/map/prefectures.json"
click node_subdivision_data "https://github.com/skotm/meteoquake/blob/main/public/map/%E7%B4%B0%E5%88%86%E5%8C%BA%E5%9F%9F.json"
click node_world_data "https://github.com/skotm/meteoquake/blob/main/public/map/world.json"
click node_plate_data "https://github.com/skotm/meteoquake/blob/main/public/map/plate-boundaries.json"
click node_fault_data "https://github.com/skotm/meteoquake/blob/main/public/map/faults.geojson"
click node_legal_content "https://github.com/skotm/meteoquake/blob/main/public/notices.md"
click node_vite "https://github.com/skotm/meteoquake/blob/main/vite.config.ts"
click node_npm "https://github.com/skotm/meteoquake/blob/main/package.json"
click node_deploy "https://github.com/skotm/meteoquake/blob/main/.github/workflows/deploy.yml"

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_html,node_main,node_app,node_app_css,node_global_css toneBlue
class node_p2p_api,node_jma_api,node_station_data,node_prefecture_data,node_subdivision_data,node_world_data,node_plate_data,node_fault_data,node_legal_content toneAmber
class node_vite,node_npm,node_deploy,node_github_pages toneMint
```

## Components

### Browser application

Client-side React runtime.

- [HTML entry](https://github.com/skotm/meteoquake/blob/main/index.html): Vite entry · `index.html`
- [React bootstrap](https://github.com/skotm/meteoquake/blob/main/src/main.jsx): JSX entry · `src/main.jsx`
- [Root application UI](https://github.com/skotm/meteoquake/blob/main/src/App.jsx): React component · Composes the active earthquake-viewing surface and client-side controls. · `src/App.jsx`
- [Application styles](https://github.com/skotm/meteoquake/blob/main/src/App.css): CSS · `src/App.css`
- [Global styles](https://github.com/skotm/meteoquake/blob/main/src/index.css): CSS · `src/index.css`

### Data boundaries

Remote earthquake feeds and public map assets.

- **P2P Earthquake API**: external API · Browser-fetched earthquake information.
- **JMA intensity database**: external API · Browser-fetched seismic-intensity data.
- [Station reference data](https://github.com/skotm/meteoquake/blob/main/public/map/stations_with_amp_revised.json): public JSON · `public/map/stations_with_amp_revised.json`
- [Prefecture boundaries](https://github.com/skotm/meteoquake/blob/main/public/map/prefectures.json): public JSON · `public/map/prefectures.json`
- [Regional subdivisions](https://github.com/skotm/meteoquake/blob/main/public/map/%E7%B4%B0%E5%88%86%E5%8C%BA%E5%9F%9F.json): public JSON · `public/map/細分区域.json`
- [World outlines](https://github.com/skotm/meteoquake/blob/main/public/map/world.json): public JSON · `public/map/world.json`
- [Plate boundaries](https://github.com/skotm/meteoquake/blob/main/public/map/plate-boundaries.json): public JSON · `public/map/plate-boundaries.json`
- [Fault geometry](https://github.com/skotm/meteoquake/blob/main/public/map/faults.geojson): public GeoJSON · `public/map/faults.geojson`
- [Notices and policies](https://github.com/skotm/meteoquake/blob/main/public/notices.md): public Markdown · Independently addressable legal and notice content. · `public/notices.md`

### Build and delivery

Static-site build and GitHub Pages deployment.

- [Vite build](https://github.com/skotm/meteoquake/blob/main/vite.config.ts): build tool · Builds the React application into static assets. · `vite.config.ts`
- [Node dependencies](https://github.com/skotm/meteoquake/blob/main/package.json): npm project · `package.json`
- [Pages deployment](https://github.com/skotm/meteoquake/blob/main/.github/workflows/deploy.yml): GitHub Actions workflow · Publishes the generated static site. · `.github/workflows/deploy.yml`
- **GitHub Pages**: static hosting

## Connections

- HTML entry → React bootstrap: loads
- React bootstrap → Root application UI: mounts
- React bootstrap → Global styles: applies
- Root application UI → Application styles: uses
- Root application UI → P2P Earthquake API: fetches earthquake data
- Root application UI → JMA intensity database: fetches intensity data
- Root application UI → Station reference data: loads map reference
- Root application UI → Prefecture boundaries: loads map geometry
- Root application UI → Regional subdivisions: loads regional data
- Root application UI → World outlines: loads map geometry
- Root application UI → Plate boundaries: loads map geometry
- Root application UI → Fault geometry: loads map geometry
- Node dependencies → Vite build: provides tooling
- Vite build → HTML entry: builds static site from
- Pages deployment → Vite build: runs build
- Pages deployment → GitHub Pages: publishes
- GitHub Pages → HTML entry: serves
- GitHub Pages → Notices and policies: serves
