Explore the cosmos through cutting-edge web technology
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.
- π€ 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
- 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
- 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
- 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
- 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
- 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
β’ 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
β’ 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
β’ GROQ API β’ N2YO Satellite API
β’ NASA APOD API β’ MongoDB Atlas
β’ Socket.io Server β’ JWT Authentication
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
- Node.js 18+ installed
- MongoDB database (local or Atlas)
- GROQ API key
- N2YO API key
git clone https://github.com/dinraj910/Astrosphere.git
cd Astrospherecd server
npm installCreate .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:5173cd ../client
npm installBackend Server:
cd server
npm run devFrontend Development Server:
cd client
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
POST /api/auth/register # User Registration
POST /api/auth/login # User Login
GET /api/auth/profile # Get User Profile
POST /api/chat # AI Chat with GROQ API
GET /api/satellites/iss # ISS Position
GET /api/satellites/positions # Multiple Satellite Positions
GET /api/satellites/predictions # Orbital Predictions
GET /api/apod # NASA Astronomy Picture of the Day
GET /api/cosmic-events # Upcoming Space Events
| 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 |
- Navbar: Responsive navigation with space theme
- Chatbot: Floating AI assistant widget
- CosmicBackground: Animated starfield background
- PlanetsSection: Interactive planet grid
- FeaturedContent: Highlighted space content
- StatCard: Animated planet statistics cards
- TimelineEvent: Historical space events
- SatelliteCard: Real-time satellite information
- APODCard: NASA picture of the day display
- 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
- 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
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
- 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
- Real-time position updates
- Orbital prediction calculations
- Visual tracking maps
- Historical orbit data
- Multiple satellite support
- API rate limiting and caching
# 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:5173The 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'
}
}
});cd client
npm run buildcd server
npm start- Create cluster on MongoDB Atlas
- Update
MONGODB_URIin environment variables - Configure network access and database user
cd client
npm run lint # ESLint check
npm run build # Build verificationcd server
npm test # Run test suite- Code Splitting: Dynamic imports for pages
- Image Optimization: Compressed space imagery
- Lazy Loading: Components load on demand
- Caching: API responses cached locally
- Rate Limiting: API call management
- Caching: Satellite data caching
- Connection Pooling: MongoDB optimization
- Compression: Response compression
We welcome contributions to make Astrosphere even better!
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
- Follow existing code style
- Add tests for new features
- Update documentation
- Ensure responsive design
- Test across different browsers
This project is licensed under the ISC License - see the LICENSE file for details.
- GROQ - AI language model API
- N2YO - Satellite tracking API
- NASA APOD - Astronomy Picture of the Day
- NASA - Space imagery and data
- React - Frontend framework
- Material-UI - UI component library
- Framer Motion - Animation library
- Three.js - 3D graphics library
- MongoDB - Database
- Express.js - Backend framework
- Wiki: Detailed documentation and guides
- API Docs: Complete API reference
- Contributing: Development guidelines
Where technology meets the cosmos
π Live Demo | π Documentation | π Report Bug
Made with β€οΈ for space enthusiasts everywhere
β Star this repo if you found it helpful! β