Welcome to SpacEd, a web application dedicated to space exploration and education! This project provides access to NASA's APOD (Astronomy Picture of the Day), EPIC (Earth Polychromatic Imaging Camera), and Mars Rover Photos APIs. Explore stunning images and information about space phenomena right from your browser.
You can access the live demo of the SpacEd web application from following links :
To set up the project locally, follow these steps:
Ensure you have the following prerequisites installed:
- Node.js
- npm
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/spaced.git
-
Navigate to the project directory:
cd spaced -
Install dependencies:
npm install
Before running the application, you need to obtain an API key from NASA and configure Firebase for authentication and hosting. Follow these steps:
-
Obtain NASA API Key:
- Go to the NASA API website: https://api.nasa.gov/
- Sign up for an account and obtain your API key.
-
Configure Firebase:
- Go to the Firebase Console: https://console.firebase.google.com/.
- Create a new project and follow the setup instructions.
- Enable Authentication and choose the authentication methods( email/password, Google sign-in ).
- Obtain your Firebase configuration settings from the Firebase project settings.
-
Add API Key to Environment Variables:
- Create a
.envfile in the project root. - Add the following environment variables:
VITE_NASA_API_KEY=your-nasa-api-key VITE_FIREBASE_API_KEY=your-firebase-api-key VITE_FIREBASE_AUTH_DOMAIN=your-firebase-auth-domain VITE_FIREBASE_PROJECT_ID=your-firebase-project-id VITE_FIREBASE_APP_ID=your-firebase-app-id VITE_FIREBASE_STORAGE_BUCKET=your-firebase-storage-bucket VITE_FIREBASE_MESSAGING_SENDER_ID=your-firebase-massaging-sender-id VITE_FIREBASE_MEASUREMENT_ID=your-firebase-measurement-id- Replace
your-nasa-api-keywith the API key obtained from NASA. - Replace
your-firebase-api-key,firebase-auth-domain,your-firebase-project-id,your-firebase-app-id,firebase-storage-bucket,your-firebase-massaging-sender-id,your-firebase-measurement-idwith your Firebase configuration settings.
- Create a
To run the project locally:
npm run devThis will start the development server
To build the project for production:
npm run buildThis will generate the production build in the dist directory.
This project utilizes Jest for testing. To run the tests, use the following command:
npx jest This will execute the test suites and provide feedback on the code's functionality and correctness.
To deploy the project to Firebase Hosting:
-
Install Firebase CLI globally:
npm install -g firebase-tools
-
Log in to Firebase:
firebase login
This will redirect to firebase login. login using you account.
-
Initialize Firebase in your project:
firebase init
Follow the prompts to select Firebase Hosting and choose your project.
-
Deploy the project:
firebase deploy
After deployment, you will get the hosting URL where your app is hosted.
This project acknowledges the following resources:
- NASA APIs: https://api.nasa.gov/
- Firebase: https://firebase.google.com/
Documentation for the NASA APIs used in this project can be found at the following links:
- APOD API: https://github.com/nasa/apod-api
- EPIC API: https://api.nasa.gov/
- Mars Rover Photos API: https://github.com/corincerami/mars-photo-api
-
For detailed information on each API endpoint, refer to the API Endpoint Documentations.
-
Make sure to configure environment variables properly for testing environments to avoid errors.
-
Editor : IT21271182 - Rathnayake R M U V
- More info available in SpacEd Report.pdf