NASA API Discovery LogoNASA API Discovery
M81 Galaxy

Discover NASA Imagery and Data

A free and open source project, built with REST APIs from api.nasa.gov

About This App

The goal of this application is to create a front-end for the REST APIs that are found in the api.nasa.gov catalog. These APIs expose a wealth of images and information, such as data on comets, measurements of mars, and real-time imagery of earth.

Technical Details

The NASA API Discovery consists of a Jamstack React app as the front-end and a serverless, Node.js REST API as the back-end. It is hosted by Vercel and written in TypeScript.

Jamstack

Jamstack is an architecture designed to make the web faster, more secure, and easier to scale. It builds on many of the tools and workflows which developers love, and which bring maximum productivity.

Pre-rendering

With Jamstack, the entire front-end is prebuilt into highly optimized static pages and assets during a build process. This process of pre-rendering results in sites which can be served directly from a CDN, reducing the cost, complexity and risk, of dynamic servers as critical infrastructure.

Enhancing with JavaScript

With the markup and other user interface assets of Jamstack sites served directly from a CDN, they can be delivered very quickly and securely. On this foundation, Jamstack sites can use JavaScript and APIs to talk to backend services, allowing experiences to be enhanced and personalized.

Supercharging with services

The thriving API economy has become a significant enabler for Jamstack sites. The ability to leverage domain experts who offer their products and service via APIs has allowed developers to build far more complex applications than if they were to take on the risk and burden of such capabilities themselves.
Alert Component Screenshot

Fullstack

Along with the Jamstack front-end, this application includes a serverless JSON REST API as the back-end. The application API fetches and returns data from NASA, to be consumed by the front-end.

Next.js API Routes

The request (req) object is an instance of http.IncomingMessage, plus some pre-built middlewares. The response (res) object is an instance of http.ServerResponse, plus some Express.js-like helper functions.

Serverless Functions

Serverless computing offers a number of advantages over traditional server-centric infrastructure: greater scalability, more flexibility, and quicker time to release, all at a reduced cost. With serverless architectures, we do not need to worry about purchasing, provisioning, and managing backend servers.
API Route Image Image

Technologies