Published on

Trump Talks Trash

Last Modified on
Last modified on
Authors
Trump Talks Trash
Photo by Maria D. Campbell on Interglobalmedia

Description

Formerly a Random Quote API Application using the What Does Trump Think? API. I previously created a Nodejs app using the ejs (embedded javascript) view engine for Express, a minimalist framework for Nodejs. I was only using one image which was not large, and there were no fancy animations involved. I used the fetch() API method instead of AJAX.

Suffice it to say, Heroku since that time was taken over by Salesforce, and they have slowly been trying to edge out anyone who is not part of the company. In addition, there have been a number of hacker attacks in the last year or so, so I did not feel comfortable using the platform anymore!

Lately, I have been doing a deep dive into Next.js, so I decided to build this app using Next.js instead. And I am so happy that I did! Much less code, fewer files, fewer dependencies, no full page reloads (which happened with ejs), and lots of fun figuring out how to make the API work with something new!

One thing that was a really cool design challenge regarding this application, was to make sure that my "Next Quote" button did not jump whenever I clicked on it to get the next quote from the API. I also wanted to make sure that the quote container also did not bounce all over the place, while making sure that the application was still completely responsive. I think the solution I came up with is pretty darn good! Check it out and let me know! You can leave a comment via Giscus at the bottom of this post by clicking on the "Load Comments" button and submitting a comment there.

Refactored Project Includes

nextjs, next font, font optimization, react, fetch api, what does trump think random quote api