# bariskisir/earthquakesignal architecture

> Architecture diagram of the GitHub repository bariskisir/earthquakesignal, 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/earthquakesignal
- Repository: https://github.com/bariskisir/earthquakesignal

## Overview

Earthquake Signal is an Electron desktop app for receiving real-time earthquake alerts, viewing events on maps, and managing saved earthquake sessions. At startup, the main process loads settings and session data, creates the desktop window, registers IPC handlers, and starts earthquake reception. Events can be persisted as sessions and presented in the renderer as alerts; users can browse sessions, adjust settings, and manage the app. The tree and excerpts support the process boundaries and several workflows; unsampled IPC handlers and map wiring are not expanded into speculative call chains.

Main entry points: [`src/main/index.ts`](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/index.ts) (Lifecycle bootstrap), [`src/main/services/EarthquakeService.ts`](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/EarthquakeService.ts) (Earthquake receiver), [`src/renderer/src/App.tsx`](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/App.tsx) (Application shell), [`src/renderer/src/hooks/useAppInit.ts`](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/hooks/useAppInit.ts) (Renderer initialization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_main["Main process"]
  node_main["Lifecycle bootstrap<br/>[index.ts]"]
  node_ipc["IPC handlers<br/>[ipc.ts]"]
  node_storage[("Settings and sessions<br/>[StorageService.ts]")]
  node_settings["Settings schema<br/>[settingsSchema.ts]"]
  node_window_service["Native window<br/>[WindowService.ts]"]
  node_tray["System tray<br/>[TrayService.ts]"]
  node_updater["Update service<br/>[AppUpdater.ts]"]
  node_release_client["GitHub release client"]
  node_telemetry["Telemetry service"]
end

subgraph group_renderer["Desktop interface"]
  node_renderer["Application shell<br/>[App.tsx]"]
  node_init["Renderer initialization<br/>[useAppInit.ts]"]
  node_home["Earthquake workspace<br/>[HomePage.tsx]"]
  node_session_sidebar["Session management"]
  node_session_actions["Session commands"]
  node_state["Application state<br/>[appSlice.ts]"]
  node_event_map["Event map"]
  node_overview_map["Overview map"]
  node_fullscreen_alert["Fullscreen warning"]
  node_alarm["Alert sound"]
  node_settings_ui["Settings page<br/>[SettingsPage.tsx]"]
end

subgraph group_bridge["Renderer bridge"]
  node_preload["Typed desktop API<br/>[index.ts]"]
  node_shared_channels["IPC channel contract<br/>[IpcChannel.ts]"]
end

subgraph group_earthquake["Earthquake workflow"]
  node_earthquake_service["Earthquake receiver"]
  node_payload["Payload parser"]
  node_network_config["Network configuration"]
end

node_user(("Desktop user"))
node_push_network{{"Push and seismic networks"}}
node_github{{"GitHub Releases"}}
node_telemetry_endpoint{{"Telemetry endpoint"}}

node_user -->|"uses"| node_renderer
node_main -->|"initializes and loads"| node_storage
node_main -->|"creates window"| node_window_service
node_main -->|"registers handlers"| node_ipc
node_main -->|"starts receiver"| node_earthquake_service
node_main -->|"creates tray"| node_tray
node_main -->|"configures"| node_updater
node_main -->|"tracks startup"| node_telemetry
node_storage -->|"validates settings"| node_settings
node_earthquake_service -->|"derives topics"| node_network_config
node_earthquake_service -->|"parses messages"| node_payload
node_earthquake_service -->|"registers and receives"| node_push_network
node_earthquake_service -->|"persists sessions"| node_storage
node_renderer -->|"bootstraps"| node_init
node_init -->|"requests bootstrap and subscribes"| node_preload
node_preload -->|"uses channel contract"| node_shared_channels
node_preload -->|"invokes and subscribes"| node_ipc
node_ipc -->|"loads and changes data"| node_storage
node_ipc -->|"controls receiver"| node_earthquake_service
node_ipc -->|"controls updates"| node_updater
node_init -->|"hydrates and updates"| node_state
node_init -->|"plays on alert"| node_alarm
node_init -->|"opens notified session"| node_session_sidebar
node_renderer -->|"shows workspace"| node_home
node_home -->|"renders event details"| node_event_map
node_home -->|"renders overview"| node_overview_map
node_home -->|"provides session navigation"| node_session_sidebar
node_session_sidebar -->|"dispatches commands"| node_session_actions
node_session_actions -->|"loads and edits sessions"| node_preload
node_session_actions -->|"updates selection"| node_state
node_renderer -->|"shows preferences"| node_settings_ui
node_settings_ui -->|"saves settings"| node_preload
node_renderer -->|"presents warnings"| node_fullscreen_alert
node_updater -->|"checks and downloads"| node_release_client
node_release_client -->|"fetches releases"| node_github
node_telemetry -.->|"sends usage data"| node_telemetry_endpoint

click node_main "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/index.ts"
click node_ipc "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/ipc.ts"
click node_storage "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/StorageService.ts"
click node_settings "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/settingsSchema.ts"
click node_earthquake_service "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/EarthquakeService.ts"
click node_payload "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/EarthquakePayloadParser.ts"
click node_network_config "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/earthquakeNetworkConfig.ts"
click node_renderer "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/App.tsx"
click node_init "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/hooks/useAppInit.ts"
click node_preload "https://github.com/bariskisir/earthquakesignal/blob/master/src/preload/index.ts"
click node_shared_channels "https://github.com/bariskisir/earthquakesignal/blob/master/src/shared/IpcChannel.ts"
click node_home "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/pages/home/HomePage.tsx"
click node_session_sidebar "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/components/sidebar/SessionsSidebar.tsx"
click node_session_actions "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/hooks/useSessionActions.ts"
click node_state "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/store/appSlice.ts"
click node_event_map "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/components/earthquake/EarthquakeEventMap.tsx"
click node_overview_map "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/components/earthquake/EarthquakeOverviewMap.tsx"
click node_fullscreen_alert "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/components/app/FullscreenEarthquakeAlert.tsx"
click node_alarm "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/services/EarthquakeAlarmService.ts"
click node_settings_ui "https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/pages/settings/SettingsPage.tsx"
click node_window_service "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/WindowService.ts"
click node_tray "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/TrayService.ts"
click node_updater "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/AppUpdater.ts"
click node_release_client "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/GitHubReleaseClient.ts"
click node_telemetry "https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/TelemetryService.ts"

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_main,node_ipc,node_storage,node_settings,node_window_service,node_tray,node_updater,node_release_client,node_telemetry,node_user toneBlue
class node_renderer,node_init,node_home,node_session_sidebar,node_session_actions,node_state,node_event_map,node_overview_map,node_fullscreen_alert,node_alarm,node_settings_ui toneAmber
class node_preload,node_shared_channels toneMint
class node_earthquake_service,node_payload,node_network_config toneRose
class node_push_network,node_github,node_telemetry_endpoint toneIndigo
```

## Components

### Main process

- [Lifecycle bootstrap](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/index.ts): `src/main/index.ts`
- [IPC handlers](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/ipc.ts): `src/main/ipc.ts`
- [Settings and sessions](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/StorageService.ts): `src/main/services/StorageService.ts`
- [Settings schema](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/settingsSchema.ts): `src/main/settingsSchema.ts`
- [Native window](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/WindowService.ts): `src/main/services/WindowService.ts`
- [System tray](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/TrayService.ts): `src/main/services/TrayService.ts`
- [Update service](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/AppUpdater.ts): `src/main/services/AppUpdater.ts`
- [GitHub release client](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/GitHubReleaseClient.ts): `src/main/services/GitHubReleaseClient.ts`
- [Telemetry service](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/TelemetryService.ts): `src/main/services/TelemetryService.ts`

### Desktop interface

- [Application shell](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/App.tsx): `src/renderer/src/App.tsx`
- [Renderer initialization](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/hooks/useAppInit.ts): `src/renderer/src/hooks/useAppInit.ts`
- [Earthquake workspace](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/pages/home/HomePage.tsx): `src/renderer/src/pages/home/HomePage.tsx`
- [Session management](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/components/sidebar/SessionsSidebar.tsx): `src/renderer/src/components/sidebar/SessionsSidebar.tsx`
- [Session commands](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/hooks/useSessionActions.ts): `src/renderer/src/hooks/useSessionActions.ts`
- [Application state](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/store/appSlice.ts): `src/renderer/src/store/appSlice.ts`
- [Event map](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/components/earthquake/EarthquakeEventMap.tsx): `src/renderer/src/components/earthquake/EarthquakeEventMap.tsx`
- [Overview map](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/components/earthquake/EarthquakeOverviewMap.tsx): `src/renderer/src/components/earthquake/EarthquakeOverviewMap.tsx`
- [Fullscreen warning](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/components/app/FullscreenEarthquakeAlert.tsx): `src/renderer/src/components/app/FullscreenEarthquakeAlert.tsx`
- [Alert sound](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/services/EarthquakeAlarmService.ts): `src/renderer/src/services/EarthquakeAlarmService.ts`
- [Settings page](https://github.com/bariskisir/earthquakesignal/blob/master/src/renderer/src/pages/settings/SettingsPage.tsx): `src/renderer/src/pages/settings/SettingsPage.tsx`

### Renderer bridge

- [Typed desktop API](https://github.com/bariskisir/earthquakesignal/blob/master/src/preload/index.ts): `src/preload/index.ts`
- [IPC channel contract](https://github.com/bariskisir/earthquakesignal/blob/master/src/shared/IpcChannel.ts): `src/shared/IpcChannel.ts`

### Earthquake workflow

- [Earthquake receiver](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/EarthquakeService.ts): `src/main/services/EarthquakeService.ts`
- [Payload parser](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/services/EarthquakePayloadParser.ts): `src/main/services/EarthquakePayloadParser.ts`
- [Network configuration](https://github.com/bariskisir/earthquakesignal/blob/master/src/main/earthquakeNetworkConfig.ts): `src/main/earthquakeNetworkConfig.ts`

### Other components

- **Desktop user**
- **Push and seismic networks**
- **GitHub Releases**
- **Telemetry endpoint**

## Connections

- Desktop user → Application shell: uses
- Lifecycle bootstrap → Settings and sessions: initializes and loads
- Lifecycle bootstrap → Native window: creates window
- Lifecycle bootstrap → IPC handlers: registers handlers
- Lifecycle bootstrap → Earthquake receiver: starts receiver
- Lifecycle bootstrap → System tray: creates tray
- Lifecycle bootstrap → Update service: configures
- Lifecycle bootstrap → Telemetry service: tracks startup
- Settings and sessions → Settings schema: validates settings
- Earthquake receiver → Network configuration: derives topics
- Earthquake receiver → Payload parser: parses messages
- Earthquake receiver → Push and seismic networks: registers and receives
- Earthquake receiver → Settings and sessions: persists sessions
- Application shell → Renderer initialization: bootstraps
- Renderer initialization → Typed desktop API: requests bootstrap and subscribes
- Typed desktop API → IPC channel contract: uses channel contract
- Typed desktop API → IPC handlers: invokes and subscribes
- IPC handlers → Settings and sessions: loads and changes data
- IPC handlers → Earthquake receiver: controls receiver
- IPC handlers → Update service: controls updates
- Renderer initialization → Application state: hydrates and updates
- Renderer initialization → Alert sound: plays on alert
- Renderer initialization → Session management: opens notified session
- Application shell → Earthquake workspace: shows workspace
- Earthquake workspace → Event map: renders event details
- Earthquake workspace → Overview map: renders overview
- Earthquake workspace → Session management: provides session navigation
- Session management → Session commands: dispatches commands
- Session commands → Typed desktop API: loads and edits sessions
- Session commands → Application state: updates selection
- Application shell → Settings page: shows preferences
- Settings page → Typed desktop API: saves settings
- Application shell → Fullscreen warning: presents warnings
- Update service → GitHub release client: checks and downloads
- GitHub release client → GitHub Releases: fetches releases
- Telemetry service → Telemetry endpoint: sends usage data
