Skip to content

Aegis is an open-source JavaScript and Python project for building secure, extensible web and automation tools with modular frontend and backend components.

License

Notifications You must be signed in to change notification settings

NexionisJake/Aegis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

31 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ AEGIS - Asteroid Impact Simulator

Advanced Earth Guard and Impact Simulation System

A cutting-edge web application for visualizing near-Earth asteroids and simulating impact scenarios with AI-powered analysis.

Live Demo License NASA API Powered by Gemini

๐ŸŒ Live Application

๐Ÿš€ Launch AEGIS

Experience real-time asteroid impact simulation with:

  • ๐Ÿ“ก Live NASA asteroid data
  • ๐ŸŒ Interactive 3D Earth visualization
  • ๐Ÿ’ฅ Scientific impact calculations
  • ๐Ÿค– AI-powered impact analysis
  • ๐Ÿ—บ๏ธ Detailed impact zone mapping

โœจ Key Features

๐ŸŽฏ Real-Time Asteroid Database

  • 20+ NASA-verified asteroids with live orbital data
  • Real-time threat level classification (High/Medium/Low)
  • Comprehensive physical parameters (diameter, mass, velocity, orbit period)
  • Direct links to NASA JPL Small-Body Database

๐ŸŒ Interactive 3D Earth Visualization

  • Photorealistic Earth with NASA Blue Marble textures
  • Day/night lighting with city illumination
  • Atmospheric glow effects
  • Smooth orbital controls (drag to rotate, scroll to zoom)
  • Auto-rotation with manual override

๐Ÿ’ฅ Scientific Impact Simulation

  • Click anywhere on Earth to select impact location
  • Precise crater diameter calculations
  • Impact energy analysis (megaton TNT equivalent)
  • Blast radius visualization
  • Affected area calculations (kmยฒ)
  • Impact velocity and trajectory modeling

๐Ÿค– AI-Powered Analysis

  • Google Gemini 1.5 Flash integration
  • Detailed impact scenario analysis
  • Environmental effect predictions
  • Population and infrastructure risk assessment
  • Real-time AI-generated insights

๏ฟฝ๏ธ Impact Visualization

  • Interactive impact zone maps (Leaflet/OpenStreetMap)
  • Crater zone highlighting with radius indicators
  • Blast damage zones with color-coded severity
  • Coordinate display and location details
  • Zoom and pan for detailed inspection

๐ŸŽจ Modern AEGIS Theme

  • Cyberpunk-inspired cyan and gold color scheme
  • Glassmorphism UI effects with backdrop blur
  • Smooth animations and transitions
  • Responsive design for all screen sizes
  • Professional SVG icons throughout

๐Ÿ“Š Enhanced Asteroid Sidebar

  • Smart search with real-time filtering
  • Threat level filtering (All/High/Medium/Low)
  • Modern card-based layout
  • Shimmer loading effects
  • Smooth scrolling with custom scrollbar
  • NASA JPL direct links per asteroid

๐ŸŽฎ User Experience

  • Intuitive click-to-select interface
  • Loading states with progress indicators
  • Error handling with graceful fallbacks
  • Deselect functionality for easy reset
  • Educational disclaimers
  • Responsive controls panel

๐ŸŽฌ Screenshots

Main Dashboard

AEGIS Dashboard Interactive 3D Earth with asteroid selection sidebar

Impact Simulation

Impact Results Detailed impact statistics and AI analysis

Impact Zone Visualization

Impact Map Interactive map showing crater and blast zones

๐ŸŽฏ How It Works

  1. Select an Asteroid

    • Browse 20+ NASA-verified near-Earth asteroids
    • Filter by threat level or search by name
    • View detailed orbital and physical parameters
  2. Choose Impact Location

    • Click anywhere on the interactive 3D Earth
    • Precise latitude/longitude selection
    • Visual location indicator appears
  3. Simulate Impact

    • Click "Simulate Impact" button
    • Scientific calculations using real physics
    • Crater size, blast radius, and energy computed
  4. Analyze Results

    • View detailed impact statistics
    • Explore interactive impact zone map
    • Read AI-generated analysis and predictions
    • Understand potential effects and risks
  5. Explore Scenarios

    • Try different asteroids and locations
    • Compare impact effects
    • Learn about planetary defense

๐Ÿš€ Quick Start

Try the Live Demo

Visit aegis-neo.vercel.app to use AEGIS instantly - no installation required!

Local Development

# Start backend
cd backend
python -m venv venv
venv\Scripts\activate  # On Windows
pip install -r requirements.txt
python main.py

# Start frontend (in a new terminal)
cd frontend
npm install
npm run dev

Production Mode with Docker

# Configure environment variables
cp .env.example .env
# Edit .env with your NASA API key

# Start with Docker Compose
docker-compose up -d

Visit http://localhost for the application.

๐Ÿ“š Documentation

Project Structure

Aegis-frontend_change/
โ”œโ”€โ”€ backend/                    # Python FastAPI backend
โ”‚   โ”œโ”€โ”€ main.py                # Main API application
โ”‚   โ”œโ”€โ”€ nasa_client.py         # NASA API integration
โ”‚   โ”œโ”€โ”€ orbital_calculator.py  # Orbital mechanics calculations
โ”‚   โ”œโ”€โ”€ impact_calculator.py   # Impact simulation
โ”‚   โ”œโ”€โ”€ requirements.txt       # Python dependencies
โ”‚   โ”œโ”€โ”€ Dockerfile            # Backend container configuration
โ”‚   โ”œโ”€โ”€ .env.example          # Environment variables template
โ”‚   โ””โ”€โ”€ start-production.bat  # Production startup script
โ”œโ”€โ”€ frontend/                  # React frontend with Vite
โ”‚   โ”œโ”€โ”€ src/                  # React source code
โ”‚   โ”‚   โ”œโ”€โ”€ components/       # React components
โ”‚   โ”‚   โ”œโ”€โ”€ contexts/         # React contexts
โ”‚   โ”‚   โ””โ”€โ”€ utils/           # Utility functions
โ”‚   โ”œโ”€โ”€ package.json         # Node.js dependencies
โ”‚   โ”œโ”€โ”€ vite.config.js       # Vite configuration
โ”‚   โ”œโ”€โ”€ Dockerfile           # Frontend container configuration
โ”‚   โ”œโ”€โ”€ nginx.conf           # Nginx configuration
โ”‚   โ”œโ”€โ”€ vercel.json          # Vercel deployment config
โ”‚   โ””โ”€โ”€ build-and-serve.bat  # Production build script
โ”œโ”€โ”€ docker-compose.yml        # Multi-container orchestration
โ”œโ”€โ”€ .env.example             # Root environment template
โ”œโ”€โ”€ DEPLOYMENT.md            # Deployment documentation
โ””โ”€โ”€ README.md               # This file

Setup Instructions

Prerequisites

  • Backend: Python 3.11+
  • Frontend: Node.js 18+ and npm
  • NASA API Key: Get yours at https://api.nasa.gov/
  • Docker (optional): For containerized deployment

Backend Setup

  1. Navigate to the backend directory
  2. Create and activate virtual environment:
    python -m venv venv
    venv\Scripts\activate  # Windows
    source venv/bin/activate  # Linux/Mac
  3. Install dependencies:
    pip install -r requirements.txt
  4. Configure environment variables:
    cp .env.example .env
    # Edit .env and add your NASA API key
  5. Run the development server:
    python main.py

The backend will be available at: http://localhost:8000

Frontend Setup

  1. Navigate to the frontend directory
  2. Install dependencies:
    npm install
  3. Configure environment variables (optional):
    cp .env.example .env
    # Edit if you need custom API URL
  4. Start the development server:
    npm run dev

The frontend will be available at: http://localhost:5173

Quick Start Scripts

For convenience, use the provided startup scripts:

Windows:

  • start-backend.bat - Starts the backend server
  • start-frontend.bat - Starts the frontend server

Linux/Mac:

  • chmod +x backend/start-production.sh - Make executable
  • ./backend/start-production.sh - Start backend

๐Ÿณ Docker Deployment

Using Docker Compose (Recommended)

  1. Configure environment:

    cp .env.example .env
    # Edit .env with your NASA API key and configuration
  2. Build and start services:

    docker-compose up -d
  3. View logs:

    docker-compose logs -f
  4. Stop services:

    docker-compose down

The application will be available at:

Individual Containers

Backend:

cd backend
docker build -t aegis-backend .
docker run -p 8000:8000 --env-file .env aegis-backend

Frontend:

cd frontend
docker build -t aegis-frontend --build-arg VITE_API_BASE_URL=http://localhost:8000 .
docker run -p 80:80 aegis-frontend

๐ŸŒ Production Deployment

Project Aegis supports two main deployment methods:

๐Ÿณ Docker Deployment (Recommended for Full Stack)

Complete containerized deployment with Docker Compose:

  • โœ… Both frontend and backend together
  • โœ… Production-ready configuration
  • โœ… Works on any platform (local, VPS, cloud)
  • โœ… Easy updates and rollback
docker-compose up -d

See DEPLOYMENT.md for full Docker deployment instructions.

โšก Vercel Deployment (Frontend)

Deploy frontend to Vercel's global CDN:

  • โœ… Automatic HTTPS and CDN
  • โœ… Instant deployments
  • โœ… Preview deployments for PRs
  • โœ… Built-in analytics

Backend deployment options:

  • Railway (Recommended for FastAPI)
  • Render
  • Google Cloud Run
  • Docker on any VPS

See DEPLOYMENT.md for Vercel + backend deployment instructions.

Before deploying, complete the Deployment Checklist

๐Ÿ› ๏ธ Technology Stack

Backend

  • Python 3.11+ - Programming language
  • FastAPI - Modern, high-performance web framework
  • Poliastro - Orbital mechanics calculations
  • Astropy - Astronomical calculations and constants
  • NumPy/SciPy - Scientific computing and numerical analysis
  • Requests - NASA API integration
  • Uvicorn - Lightning-fast ASGI server
  • Pydantic - Data validation and settings management
  • Google Gemini API - AI-powered impact analysis

Frontend

  • React 19 - Modern UI framework with concurrent features
  • Vite - Next-generation frontend tooling
  • Three.js - 3D graphics library
  • @react-three/fiber - React renderer for Three.js
  • @react-three/drei - Useful helpers for React Three Fiber
  • Leaflet - Interactive mapping library
  • react-leaflet - React components for Leaflet
  • Axios - Promise-based HTTP client
  • GSAP - Professional-grade animation library
  • Custom AEGIS Theme - Cyberpunk-inspired UI design

APIs & Data Sources

  • NASA JPL Small-Body Database - Asteroid orbital data
  • NASA NEO Web Service - Near-Earth Object information
  • Google Gemini 1.5 Flash - AI analysis generation
  • OpenStreetMap - Impact zone mapping

DevOps & Deployment

  • Docker - Containerization platform
  • Docker Compose - Multi-container orchestration
  • Nginx - High-performance web server and reverse proxy
  • Vercel - Frontend hosting and CDN
  • Railway - Backend API hosting (recommended)
  • GitHub Actions - CI/CD automation (optional)

๐Ÿ”ง Environment Variables

Backend (.env)

# NASA API Configuration
NASA_API_KEY=your_nasa_api_key_here

# Google Gemini AI Configuration
GEMINI_API_KEY=your_gemini_api_key_here

# Server Configuration
ENVIRONMENT=development
HOST=0.0.0.0
PORT=8000
DEBUG=True

# CORS Configuration
ALLOWED_ORIGINS=http://localhost:5173,https://aegis-neo.vercel.app

# Logging
LOG_LEVEL=INFO

Frontend (.env)

# API Configuration
VITE_API_BASE_URL=http://localhost:8000

# App Configuration
VITE_APP_ENV=development
VITE_APP_NAME="AEGIS - Asteroid Impact Simulator"
VITE_ENABLE_DEBUG_LOGGING=true

Getting API Keys

See .env.example files for full documentation.

๐Ÿ“ก API Endpoints

Core Endpoints

  • GET / - Root endpoint, API information
  • GET /health - Health check with NASA API status

Asteroid Data

  • GET /api/asteroids/list - Get list of Near-Earth Objects
  • GET /api/asteroid/{asteroid_name} - Get specific asteroid data
  • GET /api/trajectory/{asteroid_name} - Calculate orbital trajectory

Impact Simulation

  • POST /api/impact/calculate - Calculate impact effects
  • POST /api/impact/deflection - Simulate deflection scenarios

Documentation

  • GET /docs - Interactive API documentation (Swagger UI)
  • GET /redoc - Alternative API documentation (ReDoc)

๐Ÿงช Testing

Backend Tests

cd backend
pytest
pytest --cov=. --cov-report=html  # With coverage report

Frontend Tests

cd frontend
npm test
npm run test:watch  # Watch mode

๐Ÿ› ๏ธ Development

Code Style

  • Backend: Follow PEP 8, use Black formatter
  • Frontend: ESLint configuration included

Running Linters

# Frontend
cd frontend
npm run lint

# Backend
cd backend
pip install black flake8
black .
flake8 .

๐Ÿ”’ Security

  • โœ… Environment variables for sensitive data
  • โœ… CORS configured for specific origins
  • โœ… Input validation with Pydantic
  • โœ… Security headers in production
  • โœ… HTTPS enforced in production
  • โœ… No secrets in version control

๐Ÿ“Š Performance

Optimizations

  • Code splitting for faster initial load
  • Lazy loading for 3D components
  • API response caching
  • Optimized bundle sizes
  • CDN for static assets (production)
  • Compression (gzip/brotli)

Monitoring

  • Health check endpoints
  • Error tracking (configure Sentry)
  • Performance monitoring
  • API rate limiting

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • NASA JPL - For providing the Near-Earth Object API and Small-Body Database
  • Google Gemini AI - For powering intelligent impact analysis
  • Poliastro - For accurate orbital mechanics calculations
  • Three.js Community - For 3D visualization capabilities
  • React & Vite Teams - For modern web development tools
  • OpenStreetMap - For detailed mapping data
  • Vercel - For seamless frontend hosting and deployment

๐Ÿ“ž Support & Contact

โš ๏ธ Disclaimer

AEGIS is an educational simulation tool designed for learning and awareness about asteroid impacts and planetary defense. All impact calculations are approximations based on simplified physics models. Actual asteroid impact effects would vary significantly based on numerous factors not fully modeled here including:

  • Atmospheric entry dynamics
  • Asteroid composition and structure
  • Local geology and terrain
  • Weather conditions
  • Ocean depth (for water impacts)

This tool should not be used for actual emergency planning or scientific research without proper validation.


๏ฟฝ๏ธ Built with โค๏ธ for planetary defense awareness ๐ŸŒ

Launch AEGIS | Documentation | Report Issue

Protecting Earth, one simulation at a time ๐Ÿš€

โœ… Completed Features

  • Interactive 3D Earth visualization
  • Real-time NASA asteroid data integration
  • Scientific impact calculations
  • AI-powered impact analysis (Gemini)
  • Impact zone mapping with Leaflet
  • Modern AEGIS theme with glassmorphism
  • Responsive design for all devices
  • Enhanced asteroid sidebar with search & filters
  • Production deployment (Vercel + Railway)

๐Ÿšง In Progress

  • Advanced deflection method simulations
  • Historical impact event database
  • Comparison mode for multiple asteroids

๐Ÿ”ฎ Future Plans

  • Real-time asteroid tracking notifications
  • User authentication and saved simulations
  • Database integration for favorites
  • Mobile app (React Native)
  • Advanced atmospheric entry modeling
  • Multi-asteroid collision scenarios
  • Educational mode with guided tours
  • Multi-language support (i18n)
  • API rate limiting dashboard
  • Custom asteroid parameters input

Built with โค๏ธ for planetary defense awareness

About

Aegis is an open-source JavaScript and Python project for building secure, extensible web and automation tools with modular frontend and backend components.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •