About SafeNow

Your Local Emergency Lifeline. Right Here. Right Now.

Technical Features

Zero JavaScriptPure server-rendered HTML. Works with any browser, no dependencies.
<10KB PagesWorks on 2G networks, mesh relays, and satellite connections.
Sub-100ms ResponseLive API data cached intelligently with traffic-aware expiration.
6 Real-Time SourcesFEMA, NWS Weather, NWS Alerts, USGS Earthquakes, Open-Meteo AQI, Environment Canada.
BilingualFrench/English for Quebec. Full support for Canadian emergency services.
Single C File~2800 lines. No frameworks. Dependencies: curl, jansson only.
Visual Severity🔴 Extreme | 🟠 Severe | 🟡 Moderate - Instant threat assessment.

Performance Monitoring

Metrics Trackedapi_time, render_time, total_time, cache_hits, api_calls
Thread-LocalPer-request performance tracking without locking overhead
Footer DisplayEvery page shows: total_ms (api:Xms cache:N)
Cache Strategy30min normal, 5min high-traffic (10+ visits/30min)
Target Latency<1ms static, <100ms with API fetch

Data Sources (All Free, No Auth)

APIDataRefresh
FEMA v2Disaster declarations, recovery centers30 min
NWSWeather conditions (api.weather.gov/points)30 min (5 min high traffic)
NWSSevere weather alerts (api.weather.gov/alerts)30 min (5 min high traffic)
USGSEarthquakes M2.5+ within 500km30 min
Open-MeteoAir Quality Index (US EPA), Canada weather30 min
Environment CanadaCanadian weather alerts (dd.weather.gc.ca)30 min

Design Philosophy

Coverage

Active Emergencies

30+ emergency types with cached precautions:

🌀 Hurricane🌪 Tornado⛈ Thunderstorm🌊 Flood/Tsunami
❄ Winter Storm🧊 Ice Storm🔥 Fire/Wildfire🌋 Earthquake
🥶 Extreme Cold☀ Heat/Drought💨 High Wind☣ Chemical/Bio

CLI Commands

./safenow 8080           # Start server
./safenow cache-status   # Cache statistics
./safenow cache-clear    # Clear cache
./safenow check          # Requirements check
./safenow test           # Smoke tests

Build It Yourself

sudo apt install libcurl4-openssl-dev libjansson-dev
gcc -O3 -o safenow src/server.c -lpthread -lcurl -ljansson -lm
./safenow 8080

Source on GitHub