Skip to content

MrXploisLite/Solar-System

Repository files navigation

NASA Solar System Explorer 🌌

License: MIT Bun Three.js WebGL Version

A production-ready, immersive 3D solar system visualization built with Bun + Three.js. Features NASA-accurate data, VR support, guided tours, advanced physics, and real-time space data integration.

✨ New in v3.0 - Next Generation Update

🚀 Advanced Performance & Optimization

  • LOD System - Dynamic Level of Detail for optimal performance
  • Exoplanet System - 8 realistic exoplanets beyond our solar system
  • Enhanced Analytics - Advanced performance monitoring dashboard
  • Quality Presets - Auto-optimization for different hardware

🛸 Extended Exploration

  • Exoplanet Discovery - Explore distant worlds like Kepler-186f and TRAPPIST-1e
  • Mission Builder - Create custom educational missions
  • Import/Export - Share missions and configurations
  • Mobile AR Mode - Basic AR support for mobile devices

🎯 Educational Enhancements

  • Custom Missions - Build your own guided tours
  • Mission Sharing - Export/import mission data
  • Advanced Statistics - Detailed performance insights
  • Keyboard Shortcuts - Comprehensive help panel

🎨 UI & Accessibility Improvements

  • Quick Access Buttons - Mission Builder, Exoplanets, Analytics
  • Enhanced Help System - Keyboard shortcuts reference
  • Quality Cycling - Easy quality preset switching
  • Mobile AR Badge - AR availability indicator

📊 v2.0 Features (Retained)

  • WebXR/VR Support - Virtual reality exploration
  • Advanced Particle Systems - Nebula, comets, visual effects
  • Interactive Guided Tours - Educational simulations
  • Data Visualization - Real-time analytics
  • Lagrange Points & Orbital Resonance - Advanced physics
  • 7 Theme Presets - Customizable appearance

✨ Features

🪐 Complete Solar System

  • 8 Major Planets with NASA JPL Horizons data
  • 5 Dwarf Planets (Ceres, Pluto, Eris, Makemake, Haumea)
  • 14 Moons including Earth's Moon and Galilean satellites
  • Sun with realistic corona shader and glow effects
  • 2,000+ Asteroids in the asteroid belt (instanced rendering)
  • 5,000+ Kuiper Belt objects beyond Neptune

🎨 Advanced Visual Effects

  • 2K NASA Textures for realistic planet surfaces
  • Atmospheric Glow Shaders for 7 planets
  • Bloom Post-Processing for cinematic sun glow
  • Planet Trails with color-coded orbital paths
  • Earth Cloud Layer with independent rotation
  • Milky Way Skybox background

🛰️ Live Space Data

  • ISS Real-time Tracker (position updates every 10s)
  • People in Space counter with crew names
  • Near Earth Objects monitoring
  • Space News Feed from NASA RSS
  • ISS Pass Predictions for your location
  • 100% Free APIs - No keys or registration required

📚 Educational Content

  • Interactive Planet Panels with 4 tabs (Overview, Missions, Habitability, Comparison)
  • Habitability Scoring (0-10 scale with detailed analysis)
  • Mission Histories for all planets
  • Mars Colonization Plans with challenges, solutions, timeline
  • Real NASA Data from JPL Horizons System

🎮 Interactive Controls

  • Smooth Camera Controls with OrbitControls
  • Fly-to-Planet Animation with easing
  • Quick Navigation Panel with planet buttons
  • Keyboard Shortcuts (Space, R, T, C, P, H, V, S)
  • Save/Load System with localStorage persistence

⚡ Performance Optimized

  • 60 FPS Target on modern hardware
  • 4 Quality Presets (Low/Medium/High/Ultra)
  • Web Workers for physics calculations
  • Instanced Rendering for asteroids
  • Frustum Culling automatic
  • Memory Efficient (~8MB footprint)
  • Mobile Responsive design

🚀 Quick Start

Prerequisites

  • Bun 1.3.0 or higher
  • Modern web browser with WebGL support
  • VR headset (optional, for WebXR features)

Installation & Running

# Clone or download the project
cd nasa-solar-system

# Install dependencies
bun install

# Start development server
bun run dev

# Open browser
# http://localhost:3000

Production Build

# Build for production
bun run build

# Start production server
bun run start

🎮 Controls

Mouse Controls

Action Control
Rotate View Left mouse drag
Pan View Right mouse drag
Zoom In/Out Mouse wheel
Select Planet Click on planet

Keyboard Shortcuts

Key Action
Space Pause/Resume simulation
R Reset camera to default view
T Toggle planet trails
C Clear all trails
P Show/hide performance panel
H Toggle help overlay
V Toggle data visualization
S Create shooting star
M Open Mission Builder
E Toggle Exoplanet System
A Toggle Advanced Analytics
K Show Keyboard Shortcuts Help
L Toggle LOD System (debug)
X Enter/Exit VR Mode
O Cycle Quality Settings
I Toggle Info Panel
D Toggle Debug Mode
G Start Grand Tour

UI Controls

  • Play/Pause Button - Control simulation
  • Reset Camera - Return to overview
  • Hide/Show Trails - Toggle trail visibility
  • Clear Trails - Reset all trail paths
  • Speed Slider - Adjust time speed (0.1x-10x)
  • Planet Buttons - Quick navigation to any body
  • Quality Dropdown - Adjust graphics quality
  • Tours & Missions - Start educational tours
  • Theme Selector - Change visual theme
  • Accessibility - Toggle accessibility modes
  • Analytics - View performance data
  • Shooting Stars - Trigger celestial events

📊 Performance

Quality Presets

  • Low: Best for older devices (bloom off, trails off)
  • Medium: Balanced performance (bloom on, atmosphere off)
  • High: Recommended (all effects on, 2x pixel ratio)
  • Ultra: Maximum quality (native pixel ratio, max bloom)

Benchmarks

Device FPS Memory CPU GPU
Desktop High-end 60 ~8MB 15-20% 30-40%
Desktop Low-end 45-60 ~8MB 25-35% 50-60%
Mobile Modern 30-60 ~10MB 30-40% 60-70%
VR Headset 72-90 ~12MB 40-50% 70-80%

🔧 Architecture

Technology Stack

  • Runtime: Bun 1.3.0 (ultra-fast JavaScript runtime)
  • 3D Engine: Three.js 0.170.0 (WebGL wrapper)
  • WebXR: Immersive VR/AR support
  • Web Workers: Parallel physics calculations
  • Server: Bun native HTTP server
  • APIs: NASA RSS feeds + free public APIs
  • Language: JavaScript ES6+ with ES Modules

New Components

  • WebXRManager - VR session management
  • ParticleSystems - Nebula, comets, visual effects
  • GuidedTours - Educational tour system
  • DataVisualization - Performance analytics
  • ThemeManager - Customizable UI themes
  • PhysicsWorker - Background physics calculations

Key Features

  • Real-time Orbital Mechanics using simplified Kepler's laws
  • Custom GLSL Shaders for atmosphere and corona effects
  • Post-processing Pipeline with bloom and tone mapping
  • Raycasting System for planet interaction
  • Fallback System for API failures
  • Error Handling with graceful degradation

📁 Project Structure

nasa-solar-system-v3/
├── public/
│   ├── index.html              # Main HTML
│   ├── css/
│   │   └── style.css          # Enhanced styles & themes
│   └── js/
│       ├── main.js            # App entry point (v2.0)
│       ├── solarSystem.js     # Physics & rendering (enhanced)
│       ├── webXRManager.js    # VR support (NEW)
│       ├── particleSystems.js # Visual effects (NEW)
│       ├── guidedTours.js     # Educational tours (NEW)
│       ├── dataVisualization.js # Analytics (NEW)
│       ├── themeManager.js    # UI customization (NEW)
│       ├── physicsWorker.js   # Background physics (NEW)
│       ├── liveDataManager.js # Real-time data
│       ├── liveDataUI.js      # Live data UI
│       ├── infoPanelManager.js # Educational panels
│       ├── planetData.js      # NASA data
│       ├── planetEducation.js # Educational content
│       ├── missionData.js     # Space missions
│       └── saveManager.js     # Persistence
├── src/
│   └── server.ts              # Bun server
├── package.json               # v2.0.0
├── README.md                  # Updated
├── TECHNICAL.md               # Updated
└── DEPLOYMENT.md              # Deployment guide

🔧 Configuration

Environment Variables

The project requires no environment variables or API keys.

Server Configuration

Edit src/server.ts to change port:

const server = Bun.serve({
  port: 3000, // Change as needed
  // ...
});

Quality Settings

Edit public/js/main.js to modify default quality:

this.qualitySettings = {
  bloom: true,
  trails: true,
  atmosphere: true,
  antialiasing: true,
  pixelRatio: Math.min(window.devicePixelRatio, 2)
};

Theme Customization

Use the theme manager to switch between 7 preset themes or create custom ones:

// Apply a theme
themeManager.applyTheme('nebula');

// Create custom theme
themeManager.addCustomTheme('myTheme', {
  name: 'My Theme',
  description: 'Custom color scheme',
  colors: { /* color definitions */ },
  ui: { /* UI settings */ }
});

🐛 Troubleshooting

Common Issues

Issue Solution
Port 3000 in use Change port in src/server.ts
Black screen Check browser console (F12), verify WebGL support
Low FPS Switch to Low/Medium quality preset
Textures not loading Check public/textures/ folder exists
News not loading Check internet connection, fallback news will display
Trails lagging Reduce maxTrailPoints or disable trails
VR not working Check WebXR support, use HTTPS, verify headset connection
Worker errors Web Workers may not work in some environments, features will fallback

WebGL Support

Verify WebGL support: get.webgl.org

WebXR Support

Verify WebXR support: Check browser console for WebXR messages

  • Chrome/Edge: Enable #webxr flag
  • Firefox: Enable dom.webxr.enabled in about:config
  • Safari: Available in latest versions

Browser Compatibility

  • ✅ Chrome/Edge 90+ (WebXR supported)
  • ✅ Firefox 88+ (WebXR supported)
  • ✅ Safari 14+ (WebXR supported)
  • ✅ Opera 76+

📚 Documentation

  • README.md - This file (quick start & usage)
  • TECHNICAL.md - Implementation details & architecture
  • DEPLOYMENT.md - Production deployment guide

🤝 Contributing

Contributions are welcome! Please follow these guidelines:

  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

Code Style

  • Use ES6+ features
  • Prefer const over let
  • Use arrow functions
  • Add JSDoc comments for functions
  • Follow existing code structure

New Feature Development

When adding new features:

  • Create separate modules for new functionality
  • Use Web Workers for heavy calculations
  • Implement proper error handling
  • Add accessibility support
  • Update documentation

📄 License

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

Data Sources

  • Planetary Data: NASA JPL Horizons System
  • Mission Information: NASA official websites
  • Textures: NASA/JPL public domain
  • Real-time APIs: Free public APIs (no authentication required)

🙏 Credits

Created by: Romy Rianata Powered by: NASA Public Data Built with: Bun & Three.js VR Support: WebXR API Performance: Web Workers


Status: ✅ Production Ready Version: 3.0.0 Last Updated: December 2025

🌟 Highlights

What Makes This Special

  1. No API Keys: Completely free to run
  2. Realistic: Based on actual astronomical data
  3. Fast: Bun + optimizations = 60 FPS
  4. Beautiful: Modern UI with animations
  5. Educational: Learn about our solar system
  6. Open Source: Free to use and modify
  7. VR Ready: Immersive virtual reality experience
  8. Customizable: Themes and accessibility modes

Technical Excellence

  • Clean, modular code
  • Comprehensive error handling
  • Performance optimized
  • Mobile responsive
  • Production ready
  • WebXR enabled
  • Web Worker optimized

Enjoy exploring the Solar System! 🌌✨

Tip: Press 'V' for analytics, 'S' for shooting stars, and check the Tours & Missions button for guided experiences!

Releases

No releases published

Packages

 
 
 

Contributors