A modern full-stack application featuring a 3D solar system visualization with AI-powered chat capabilities, built for aerospace and cosmic exploration enthusiasts.
- 3D Solar System Visualization - Interactive planetary system using Three.js
- AI-Powered Chat - Cosmic and aerospace-focused AI assistant
- User Authentication - Secure JWT-based authentication system
- Real-time Communication - Seamless frontend-backend integration
- Responsive Design - Modern UI with cosmic theming
- Session Management - Persistent chat sessions and user data
- React 18 with modern hooks
- Three.js & React Three Fiber for 3D graphics
- Vite for fast development and building
- CSS3 with modern styling and animations
- Node.js & Express RESTful API
- MongoDB with Mongoose ODM
- JWT Authentication for secure access
- OpenAI Integration (optional) for enhanced AI responses
- Winston Logging for comprehensive monitoring
- Node.js (v18 or higher)
- MongoDB (local or cloud)
- Git
git clone <your-repo-url>
cd <repo-name># Navigate to backend directory
cd backend
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your MongoDB URI and other settings
# Start MongoDB (if running locally)
mongod
# Start the backend server
npm run devThe backend will run on http://localhost:3001
# Open a new terminal and navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start the frontend development server
npm run devThe frontend will run on http://localhost:5173
Open your browser and go to http://localhost:5173
โโโ frontend/ # React frontend application
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โ โโโ ChatPanel.jsx # AI chat interface
โ โ โ โโโ SolarSystem.jsx # 3D solar system
โ โ โ โโโ Planet.jsx # Individual planet component
โ โ โโโ services/ # API service layer
โ โ โ โโโ api.js # Backend API integration
โ โ โโโ App.jsx # Main app component
โ โ โโโ main.jsx # App entry point
โ โโโ package.json
โ โโโ vite.config.js
โ
โโโ backend/ # Node.js backend API
โ โโโ src/
โ โ โโโ controllers/ # Request handlers
โ โ โโโ models/ # Database schemas
โ โ โโโ routes/ # API routes
โ โ โโโ middleware/ # Custom middleware
โ โ โโโ config/ # Configuration files
โ โ โโโ server.js # Main server file
โ โโโ logs/ # Application logs
โ โโโ package.json
โ โโโ .env # Environment variables
โ
โโโ README.md # This file
# Server
PORT=3001
NODE_ENV=development
# Database
MONGODB_URI=mongodb://localhost:27017/agi-cosmic
# Authentication
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRES_IN=7d
# AI Integration (Optional)
OPENAI_API_KEY=your-openai-api-key-here
AI_MODEL=gpt-3.5-turbo
# CORS
FRONTEND_URL=http://localhost:5173VITE_API_URL=http://localhost:3001/apiPOST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user
POST /api/chat/sessions- Create chat sessionPOST /api/chat/sessions/:id/messages- Send messageGET /api/chat/sessions/:id- Get chat history
GET /api/users/stats- User statisticsGET /api/users/chat-history- Chat history
-
Explore the Solar System: Use mouse controls to navigate the 3D space
- Rotate: Left click + drag
- Zoom: Scroll wheel
- Pan: Right click + drag
-
Chat with AI: Use the chat panel on the right
- Ask questions about space, aerospace, or cosmic phenomena
- Get specialized responses based on context
- Sessions are automatically saved
-
User Features (when authenticated):
- Persistent chat history
- User statistics
- Profile management
- JWT-based authentication
- Password hashing with bcrypt
- Rate limiting on API endpoints
- CORS configuration
- Input validation and sanitization
- Secure HTTP headers with Helmet
The application supports OpenAI integration for enhanced AI responses:
- With API Key: Full GPT-powered responses
- Without API Key: Intelligent fallback responses
- Context Awareness: Specialized responses for aerospace topics
- Session Memory: Maintains conversation context
cd frontend
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production buildcd backend
npm run dev # Start with nodemon (auto-restart)
npm start # Start production server
npm run lint # Run ESLint- Build the frontend:
npm run build - Deploy the
distfolder - Set environment variable:
VITE_API_URL
- Set all environment variables
- Ensure MongoDB is accessible
- Deploy with:
npm start
- Fork the repository
- Create a 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 a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Three.js community for 3D graphics capabilities
- React Three Fiber for React integration
- OpenAI for AI capabilities
- MongoDB for database solutions
For support, email raelei333@gmail.com or visit ashfiagi.com
Built with โค๏ธ for space exploration and aerospace technology enthusiasts


