You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C — Raw ICMP echo requires a raw socket (CAP_NET_RAW). C gives direct access with zero overhead, precise CLOCK_MONOTONIC_RAW timing (immune to NTP slew), and a non-blocking TCP RTT probe using select() that is more accurate than the OS-level async primitives Python and Rust use.
Rust — All network measurement hot paths. Concurrent async probes via Tokio (50 TCP connections at once for packet loss), memory-safe FFI to the C library, zero-cost abstractions, and the binary is stripped/LTO-optimised to ~4 MB. The entire Rust crate compiles with no unsafe code outside the single ffi.rs module.
Go — The LRU cache and SSE hub need to be shared across both uvicorn worker processes. Go goroutines are cheap enough to handle a long-lived SSE stream per worker. The standard library container/list-based LRU, zero external dependencies, and a Prometheus text-format /metrics endpoint that needs no third-party packages.
Python — Business logic, ORM queries, ML (scikit-learn), LLM calls, and the FastAPI REST API stay in Python for developer velocity. Python delegates every hot network path to Rust and every cache/event operation to Go.
Data Flow
Speed Test + WebSocket Broadcast (v4.0)
User clicks "Run Speed Test"
│
├─ Frontend POST /api/test-now { X-Client-ID: <uuid> }
│
├─ Python: SpeedTestService.run()
│ ├─ speedtest-cli → download / upload / ping / ISP
│ ├─ Geo lookup (ip-api.com) → city, country, lat/lng
│ ├─ SpeedMeasurement saved to Turso DB
│ └─ OutageEvent created if download < 1 Mbps
│
├─ Python: broadcast_measurement()
│ ├─ POST http://127.0.0.1:8002/events/push → Go agent hub
│ │ └─ Go broadcasts to all SSE subscribers
│ │ └─ Each Python WS handler gets the event
│ │ └─ Forwarded to the browser client
│ └─ Also direct-push to WS clients in this worker process
│
├─ Smart alert evaluation → Telegram / Discord / SMS / Webhooks
│
└─ Response: { download_speed, upload_speed, ping, isp, location, ... }
Network Diagnostics Flow (Rust + C)
GET /api/diagnostics/packet-loss?host=1.1.1.1&count=20
│
├─ Python: AdvancedDiagnostics.measure_packet_loss()
│ └─ POST http://127.0.0.1:8001/packet-loss { host, count }
│
└─ Rust probe (ist-probe):
├─ C: ist_icmp_ping() → real ICMP (if CAP_NET_RAW available)
│ └─ Falls back to ist_tcp_rtt_us() (non-blocking select loop)
├─ 20 probes sent concurrently (Tokio join_all)
├─ Computes: loss %, avg / min / max / p95 latency
└─ Returns JSON { method: "tcp_connect_concurrent", ... }
Cache Flow (Go LRU)
Python: await cache_service.get("isp:reliability:7d")
│
├─ Tier 1: GET http://127.0.0.1:8002/cache/isp:reliability:7d
│ ├─ Hit → return cached JSON (0.5 ms)
│ └─ Miss → fall through
├─ Tier 2: Redis (if configured)
└─ Tier 3: in-memory TTL dict (always available)
Python: await cache_service.set("isp:reliability:7d", result, ttl=300)
└─ Write-through to all three tiers simultaneously
AI Chatbot Flow
GET /api/insights/query?q=why+is+my+ping+high
│
├─ Build context: last 7 days measurements for this device
│ (avg_download, avg_ping, outage_count, best_hour, ...)
│
├─ Try OpenAI GPT-4o-mini → real LLM answer
├─ Try Groq llama-3.1-8b → fallback LLM
└─ Keyword patterns → always-available offline fallback
Real LLM chatbot — OpenAI → Groq → keyword fallback
GET
/api/insights/root-cause
Root cause analysis
GET
/api/insights/predictive-maintenance
Maintenance predictor
GET
/api/ai-insights
Statistical patterns, congestion, trends
Internet Crisis Monitor
Method
Endpoint
Description
GET
/api/internet-crisis
Combined local + global severity + crisis log
GET
/api/internet-crisis/global
7 providers + IODA BGP (cached 5 min)
GET
/api/internet-crisis/local
Local speed vs 7-day baseline
GET
/api/internet-crisis/history
Crisis event history (up to 30 days)
GET
/api/internet-crisis/community-impact
Aggregated ISP breakdown + issue types
New in v4.0
Method
Endpoint
Description
GET
/api/tls-probe?host=
TLS handshake overhead, HTTP/2, HSTS detection
GET
/api/dns-timing?domain=
Parallel DoH resolver race — find the fastest
GET
/api/multi-ping
Ping up to 20 hosts simultaneously
(All v3.x endpoints remain fully compatible.)
Database Schema
speed_measurements — per-device speed test results (X-Client-ID scoped)
outage_events — structured outage log with severity + duration
community_reports — crowd-sourced incident reports with GPS + voting
alert_configs — per-device notification config (Telegram/Discord/SMS)
alert_logs — alert delivery history (channel, status, timestamp)
user_preferences — per-device UI preferences
security_scans — port scan + privacy score results
webhooks — custom webhook registrations (max 5/device)
api_keys — developer API keys (hashed, max 5/device)
speed_challenges — leaderboard entries (best download/upload per device)
user_locations — saved monitoring locations + WiFi presence registry
isp_contracts — per-device ISP plan details for SLA compliance tracking
test_schedules — recurring speed test schedules (hours × days × burst)
packet_loss_readings — TCP packet loss + jitter history per device
device_groups — multi-device group memberships
crisis_logs — detected crisis events: local+global severity, 30-min dedup
Quick Start — Local Dev
# 1. Clone
git clone https://github.com/manziosee/Internet-Stability-Tracker.git
cd Internet-Stability-Tracker
# 2. Backend (Python only — Rust/Go sidecars are optional locally)cd backend
cp .env.example .env # fill in TURSO_DB_URL, TURSO_AUTH_TOKEN, SECRET_KEY
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
# 3. (Optional) Run Rust probe locallycd backend/rust-probe
cargo run --release # starts on port 8001# 4. (Optional) Run Go agent locallycd backend/go-agent
go run .# starts on port 8002# 5. Frontend (separate terminal)cd frontend
cp .env.example .env.local # set REACT_APP_API_URL=http://localhost:8000/api
npm install && npm start
Python falls back gracefully when the sidecars are not running — all endpoints work, the Rust probe just uses Python TCP fallbacks and the cache uses the in-memory tier.
# Load in Chrome
1. Open chrome://extensions/
2. Enable Developer mode
3. Click "Load unpacked"
4. Select the browser-extension/ folder
# Load in Firefox
1. Go to about:debugging#/runtime/this-firefox
2. "Load Temporary Add-on"
3. Select browser-extension/manifest.json
The extension shares the same ist_client_id UUID as the web app — test history is unified.
Postman Collection
Import postman_collection.json — 110+ pre-configured requests across 23 folders.
Set base_url to http://localhost:8000/api for local dev or leave it pointing at the live API. Set client_id to your browser's ist_client_id from localStorage to test device-scoped endpoints.
Built with Python · Rust · Go · C · React · scikit-learn · Turso · Fly.io · Vercel
About
Internet Stability Tracker is a real-time network monitoring system that automatically measures internet speed, detects outages, and visualizes network performance across different locations and ISPs. Built for communities to gain transparency into their local network infrastructure.