AstroNet is a React-based frontend application that consumes data from NASA's public APIs. This application allows users to explore daily and historical astronomy-related data. The project highlights skills in frontend development, API integration, and application deployment.
- Features
- Technologies Used
- Setup and Installation
- Usage
- Testing
- Deployment
- Challenges and Solutions
- Contributing
- License
- View daily astronomy pictures with descriptions from the Astronomy Picture of the Day (APOD) API.
- Explore Mars Rover photos by selecting different dates and rovers.
- Responsive and visually appealing design using Bootstrap.
- Dynamic data display based on user input.
- User session management to preserve state during the session.
- Frontend: React with functional components, Vite for development server and build tool
- Language: JavaScript
- CSS Framework: Bootstrap
- HTTP Client: Axios
- Icons: FontAwesome
- Routing: React Router DOM
- Particles Animation: React Tsparticles
- Version Control: Git
- Hosting: Vercel (or any suitable free hosting platform)
- Testing: Jest and React Testing Library
Clone the repository:
git clone https://github.com/GevinN99/AstroNet.git cd AstroNetInstall the dependencies:
npm install
Create a
.envfile in the root directory and add your NASA API key:VITE_API_KEY=your_nasa_api_key
Start the development server:
npm run dev
- Open your browser and navigate to
http://localhost:5173. - Explore the Astronomy Picture of the Day and Mars Rover photos.
- Use the date picker to view historical data.
- (Optional) Sign up and log in to access personalized features.
To run the tests, use the following command:
npm testThis project includes both unit and integration tests using Jest and React Testing Library. Tests cover critical functionalities and components of the application to ensure robustness and reliability.
Build the application:
npm run build
Deploy the
distfolder to your chosen hosting platform. For example, using Vercel:npm install -g vercel vercel
Follow the prompts to complete the deployment.
- Challenge: Handling the asynchronous nature of API calls and managing the data state.
- Solution: Used Axios for API requests and React's useState and useEffect hooks to manage data fetching and state updates efficiently.
- Challenge: Ensuring the application is responsive across various devices.
- Solution: Utilized Bootstrap's grid system and responsive classes to create a fluid and adaptable layout.
- Challenge: Preserving user state and managing sessions.
- Solution: Implemented session management using localStorage and React context API for state management.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
- Fork the repository
- Create a new branch (
git checkout -b feature-branch) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature-branch) - Create a new Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.