nasa-photo-of-the-day

Module Project: Component Side Effects- NASA APOD

This will be a two-module project. In it you will consume the NASA API to fetch the “Astronomy Photo Of The Day” or APOD. Once you fetch the data, you will build a few components that will render different pieces of data in your interface. After the second module (in the DAY_TWO_README.md file) you will re-style your app using Styled Components.

Instructions


Read these instructions carefully. Understand exactly what is expected before starting this project.

Commits

Commit your code regularly and meaningfully. This helps both you and your team lead in case you ever need to return to old code for any number of reasons.

Introduction

In this project you will build out a application to show the NASA photo of the day.

Instructions

Task 1: Project Set Up

This project was put together using create-react-app (CRA). You will not need to install CRA in order to make this project work. Follow the steps below to setup the project with the proper dependencies.

Task 2: MVP

Planning

File structure

Fetching the Data

DEMO KEY rate limits:

Hourly Limit: 30 requests per IP address per hour

Daily Limit: 50 requests per IP address per day

Note: if the photo url is NOT a photo, you will need to learn how to display a video in a React app on your own, OR just fetch the APOD from a different date by adding this to the back of the API endpoint: &date=2012-03-14

Adding the Data to State

Display the Data Now is the time to build out your other components. Compose your UI, and then pass the data to your children components via props so you can render it on the DOM.

MVP Requirements:

Pro Tips

// Display a loading message while the data is fetching
if (!props.photoOfTheDay) return <h3>Loading...</h3>;

// Display your component as normal after the data has been fetched
return (
  {/* your normal JSX here */}
);

Task 3: Stretch

Do not attempt stretch problems until MVP has been reached and a final commit has been made.

Submission Format

Follow these steps for completing your project.


Part II - Advanced Styling Techniques