← Back to Portfolio

☄️ 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

7-Day Outlook banner

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.

Scatter plot

Asteroid Table

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

Asteroid table with badges

Detail Panel

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

Detail panel with AI analysis

Close Approach History

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

Close approach history chart

Email Alerts

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

Email notification

Under the Hood

Architecture Diagram

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

LayerTechnologyPurpose
Data IngestionPython (Polars), Lightweight TransformsPull & flatten NASA API data
External APIsData Connection Sources, Egress PoliciesSecure outbound network access
StorageFoundry DatasetsStructured tabular storage with full lineage
Alerting PipelineIncremental TransformsDeduplicated append-only alert tracking
Semantic LayerFoundry OntologyObject types with conditional formatting
AutomationFoundry Automate (Object Sentinel)Trigger-based email notifications
Backend FunctionsTypeScript v2, OSDK FunctionsServer-side API calls, AI generation
AI/LLMGPT-5.5 via Foundry LLM ProxyThreat summaries, weekly digest, smart alerts
FrontendReact, TypeScript, Recharts, CSS ModulesInteractive dashboard with dark space theme
Client SDKOSDK (@osdk/react)Type-safe Ontology access from React
SchedulingFoundry 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.