If you’ve made a static site then it’s pretty easy to make it live using AWS’s S3 buckets. The problem is every time you make a change (like add a new page), you’ll need to update your S3 bucket manually. If you’re also using CloudFront (to reduce latency, to Gzip, etc.) then you’ll need to update that too.

We can automate this process so you don’t have to worry about these tedious tasks. There are two steps:

  1. Create a pipeline to update S3 every time you push changes to GitHub
  2. Clear CloudFront’s cache

Step 0: Set up GitHub Repository

If you’re already using a repository then…

In this article, I’m gonna go over three things to consider when creating Mongoose schemas to improve the performance of your app’s queries.

1. Embed vs Reference

Deciding the schema will have significant conquences on the app performance because it affects the queries we can make. Personally, coming from an SQL background I’m used to having relations between objects.

For example, a dog belongs to a human and we can establish this using a foreign key.

Mongoose offers something similar in the form of ‘references’. But, just because it’s there doesn’t mean it should be used and abused.

For example, let’s say you have…

Most app users expect that once they’ve logged in, they should remain logged in unless they explicitly request to log out.

A simple way to achieve this is by following this navigation flow below:

Unit testing is not the answer to everything, but it sure as hell does prevent a few embarrassing and mind numbing situations. Sometimes, no matter how careful you are when programming, some bugs go unnoticed and the simplest way to catch them before anyone else is unit testing.

In this guide, I will show you how to unit test your MERN stack’s backend using Jest. Specifically, Node.js and Mongoose.

If you’re experienced with Node.js then you can skip to Step 2 which details how to test your functions.

Step 1. Set up express backend

This step should be pretty straight forward for most people. All you…


I love all aspects of computer science but particularly developing new applications on all platforms

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