☄️ Asteroid Watch — Near-Earth Object Early Warning System
A real-time asteroid monitoring dashboard that pulls live data from NASA, detects close approaches, and sends AI-powered alerts when space rocks get too close for comfort.
What & Why
The Problem
NASA tracks over 61,000 near-Earth asteroids, with new close approaches predicted daily. The raw data is scattered across multiple NASA APIs, returned as deeply nested JSON, and lacks any alerting mechanism. If something noteworthy is heading our way, you need to check manually.
The Solution
An end-to-end early warning system that:
- Pulls asteroid data daily from 3 NASA APIs and enriches it into a clean, queryable dataset
- Detects threats automatically using configurable distance thresholds with deduplicated alerting
- Delivers AI-powered briefings — a GPT-5.5-generated 7-Day Outlook and per-asteroid threat analysis
- Presents everything in a custom React dashboard with interactive scatter plots and historical data
The Impact
- Zero manual monitoring — the system checks NASA every morning and emails you only when noteworthy
- Sub-second insights — from raw API data to interactive dashboard with AI analysis
- 300 years of history on-demand — click any asteroid to see every past and future Earth pass from 1900-2200
How It Works
User Workflow - Daily Flow
7:00 AM → System pulls next 7 days of asteroid data from NASA → Enriches with orbital parameters + discovery info → Checks for close approaches (< threshold) → If new threat found → AI writes a briefing → Email sent
Dashboard Experience
7-Day Outlook (top)
AI-generated summary of the weeks incoming asteroids with color-coded keywords

Threat Assessment Scatter Plot
Every asteroid plotted by size vs. distance. Bigger and closer = scarier. Click any dot to highlight it in the table below and open its detail panel.

Asteroid Table
All incoming asteroids sorted by date. Click any row to open detail panel and the row flashes cyan.

Detail Panel
Full asteroid profile: AI threat analysis, orbital data, observation history, NASA JPL link.

Close Approach History
On-demand chart showing every Earth pass from 1900-2200, fetched live from NASA JPL API. No data stored — always fresh.

Email Alerts
AI-written notifications with human-scale comparisons, linking directly to the dashboard, the alerted object in Foundry, and its NASA JPL page.

Under the Hood
Architecture Diagram
Daily Schedule
7:00 AM → System pulls next 7 days of asteroid data from NASA → Enriches with orbital parameters + discovery info → Checks for close approaches (< threshold) → If new threat found → AI writes a briefing → Email sent
Technology Stack
| Layer | Technology | Purpose |
|---|---|---|
| Data Ingestion | Python (Polars), Lightweight Transforms | Pull & flatten NASA API data |
| External APIs | Data Connection Sources, Egress Policies | Secure outbound network access |
| Storage | Foundry Datasets | Structured tabular storage with full lineage |
| Alerting Pipeline | Incremental Transforms | Deduplicated append-only alert tracking |
| Semantic Layer | Foundry Ontology | Object types with conditional formatting |
| Automation | Foundry Automate (Object Sentinel) | Trigger-based email notifications |
| Backend Functions | TypeScript v2, OSDK Functions | Server-side API calls, AI generation |
| AI/LLM | GPT-5.5 via Foundry LLM Proxy | Threat summaries, weekly digest, smart alerts |
| Frontend | React, TypeScript, Recharts, CSS Modules | Interactive dashboard with dark space theme |
| Client SDK | OSDK (@osdk/react) | Type-safe Ontology access from React |
| Scheduling | Foundry Schedules (cron) | Daily automated data refresh |
Key Technical Decisions
1. On-demand history vs. stored history
Rather than storing every asteroids full close approach history (which would grow endlessly), the app fetches it live from NASAs CAD API when you click an asteroid. Zero storage cost, always current data.
2. Incremental deduplication with expiry
The main dataset rebuilds daily (SNAPSHOT), but the alerts dataset is incremental (append-only). Alerts are deduplicated within an 8-day window — the same asteroid wont trigger repeated notifications during a single approach, but can re-trigger if it returns months later.
3. Server-side Functions as API proxy
The React app runs in a Foundry dev environment with restrictive Content Security Policy, blocking direct external API calls. A TypeScript Function handles the NASA API calls server-side, returning structured data through OSDK — no CSP issues.