AlertDeck
Customizable Home Front Command threat alert system with granular notification control.
The Problem
During missile escalations, the Israeli Home Front Command app sends 'Extreme Alert' notifications 5-6 minutes before each alarm — even when the alert isn't in your area. You can't disable early alerts while keeping real alerts. If you have a shelter at home, these early warnings just wake you up for nothing.
How It Works
The backend connects to 4 different alert sources simultaneously: OREF (official government HTTP API), Tzeva Adom (third-party REST wrapper), and two WebSocket feeds (Tzofar and Tzevadom). This multi-source redundancy ensures alerts are never missed even if one source goes down.
Content-based deduplication prevents duplicate notifications when the same alert arrives from multiple sources. The system uses a unique constraint on (city, timestamp, category) to detect duplicates regardless of the source's data format.
Users organize cities into groups with independent rules — different alert types (missiles, drones, all-clear, early warnings), notification sounds (14+ options), sound priority (critical/normal/silent), and quiet hours per group.
Key Challenges
OREF API requires fragile browser headers and can break without notice
Automatic failover: after 5 consecutive failures on the active source, the system switches to the backup. HTTP polling runs as a gap recovery mechanism when WebSocket feeds drop.
30+ cities alerting simultaneously would flood users with notifications
Wave-based batching with a 3-second window by wave ID. All cities from the same wave are consolidated into a single push notification. Sound priority logic picks the most urgent sound style across all affected groups.
Delivering safety-critical alerts even when phone is on silent
iOS critical alert configuration (interruptionLevel: time-sensitive) and Android notification channel with importance: MAX. Bypasses Do Not Disturb where system permits.