CosmoPT is an interactive educational platform that combines space science with physics experiments to create an engaging learning experience. Students can explore the cosmos, conduct physics simulations, take quizzes, and embark on virtual space missions.
- ๐งช Interactive Physics Experiments: Collision dynamics, pendulum motion, projectile physics, and more
- ๐ Solar System Exploration: Interactive 3D solar system with detailed planetary information
- ๐ Mission Simulator: Realistic space mission scenarios with decision-making challenges
- ๐ Educational Quizzes: Adaptive quizzes covering astronomy, physics, and space science
- ๐ฏ Gamification: Points system, achievements, and progress tracking
- ๐ค AI ChatBot: Intelligent assistant for learning support
- ๐ค User Management: Secure authentication with personalized profiles
- ๐ฑ Responsive Design: Works seamlessly across desktop and mobile devices
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- Matter.js for physics simulations
- Axios for API communication
- React Router for navigation
- Lucide React for icons
- Node.js with Express.js
- MongoDB with Mongoose ODM
- JWT for authentication
- bcryptjs for password hashing
- CORS for cross-origin requests
- dotenv for environment configuration
- Node.js (v18 or higher)
- MongoDB (local installation or MongoDB Atlas)
- Git
-
Clone the repository
git clone https://github.com/Rajukrsna/CosmoPT.git cd CosmoPT -
Install frontend dependencies
npm install
-
Install backend dependencies
cd backend npm install -
Set up environment variables
Root
.envfile:# Frontend Configuration VITE_API_BASE_URL=http://localhost:5000/api/users VITE_PORT=5173 VITE_NODE_ENV=developmentBackend
.envfile:# Server Configuration PORT=5000 # MongoDB Configuration MONGO_URI=mongodb://localhost:27017/cosmopt # Or use MongoDB Atlas: # MONGO_URI=mongodb+srv://username:[email protected]/CosmoDB # JWT Configuration JWT_SECRET=your_secure_jwt_secret_key_here # Node Environment NODE_ENV=development # CORS Configuration FRONTEND_URL=http://localhost:5173
-
Start the development servers
Terminal 1 - Backend:
cd backend npm startTerminal 2 - Frontend:
npm run dev
-
Open your browser
Navigate to
http://localhost:5173to see the application.
CosmoPT/
โโโ ๐ src/ # Frontend source code
โ โโโ ๐ components/ # Reusable React components
โ โ โโโ ChatBot.tsx # AI-powered learning assistant
โ โ โโโ Navigation.tsx # Main navigation component
โ โ โโโ Login.tsx & Register.tsx # Authentication forms
โ โ โโโ StarField.tsx # Animated space background
โ โโโ ๐ pages/ # Main application pages
โ โ โโโ Home.tsx # Landing page
โ โ โโโ SolarSystem.tsx # Interactive solar system
โ โ โโโ MissionSimulator.tsx # Space mission scenarios
โ โ โโโ Learning.tsx # Educational content
โ โ โโโ TravelPlanner.tsx # Space travel planning tool
โ โโโ ๐ experiments/ # Physics simulation components
โ โ โโโ collision.tsx # Collision dynamics
โ โ โโโ Pendulum.tsx # Pendulum motion
โ โ โโโ Projectile.js # Projectile motion
โ โ โโโ Newton.tsx # Newton's laws demo
โ โโโ ๐ context/ # React Context providers
โ โ โโโ GameContext.tsx # Game state management
โ โ โโโ userAuthContext.tsx # User authentication
โ โโโ ๐ utils/ # Utility functions
โ โโโ axios.ts # API configuration
โโโ ๐ backend/ # Backend server code
โ โโโ server.js # Express server entry point
โ โโโ ๐ models/ # MongoDB data models
โ โ โโโ User.js # User schema
โ โ โโโ QuizSchema.js # Quiz data model
โ โ โโโ Mission.js # Mission scenarios
โ โ โโโ Planets.js # Planet information
โ โ โโโ Vehicles.js # Space vehicles data
โ โโโ ๐ routes/ # API route handlers
โ โ โโโ authRoutes.js # Authentication endpoints
โ โ โโโ UserRoutes.js # User management
โ โ โโโ fetchDataRoutes.js # Data fetching endpoints
โ โโโ ๐ middleware/ # Express middleware
โ โโโ authMiddleware.js # JWT authentication
โโโ ๐ public/ # Static assets
โโโ ๐ assets/ # Images and media files
- Collision Dynamics: Explore elastic and inelastic collisions
- Pendulum Motion: Study simple harmonic motion
- Projectile Motion: Understand trajectory calculations
- Inclined Plane: Learn about forces and acceleration
- Newton's Laws: Interactive demonstrations
- Solar System: 3D interactive model with planetary data
- Mission Planning: Create and execute space missions
- Travel Calculator: Calculate distances and travel times
- Destination Guide: Detailed information about celestial bodies
- Adaptive Quizzes: Questions that adjust to user skill level
- Achievement System: Unlock badges and rewards
- Progress Tracking: Monitor learning journey
- Interactive Labs: Hands-on experiments
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logout
GET /api/users/:id- Get user profilePUT /api/users/:id/points- Update user pointsPUT /api/users/:id/quiz- Complete quizPUT /api/users/:id/visit- Visit planet
GET /api/users/fetch/getQuiz- Fetch quiz dataGET /api/users/fetch/getMission- Fetch missionsGET /api/users/fetch/getVehicles- Fetch vehiclesGET /api/users/fetch/getDestination- Fetch destinationsGET /api/users/fetch/getLabs- Fetch lab experiments
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Physics simulations powered by Matter.js
- Icons by Lucide React
- Space data from various educational sources
- Inspiration from NASA educational programs
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue if needed
- Contact the development team
Made with โค๏ธ for space education enthusiasts
๐ Star this repo if you found it helpful!