# bariskisir/turkiyeearthquakeforecast architecture

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

- Interactive diagram: https://gitdiagram.com/bariskisir/turkiyeearthquakeforecast
- Repository: https://github.com/bariskisir/turkiyeearthquakeforecast

## Overview

This is an experimental Türkiye regional seismic-signal dashboard, not an earthquake warning or exact-event prediction system. The main workflow runs from dashboard selection to a date-specific forecast request, through catalogue refresh and model calculation (preparation, field construction, ranking), then returns regional signals for map display. The separate recent-event catalogue and methodology/privacy UI are supporting product capabilities. Relationships reflect the README’s documented boundaries and sampled calls; internal cache-adapter wiring and some component details are represented only where the tree or documentation supports them.

Main entry points: [`src/components/Dashboard.tsx`](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/Dashboard.tsx) (Dashboard), [`src/lib/catalog-service.ts`](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/catalog-service.ts) (Catalogue refresh), [`src/lib/forecast-service.ts`](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/forecast-service.ts) (Forecast service), [`src/components/useDashboard.ts`](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/useDashboard.ts) (Dashboard state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard experience"]
  node_page["Home page<br/>[page.tsx]"]
  node_dashboard_ui["Dashboard<br/>[Dashboard.tsx]"]
  node_dashboard_hook["Dashboard state<br/>[useDashboard.ts]"]
  node_controls["Controls"]
  node_workspace["Forecast workspace"]
  node_map["Signal map<br/>[ForecastMap.tsx]"]
  node_recent["Recent earthquakes"]
  node_methodology["Methodology dialog"]
  node_privacy["Privacy dialog<br/>[PrivacyModal.tsx]"]
  node_browser_storage["Browser preferences<br/>[browser-storage.ts]"]
  node_telemetry["Telemetry tracker"]
end

subgraph group_catalogue["Earthquake catalogue"]
  node_catalog_entry["Catalogue access<br/>[catalog.ts]"]
  node_catalog_service["Catalogue refresh<br/>[catalog-service.ts]"]
  node_catalog_domain["Catalogue validation<br/>[catalog-domain.ts]"]
  node_sismik_client["Provider client<br/>[sismik-client.ts]"]
end

subgraph group_forecast["Forecast engine"]
  node_model_context["Model preparation<br/>[model-context.ts]"]
  node_forecast_engine["Field and ranking<br/>[index.ts]"]
  node_forecast_modules["Model calculations"]
end

subgraph group_delivery["API and caching"]
  node_forecast_route["Forecast HTTP route<br/>[route.ts]"]
  node_forecast_service["Forecast service"]
  node_forecast_cache["Forecast cache<br/>[forecast-cache.ts]"]
  node_b2_cache["B2 adapter<br/>[b2-cache.ts]"]
end

subgraph group_integrations["External services"]
  node_provider["Sismik Harita API"]
  node_object_store[("Backblaze B2")]
  node_basemaps["OpenStreetMap / CARTO"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_page
node_page -->|"renders"| node_dashboard_ui
node_dashboard_ui -->|"uses state"| node_dashboard_hook
node_dashboard_ui -->|"presents"| node_controls
node_dashboard_ui -->|"presents"| node_workspace
node_dashboard_ui -->|"presents"| node_methodology
node_dashboard_ui -->|"presents"| node_privacy
node_dashboard_hook -->|"fetches forecasts"| node_forecast_route
node_dashboard_hook -->|"reads/writes preferences"| node_browser_storage
node_workspace -->|"renders signals"| node_map
node_workspace -->|"renders events"| node_recent
node_map -->|"stores map view"| node_browser_storage
node_map -.->|"loads tiles"| node_basemaps
node_forecast_route -->|"requests forecast"| node_forecast_service
node_forecast_service -->|"gets catalogue"| node_catalog_entry
node_forecast_service -->|"calculates matrix"| node_forecast_engine
node_forecast_service -->|"reads/writes bundles"| node_forecast_cache
node_catalog_entry -->|"coordinates refresh"| node_catalog_service
node_catalog_service -->|"normalises and merges"| node_catalog_domain
node_catalog_service -->|"fetches updates"| node_sismik_client
node_sismik_client -->|"requests events"| node_provider
node_catalog_service -->|"persists daily updates"| node_object_store
node_forecast_cache -->|"uses adapter"| node_b2_cache
node_b2_cache -->|"stores forecast bundles"| node_object_store
node_forecast_engine -->|"prepares events"| node_model_context
node_model_context -->|"uses model calculations"| node_forecast_modules
node_forecast_engine -->|"builds and ranks fields"| node_forecast_modules
node_telemetry -.->|"tracks usage"| node_visitor

click node_page "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/app/page.tsx"
click node_dashboard_ui "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/Dashboard.tsx"
click node_dashboard_hook "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/useDashboard.ts"
click node_controls "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/DashboardControls.tsx"
click node_workspace "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/ForecastWorkspace.tsx"
click node_map "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/ForecastMap.tsx"
click node_recent "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/RecentEarthquakes.tsx"
click node_methodology "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/MethodologyModal.tsx"
click node_privacy "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/PrivacyModal.tsx"
click node_browser_storage "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/browser-storage.ts"
click node_forecast_route "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/app/api/forecast/route.ts"
click node_forecast_service "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/forecast-service.ts"
click node_forecast_cache "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/forecast-cache.ts"
click node_b2_cache "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/b2-cache.ts"
click node_catalog_entry "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/catalog.ts"
click node_catalog_service "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/catalog-service.ts"
click node_catalog_domain "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/catalog-domain.ts"
click node_sismik_client "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/sismik-client.ts"
click node_model_context "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/forecast/model-context.ts"
click node_forecast_engine "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/forecast/index.ts"
click node_forecast_modules "https://github.com/bariskisir/turkiyeearthquakeforecast/tree/master/src/lib/forecast"
click node_telemetry "https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/TelemetryTracker.tsx"

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_page,node_dashboard_ui,node_dashboard_hook,node_controls,node_workspace,node_map,node_recent,node_methodology,node_privacy,node_browser_storage,node_telemetry toneBlue
class node_catalog_entry,node_catalog_service,node_catalog_domain,node_sismik_client toneAmber
class node_model_context,node_forecast_engine,node_forecast_modules toneMint
class node_forecast_route,node_forecast_service,node_forecast_cache,node_b2_cache toneRose
class node_provider,node_object_store,node_basemaps,node_visitor toneIndigo
```

## Components

### Dashboard experience

- [Home page](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Dashboard](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/Dashboard.tsx): `src/components/Dashboard.tsx`
- [Dashboard state](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/useDashboard.ts): `src/components/useDashboard.ts`
- [Controls](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/DashboardControls.tsx): `src/components/DashboardControls.tsx`
- [Forecast workspace](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/ForecastWorkspace.tsx): `src/components/ForecastWorkspace.tsx`
- [Signal map](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/ForecastMap.tsx): `src/components/ForecastMap.tsx`
- [Recent earthquakes](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/RecentEarthquakes.tsx): `src/components/RecentEarthquakes.tsx`
- [Methodology dialog](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/MethodologyModal.tsx): `src/components/MethodologyModal.tsx`
- [Privacy dialog](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/PrivacyModal.tsx): `src/components/PrivacyModal.tsx`
- [Browser preferences](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/browser-storage.ts): `src/lib/browser-storage.ts`
- [Telemetry tracker](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/components/TelemetryTracker.tsx): `src/components/TelemetryTracker.tsx`

### Earthquake catalogue

- [Catalogue access](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/catalog.ts): `src/lib/catalog.ts`
- [Catalogue refresh](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/catalog-service.ts): `src/lib/catalog-service.ts`
- [Catalogue validation](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/catalog-domain.ts): `src/lib/catalog-domain.ts`
- [Provider client](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/sismik-client.ts): `src/lib/sismik-client.ts`

### Forecast engine

- [Model preparation](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/forecast/model-context.ts): `src/lib/forecast/model-context.ts`
- [Field and ranking](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/forecast/index.ts): `src/lib/forecast/index.ts`
- [Model calculations](https://github.com/bariskisir/turkiyeearthquakeforecast/tree/master/src/lib/forecast): `src/lib/forecast`

### API and caching

- [Forecast HTTP route](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/app/api/forecast/route.ts): `src/app/api/forecast/route.ts`
- [Forecast service](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/forecast-service.ts): `src/lib/forecast-service.ts`
- [Forecast cache](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/forecast-cache.ts): `src/lib/forecast-cache.ts`
- [B2 adapter](https://github.com/bariskisir/turkiyeearthquakeforecast/blob/master/src/lib/b2-cache.ts): `src/lib/b2-cache.ts`

### External services

- **Sismik Harita API**
- **Backblaze B2**
- **OpenStreetMap / CARTO**

### Other components

- **Visitor**

## Connections

- Visitor → Home page: opens
- Home page → Dashboard: renders
- Dashboard → Dashboard state: uses state
- Dashboard → Controls: presents
- Dashboard → Forecast workspace: presents
- Dashboard → Methodology dialog: presents
- Dashboard → Privacy dialog: presents
- Dashboard state → Forecast HTTP route: fetches forecasts
- Dashboard state → Browser preferences: reads/writes preferences
- Forecast workspace → Signal map: renders signals
- Forecast workspace → Recent earthquakes: renders events
- Signal map → Browser preferences: stores map view
- Signal map → OpenStreetMap / CARTO: loads tiles
- Forecast HTTP route → Forecast service: requests forecast
- Forecast service → Catalogue access: gets catalogue
- Forecast service → Field and ranking: calculates matrix
- Forecast service → Forecast cache: reads/writes bundles
- Catalogue access → Catalogue refresh: coordinates refresh
- Catalogue refresh → Catalogue validation: normalises and merges
- Catalogue refresh → Provider client: fetches updates
- Provider client → Sismik Harita API: requests events
- Catalogue refresh → Backblaze B2: persists daily updates
- Forecast cache → B2 adapter: uses adapter
- B2 adapter → Backblaze B2: stores forecast bundles
- Field and ranking → Model preparation: prepares events
- Model preparation → Model calculations: uses model calculations
- Field and ranking → Model calculations: builds and ranks fields
- Telemetry tracker → Visitor: tracks usage
