Using React Hooks and Axios

Image for post
Image for post
Photo by visuals on Unsplash

There are several news APIs to choose from when building a news app with React and I decided to check out the New York Times API because NYT is one of my favorites news sources and also because the documentation was quite detailed.

I decided to write this article since I couldn’t find much information on the implementation on this particular API and hopefully this is useful to other developers.

We will use the following technologies to build this app but this article will be mostly focused on understanding the NYTimes API.

Technologies used


In web apps the process of user sign ups and subsequent logins is complex and there are several implementations to make your apps more robust and secure.

Each implementation adds a layer of abstraction and it is worth examining the various options developers have for authentication (verifying client identity) and authorization (granting permissions).

Technologies used

  • Express-validator: validates user credentials
  • Bcrypt: hashes passwords before saving them to our database
  • Jsonwebtoken: generates tokens for authorization and access to our app routes
  • Mongoose: interacts with our MongoDB database
  • Nodemon: restarts our server every time there is a change


How to send emails from a gmail account using node’s nodemailer module

Image for post
Image for post
Photo by Solen Feyissa on Unsplash

When creating your own web app, one of the cool features you can add is to send emails to your users and to achieve this you can use gmail and nodemailer.

Nodemailer is a module that we can use to send emails using Node JS.

In this tutorial we will do a step by step process to use gmail with nodemailer, and create environment variables to hide your gmail id and password.

Disclaimer: Do not use this method in production without going through OAuth. …


Understanding and visualizing for loops

Image for post
Image for post
Photo by Kelly Sikkema on Unsplash

The purpose of this tutorial is to write a function to add two arrays in Javascript and understand the code execution of each step.

Problem: Write a function to sum two matrices

let a = [[1, 2], [3, 4]]; 
let b = [[2, 3], [4, 5]];

tl; dr : Solution

let a = [[1, 2], [3, 4]];
let b = [[2, 3], [4, 5]];
let c = [[], []];
for (let i = 0; i < a.length; i++) {
for (let j = 0; j < a[i].length; j++) {
c[i][j] = a[i][j] + b[i][j];
}
}
console.log(c); output [[3, 5]…

Isabel Hong

MERN Stack | Let's connect @ https://www.linkedin.com/in/isabel-hong/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store