/Nasa-CRUD-Gallery

An infinite-scrolling photo gallery of NASA astronomy photos, complete with all CRUD operations. Built with React.

Primary LanguageTypeScriptMIT LicenseMIT

Nasa-CRUD-Gallery

A fully-responsive, infinitely scrolling NASA photo gallery complete with all CRUD operations.

Technologies

Built with:

Libraries & Features

Dev Notes

Spinning up locally

  • Create a '.env' file inside the root of the folder and paste your API key from NASA's Website.

    VITE_NASA_API_KEY = "YOUR_SECRET_KEY_HERE"
    
  • Scripts:

    npm run start                   // spins up project in a local development environment (Vite)
    npm run cypress:dev             // starts cypress GUI w/ local server for testing-development
    npm run cypress:e2e-ci          // used in github action CI or terminal for running cypress tests with headless UI
    

Testing

NASA API Load Time Optimization

The UI utilizes a custom date-pagination-hook implemented to optimize the API call - because NASA's API takes 4 seconds for 7 days of images; you can't just pass in a huge date range to the API. Each time the last element on page is detected, we update the start and end date, and recall the API.