Skip to content

dinraj910/Astrosphere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌌 Astrosphere

React Node.js MongoDB Material-UI Express.js Socket.io

πŸš€ A Hyper-Modern Space Encyclopedia with Interactive UI, Real-Time Data & AI Assistant

Explore the cosmos through cutting-edge web technology


🌟 Overview

Astrosphere is a comprehensive, next-generation space exploration platform that combines stunning visuals, real-time space data, and AI-powered assistance to create an immersive astronomical learning experience. Built with the MERN stack and enhanced with modern UI frameworks, it offers users an interactive journey through our solar system and beyond.

✨ Key Highlights

  • πŸ€– AI-Powered Astronomy Assistant - GROQ API integration with specialized space knowledge
  • πŸ›°οΈ Real-Time Satellite Tracking - Live ISS tracking with N2YO API integration
  • πŸͺ Complete Planetary Database - Comprehensive information on all 8 planets + Sun
  • 🌠 Interactive Animations - Framer Motion powered smooth transitions
  • πŸ“± Fully Responsive Design - Optimized for all screen sizes
  • 🎨 Space-Themed UI - Dark, cosmic design with gradient animations

🎯 Features

πŸ€– AI Chatbot System

  • GROQ API Integration: Advanced AI assistant specialized in astronomy
  • Dual Interface: Floating chat widget + dedicated chat page
  • Smart Responses: Context-aware answers to space-related questions
  • Error Handling: Comprehensive fallback systems

πŸͺ Planet Education System

  • Complete Database: All 9 celestial objects (8 planets + Sun)
  • Rich Content: Formation history, physical properties, missions, galleries
  • Interactive Tabs: 6 detailed sections per celestial body
    • Overview & Quick Stats
    • Formation & History Timeline
    • Physical Characteristics
    • Space Exploration Missions
    • Image Galleries
    • Fun Facts
  • Responsive Cards: Beautiful stat cards with animated icons

πŸ›°οΈ Real-Time Space Data

  • Satellite Tracking: Live tracking of ISS and other important satellites
  • Orbital Predictions: Advanced orbital mechanics calculations
  • N2YO API Integration: Real-time satellite position data
  • Socket.io: Live updates for connected clients

🌌 Interactive Experiences

  • Universe Story: Interactive timeline of cosmic evolution
  • Universe Explorer: Comprehensive celestial object catalog
  • Cosmic Events: Space news and upcoming events
  • Gallery: Curated space imagery and visualizations
  • APOD Integration: NASA's Astronomy Picture of the Day

🎨 Modern UI/UX

  • Material-UI Framework: Professional component library
  • Framer Motion: Smooth animations and transitions
  • Dark Space Theme: Immersive cosmic color scheme
  • Gradient Effects: Beautiful space-themed gradients
  • Responsive Grid: Mobile-first design approach

πŸ› οΈ Tech Stack

Frontend

β€’ React 19.1.0          β€’ Material-UI 7.2.0
β€’ Framer Motion 12.23.6 β€’ React Router DOM 7.7.0
β€’ Axios 1.10.0          β€’ Socket.io Client 4.8.1
β€’ Three.js 0.178.0      β€’ React Three Fiber 9.2.0
β€’ Leaflet 1.9.4         β€’ React Leaflet 5.0.0
β€’ Vite 7.0.4            β€’ ESLint 9.30.1

Backend

β€’ Node.js 18+           β€’ Express.js 4.21.2
β€’ MongoDB 5.0+          β€’ Mongoose 8.16.4
β€’ Socket.io 4.8.1       β€’ JWT 9.0.2
β€’ bcryptjs 3.0.2        β€’ CORS 2.8.5
β€’ dotenv 17.2.0         β€’ node-cron 4.2.1
β€’ Axios 1.11.0          β€’ Nodemon 3.1.10

APIs & Services

β€’ GROQ API              β€’ N2YO Satellite API
β€’ NASA APOD API         β€’ MongoDB Atlas
β€’ Socket.io Server      β€’ JWT Authentication

πŸ“ Project Structure

Astrosphere/
β”œβ”€β”€ client/                     # React Frontend
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   └── vite.svg
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable Components
β”‚   β”‚   β”‚   β”œβ”€β”€ CosmicBackground.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ FeaturedContent.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Chatbot.jsx
β”‚   β”‚   β”‚   └── PlanetsSection.jsx
β”‚   β”‚   β”œβ”€β”€ context/           # React Context
β”‚   β”‚   β”‚   └── AuthContext.jsx
β”‚   β”‚   β”œβ”€β”€ pages/             # Page Components
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PlanetDetails.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatbotPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SatelliteTracker.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ UniverseStory.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ UniverseExplorer.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Gallery.jsx
β”‚   β”‚   β”‚   └── CosmicEvents.jsx
β”‚   β”‚   β”œβ”€β”€ styles/            # Theme Configuration
β”‚   β”‚   β”‚   └── theme.js
β”‚   β”‚   β”œβ”€β”€ App.jsx           # Main App Component
β”‚   β”‚   └── main.jsx          # Entry Point
β”‚   β”œβ”€β”€ package.json          # Frontend Dependencies
β”‚   β”œβ”€β”€ vite.config.js        # Vite Configuration
β”‚   └── eslint.config.js      # ESLint Configuration
β”œβ”€β”€ server/                    # Express Backend
β”‚   β”œβ”€β”€ config/               # Database Configuration
β”‚   β”‚   └── db.js
β”‚   β”œβ”€β”€ controllers/          # Route Controllers
β”‚   β”‚   └── authController.js
β”‚   β”œβ”€β”€ models/               # MongoDB Models
β”‚   β”‚   └── User.js
β”‚   β”œβ”€β”€ routes/               # API Routes
β”‚   β”‚   └── authRoutes.js
β”‚   β”œβ”€β”€ index.js             # Server Entry Point
β”‚   β”œβ”€β”€ package.json         # Backend Dependencies
β”‚   └── .env                 # Environment Variables
β”œβ”€β”€ package.json             # Root Package Configuration
└── README.md               # Project Documentation

πŸš€ Installation & Setup

Prerequisites

  • Node.js 18+ installed
  • MongoDB database (local or Atlas)
  • GROQ API key
  • N2YO API key

1. Clone Repository

git clone https://github.com/dinraj910/Astrosphere.git
cd Astrosphere

2. Backend Setup

cd server
npm install

Create .env file in server directory:

PORT=5000
MONGODB_URI=mongodb://localhost:27017/astrosphere
JWT_SECRET=your_jwt_secret_here
GROQ_API_KEY=your_groq_api_key_here
N2YO_API_KEY=your_n2yo_api_key_here
CORS_ORIGIN=http://localhost:5173

3. Frontend Setup

cd ../client
npm install

4. Start Development

Backend Server:

cd server
npm run dev

Frontend Development Server:

cd client
npm run dev

5. Access Application


🌐 API Endpoints

Authentication

POST /api/auth/register    # User Registration
POST /api/auth/login       # User Login
GET  /api/auth/profile     # Get User Profile

Chatbot

POST /api/chat            # AI Chat with GROQ API

Satellite Tracking

GET  /api/satellites/iss           # ISS Position
GET  /api/satellites/positions     # Multiple Satellite Positions
GET  /api/satellites/predictions   # Orbital Predictions

Space Data

GET  /api/apod            # NASA Astronomy Picture of the Day
GET  /api/cosmic-events   # Upcoming Space Events

πŸ“± Pages & Routes

Route Component Description
/ Home Landing page with APOD and planet navigation
/login Login User authentication
/register Register User registration
/planets/:planetName PlanetDetails Comprehensive planet information
/chatbot ChatbotPage Full-screen AI chat interface
/satellites SatelliteTracker Real-time satellite tracking
/universe-story UniverseStory Interactive cosmic timeline
/universe-explorer UniverseExplorer Celestial object catalog
/gallery Gallery Space imagery collection
/events CosmicEvents Space news and events

🎨 UI Components

Core Components

  • Navbar: Responsive navigation with space theme
  • Chatbot: Floating AI assistant widget
  • CosmicBackground: Animated starfield background
  • PlanetsSection: Interactive planet grid
  • FeaturedContent: Highlighted space content

Page-Specific Components

  • StatCard: Animated planet statistics cards
  • TimelineEvent: Historical space events
  • SatelliteCard: Real-time satellite information
  • APODCard: NASA picture of the day display

πŸ›°οΈ Real-Time Features

Satellite Tracking System

  • Live ISS Tracking: Real-time International Space Station position
  • Multiple Satellites: Track Hubble, GPS, and scientific satellites
  • Orbital Predictions: Advanced orbital mechanics calculations
  • Socket.io Integration: Live updates for connected clients

AI Chatbot System

  • GROQ API: Advanced language model for astronomy questions
  • Context Awareness: Maintains conversation context
  • Error Handling: Graceful fallbacks for API issues
  • Response Streaming: Real-time message delivery

🎯 Key Features Deep Dive

πŸͺ Planet Details System

Each planet page includes:

  • Overview Tab: Basic statistics with animated icons
  • Formation & History: Timeline of discovery and exploration
  • Physical Properties: Detailed characteristics list
  • Space Missions: Comprehensive mission history
  • Image Gallery: High-quality space imagery
  • Fun Facts: Engaging trivia and comparisons

πŸ€– AI Assistant Capabilities

  • Answers astronomy and space exploration questions
  • Provides information about planets, stars, and galaxies
  • Explains space missions and discoveries
  • Discusses cosmic phenomena and events
  • Maintains conversation context
  • Filters non-space related queries

πŸ›°οΈ Satellite Tracking Features

  • Real-time position updates
  • Orbital prediction calculations
  • Visual tracking maps
  • Historical orbit data
  • Multiple satellite support
  • API rate limiting and caching

πŸ”§ Configuration

Environment Variables

# Server Configuration
PORT=5000
NODE_ENV=development

# Database
MONGODB_URI=mongodb://localhost:27017/astrosphere

# Authentication
JWT_SECRET=your_super_secret_jwt_key

# External APIs
GROQ_API_KEY=your_groq_api_key
N2YO_API_KEY=your_n2yo_api_key

# CORS
CORS_ORIGIN=http://localhost:5173

Theme Customization

The space theme can be customized in client/src/styles/theme.js:

const theme = createTheme({
  palette: {
    mode: 'dark',
    primary: { main: '#4c63d2' },
    secondary: { main: '#7c3aed' },
    background: {
      default: '#0f172a',
      paper: '#1e293b'
    }
  }
});

πŸš€ Deployment

Frontend (Vercel/Netlify)

cd client
npm run build

Backend (Railway/Heroku)

cd server
npm start

Database (MongoDB Atlas)

  • Create cluster on MongoDB Atlas
  • Update MONGODB_URI in environment variables
  • Configure network access and database user

πŸ§ͺ Testing

Frontend Testing

cd client
npm run lint          # ESLint check
npm run build         # Build verification

Backend Testing

cd server
npm test              # Run test suite

πŸ“ˆ Performance Optimizations

Frontend Optimizations

  • Code Splitting: Dynamic imports for pages
  • Image Optimization: Compressed space imagery
  • Lazy Loading: Components load on demand
  • Caching: API responses cached locally

Backend Optimizations

  • Rate Limiting: API call management
  • Caching: Satellite data caching
  • Connection Pooling: MongoDB optimization
  • Compression: Response compression

🀝 Contributing

We welcome contributions to make Astrosphere even better!

Development Setup

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

Contribution Guidelines

  • Follow existing code style
  • Add tests for new features
  • Update documentation
  • Ensure responsive design
  • Test across different browsers

πŸ“„ License

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


πŸ™ Acknowledgments

APIs & Services

  • GROQ - AI language model API
  • N2YO - Satellite tracking API
  • NASA APOD - Astronomy Picture of the Day
  • NASA - Space imagery and data

Technologies


πŸ“ž Support & Contact

Repository

Documentation

  • Wiki: Detailed documentation and guides
  • API Docs: Complete API reference
  • Contributing: Development guidelines

🌌 Explore the Universe with Astrosphere πŸš€

Where technology meets the cosmos

πŸš€ Live Demo | πŸ“– Documentation | πŸ› Report Bug


Made with ❀️ for space enthusiasts everywhere

⭐ Star this repo if you found it helpful! ⭐

About

A hyper-modern space encyclopedia with interactive UI, high-quality images, and real-time space data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors