How bariskisir/earthquakesignal works
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: index.ts Lifecycle bootstrap · EarthquakeService.ts Earthquake receiver · App.tsx Application shell · useAppInit.ts Renderer initialization
Components 29
Main process
- Lifecycle bootstrap
src/main/index.ts - IPC handlers
src/main/ipc.ts - Settings and sessions
src/main/services/StorageService.ts - Settings schema
src/main/settingsSchema.ts - Native window
src/main/services/WindowService.ts - System tray
src/main/services/TrayService.ts - Update service
src/main/services/AppUpdater.ts - GitHub release client
src/main/services/GitHubReleaseClient.ts - Telemetry service
src/main/services/TelemetryService.ts
Desktop interface
- Application shell
src/renderer/src/App.tsx - Renderer initialization
src/renderer/src/hooks/useAppInit.ts - Earthquake workspace
src/renderer/src/pages/home/HomePage.tsx - Session management
src/renderer/src/components/sidebar/SessionsSidebar.tsx - Session commands
src/renderer/src/hooks/useSessionActions.ts - Application state
src/renderer/src/store/appSlice.ts - Event map
src/renderer/src/components/earthquake/EarthquakeEventMap.tsx - Overview map
src/renderer/src/components/earthquake/EarthquakeOverviewMap.tsx - Fullscreen warning
src/renderer/src/components/app/FullscreenEarthquakeAlert.tsx - Alert sound
src/renderer/src/services/EarthquakeAlarmService.ts - Settings page
src/renderer/src/pages/settings/SettingsPage.tsx
Renderer bridge
- Typed desktop API
src/preload/index.ts - IPC channel contract
src/shared/IpcChannel.ts
Earthquake workflow
- Earthquake receiver
src/main/services/EarthquakeService.ts - Payload parser
src/main/services/EarthquakePayloadParser.ts - Network configuration
src/main/earthquakeNetworkConfig.ts
Other components
- Desktop user
- Push and seismic networks
- GitHub Releases
- Telemetry endpoint
Connections 36
- 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