Skip to content

jsv1280/api-nasa

Repository files navigation

API-NEO-NASA-GraphQL Status badge

Backend Service to deploy NEO(Nearth Earth Objects) in GraphQL based on public NASA API Asteroids NeoWs

📢 Requirements

  • Node JS 12.18.1 (Recommended)
  • Mongo DB 4.2.8 (Recommended)

🔨 Installation

  1. Clone Project git clone [email protected]:jsv1280/api-nasa.git
  2. Install dependencies in the root project npm install
  3. In your terminal (root project) execute npm run start
  4. For development enviroment execute npm run dev

🔧 Built with

  • Express (cors,express-graphql,helmet)
  • GraphQL (graphql, graphql-tools)
  • MongoDB (NodeJS Mongo DB Driver)
  • Dotenv
  • Standard,Nodemon (Development)
  • AWS EC2 Instance
  • PM2 (Production)
  • graphdoc (Documentation)

🔬 Documentation

  1. This project start documenting the public NASA API Asteroids NeoWs to have clear all the endpoints and data expose for the NASA API. To make more clear this, I documented the API with Postman to add a more descriptive view to check how behave this API and with that check which data will be included in this API

Postman REST NeoWS Documentation

  1. Next step, It was create three endpoints, one for creating new NEOS object based of the data model proposed in graphql schema, other for get all NEOS and finally delete duplicated NEOS objects

REST Section Documentation API NASA

  1. With GraphQL established a SDL(Schema Definition Language lib/graphql/schema.graphql) for this project and all the queries necessary to access this service

GraphQL Documentation API NASA

For development remember graphiql will activate to check in the GUI all querys,mutations,inputs of the schema definition

✈️ Deploy

  • In your AWS Instance make sure you have successfully installed the previous requirements detailed in the beginning
  • Install globally pm2 npm install pm2 -g
  • Start Service npm run start

⚡ Demo

To use this service make a POST request with your queries to:

  • http://ec2-54-234-62-6.compute-1.amazonaws.com:8080/api/graphql

In /mocks/graphql_client.js you can find a simple example

📚 Frontend Implementations

✒️ Author

📑 License

This project is under license MIT

❤️ Acknowledgment

  • Cesar Joshua Pedraza Cruz (Coach Platzi Master)
  • Team Cohort3-Cesar
  • Platzi

🔭 References