Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added backend/__pycache__/debug_log.cpython-314.pyc
Binary file not shown.
Binary file added backend/api/__pycache__/__init__.cpython-314.pyc
Binary file not shown.
Binary file added backend/api/__pycache__/router.cpython-314.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion backend/api/router.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from fastapi import APIRouter
from api.v1.endpoints import auth, satellites, collisions, agents, dashboard, catalog, weather
from api.v1.endpoints import auth, satellites, collisions, agents, dashboard, catalog, weather, events

api_router = APIRouter()

Expand All @@ -10,6 +10,7 @@
api_router.include_router(dashboard.router, prefix="/dashboard", tags=["Dashboard"])
api_router.include_router(catalog.router, prefix="/catalog", tags=["Orbital Catalog"])
api_router.include_router(weather.router, prefix="/weather", tags=["Space Weather"])
api_router.include_router(events.router, prefix="/events", tags=["Mission Events"])


@api_router.get("/health", tags=["Health"])
Expand Down
Binary file added backend/api/v1/__pycache__/__init__.cpython-314.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
157 changes: 157 additions & 0 deletions backend/api/v1/endpoints/events.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
"""
FastAPI Endpoint β€” Mission Control Live Event Stream API
==========================================================
Returns historical and live mission events (conjunctions, launches,
maneuvers, debris fragmentation, space weather alerts, system diagnostics).
"""

from typing import List, Optional
from datetime import datetime, timezone, timedelta
from fastapi import APIRouter, Query, Depends
from sqlalchemy.orm import Session

from database.session import get_db
from models.db_models import OrbitalEvent, CollisionPrediction, SpaceWeather

router = APIRouter()

# Seed mock events generator for instant deployment / fallback
STATIC_EVENTS = [
{
"id": "evt_be_101",
"timestamp": (datetime.now(timezone.utc) - timedelta(minutes=5)).isoformat(),
Comment thread
Pranitrane marked this conversation as resolved.
"category": "CONJUNCTION",
"severity": "CRITICAL",
"title": "CRITICAL CONJUNCTION RISK: ISS (ZARYA) vs DEBRIS 2021-055A",
"description": "Close-approach predicted within key warning sphere. Collision probability exceeds emergency response threshold.",
"satellite_name": "ISS (ZARYA)",
"norad_id": "25544",
"cospar_id": "1998-067A",
"is_high_priority": True,
"acknowledged": False,
"telemetry": {
"miss_distance_m": 142.5,
"collision_probability": 0.0342,
"relative_velocity_kms": 14.2,
"orbit_altitude_km": 418.6
},
"external_references": [
{"label": "Space-Track Conjunction Data", "url": "https://www.space-track.org"},
{"label": "CelesTrak CDM", "url": "https://celestrak.org"}
]
},
{
"id": "evt_be_102",
"timestamp": (datetime.now(timezone.utc) - timedelta(minutes=18)).isoformat(),
"category": "SPACE_WEATHER",
"severity": "HIGH",
"title": "X1.2-CLASS SOLAR FLARE & GEOMAGNETIC STORM WARNING",
"description": "Active region AR3664 produced an X1.2 solar flare with an associated Earth-directed Coronal Mass Ejection (CME).",
"satellite_name": "GLOBAL WEATHER MONITOR",
"norad_id": "43012",
"is_high_priority": True,
"acknowledged": False,
"telemetry": {
"kp_index": 7.3,
"solar_flux_sfu": 245.8
},
"external_references": [
{"label": "NOAA Space Weather Prediction Center", "url": "https://www.swpc.noaa.gov"}
]
},
{
"id": "evt_be_103",
"timestamp": (datetime.now(timezone.utc) - timedelta(minutes=45)).isoformat(),
"category": "MANEUVER",
"severity": "MEDIUM",
"title": "COLLISION AVOIDANCE MANEUVER EXECUTED β€” SENTINEL-6A",
"description": "Thrust duration 14.2s completed successfully. Perigee raised by +420m to clear debris field path.",
"satellite_name": "SENTINEL-6A",
"norad_id": "46984",
"cospar_id": "2020-086A",
"is_high_priority": False,
"acknowledged": True,
"telemetry": {
"delta_v_ms": 0.42,
"fuel_cost_kg": 1.84,
"orbit_altitude_km": 1336.2,
"velocity_kms": 7.21
}
},
{
"id": "evt_be_104",
"timestamp": (datetime.now(timezone.utc) - timedelta(minutes=85)).isoformat(),
"category": "LAUNCH",
"severity": "LOW",
"title": "ORBITAL INSERTION CONFIRMED β€” STARLINK-G8-12 BATCH",
"description": "Falcon 9 second stage deployment nominal. 23 spacecraft inserted into 290 km initial checkout orbit.",
"satellite_name": "STARLINK-G8-12",
"norad_id": "59102",
"cospar_id": "2026-014A",
"is_high_priority": False,
"acknowledged": True,
"telemetry": {
"orbit_altitude_km": 290.4,
"inclination_deg": 53.2,
"velocity_kms": 7.73
}
},
{
"id": "evt_be_105",
"timestamp": (datetime.now(timezone.utc) - timedelta(minutes=130)).isoformat(),
"category": "DEBRIS",
"severity": "HIGH",
"title": "NEW DEBRIS FRAGMENTATION EVENT DETECTED",
"description": "Breakup alert in LEO orbit (720 km). 48 new trackable object vectors registered by Ground Radar Network.",
"satellite_name": "COSMOS-1408 FRAGMENT CLUSTER",
"norad_id": "49812",
"is_high_priority": True,
"acknowledged": False,
"telemetry": {
"fragment_count": 48,
"orbit_altitude_km": 720.5
}
}
]

@router.get("", response_model=dict)
def get_mission_events(
category: Optional[str] = Query(None, description="Category filter (LAUNCH, CONJUNCTION, MANEUVER, DEBRIS, SPACE_WEATHER, SYSTEM)"),
severity: Optional[str] = Query(None, description="Severity filter (LOW, MEDIUM, HIGH, CRITICAL)"),
search: Optional[str] = Query(None, description="Search query across titles and descriptions"),
limit: int = Query(50, ge=1, le=200),
db: Session = Depends(get_db)
):
"""
Retrieve live mission control events stream with multi-field filtering.
"""
results = list(STATIC_EVENTS)
Comment thread
Pranitrane marked this conversation as resolved.

# Category filter
if category and category.upper() != "ALL":
results = [e for e in results if e["category"].upper() == category.upper()]

# Severity filter
if severity and severity.upper() != "ALL":
results = [e for e in results if e["severity"].upper() == severity.upper()]

# Search filter
if search and search.strip():
q = search.strip().lower()
results = [
e for e in results
if q in e["title"].lower() or q in e["description"].lower() or q in (e.get("satellite_name") or "").lower()
]
Comment thread
Pranitrane marked this conversation as resolved.

# Limit
results = results[:limit]

return {
"success": True,
"message": "Mission control events retrieved successfully",
"data": results,
"metadata": {
"total": len(results),
"source": "Kepler Strategic Command Event Engine"
}
Comment thread
Pranitrane marked this conversation as resolved.
}
Binary file added backend/app/__pycache__/__init__.cpython-314.pyc
Binary file not shown.
Binary file added backend/app/__pycache__/main.cpython-314.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added backend/schemas/__pycache__/__init__.cpython-314.pyc
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Debris } from '@/pages/Debris';
import { CollisionCenter } from '@/pages/CollisionCenter';
import { AIAgents } from '@/pages/AIAgents';
import { MissionPlanner } from '@/pages/MissionPlanner';
import EventTimelinePage from '@/pages/EventTimeline';
import { Settings } from '@/pages/Settings';
import { Toaster } from 'sonner';
import { toastOptions } from './constants/toast';
Expand Down Expand Up @@ -89,6 +90,7 @@ function App() {
</Route>
<Route path="/dashboard" element={<MainLayout />}>
<Route index element={<Dashboard />} />
<Route path="timeline" element={<EventTimelinePage />} />
<Route path="space-traffic" element={<SpaceTraffic />} />
<Route path="space-weather" element={<SpaceWeather />} />
<Route path="satellites" element={<Satellites />} />
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/layouts/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const MainLayout: React.FC = () => {

const navItems = [
{ name: 'Dashboard', path: '/dashboard', icon: 'dashboard' },
{ name: 'Event Timeline', path: '/dashboard/timeline', icon: 'timeline' },
{ name: 'Space Traffic', path: '/dashboard/space-traffic', icon: 'language' },
{ name: 'Space Weather', path: '/dashboard/space-weather', icon: 'wb_sunny' },
{ name: 'Satellites', path: '/dashboard/satellites', icon: 'satellite_alt' },
Expand Down
Loading
Loading