Space Explorer is an interactive web application that allows users to explore NASA's Astronomy Picture of the Day (APOD), save favorite images, and test their space knowledge through quizzes. The application provides an educational and engaging way to learn about space and astronomy.
- Daily Astronomy Picture: View NASA's Astronomy Picture of the Day with detailed explanations
- Historical Archive: Browse through past APOD images by selecting specific dates
- Favorites Collection: Save and manage your favorite space images
- Space Quiz: Test your knowledge with space-related quiz questions
- Responsive Design: Enjoy a seamless experience across desktop and mobile devices
- React.js
- Vite
- Axios for API requests
- React Router for navigation
- Node.js
- Express.js
- MongoDB for data storage
- NASA Open APIs integration
- Node.js (v14 or higher)
- npm or yarn
- MongoDB (local or Atlas)
- NASA API key (get one here)
-
Clone the repository:
git clone https://github.com/yourusername/space-explorer.git cd space-explorer/backend -
Install dependencies:
npm install
-
Create a
.envfile in the backend directory with the following variables:PORT=5000 MONGODB_URI=your_mongodb_connection_string NASA_API_KEY=your_nasa_api_key -
Start the backend server:
npm start
-
Open a new terminal window and navigate to the frontend directory:
cd ../frontend -
Install dependencies:
npm install
-
Create a
.envfile in the frontend directory:VITE_API_URL=http://localhost:5000/api -
Start the development server:
npm run dev
-
Start backend in one terminal:
cd backend && npm start
-
Start frontend in another terminal:
cd frontend && npm run dev
-
Install concurrently in the project root:
npm install --save-dev concurrently
-
Add a script to your frontend's package.json:
"scripts": { "dev": "vite", "backend": "cd ../backend && npm start", "dev:all": "concurrently \"npm run dev\" \"npm run backend\"" }
-
Run both servers with a single command:
npm run dev:all
GET /api/nasa/apod- Get today's Astronomy Picture of the DayGET /api/nasa/apod?date=YYYY-MM-DD- Get APOD for a specific date
GET /api/favorites/:userId- Get all favorites for a userPOST /api/favorites- Add an image to favoritesDELETE /api/favorites/:id- Remove an image from favorites
GET /api/quiz- Get a set of quiz questions
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the 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.
- NASA for providing the APOD API
- Space enthusiasts everywhere for their passion and curiosity