Next, we start by bootstrapping the application. We then create a validation library so we can reuse it in our models. Once this is done, we create the routes and integrate them into the current application.
For each part that requires writing code, we first create tests, run them to see them fail, and only then continue with the actual implementation. This has multiple benefits, one of the most important being that we will have a better understanding of what we are going to create.
Let's take a look at how the structure of our application will look after we have finished it:
In the root folder of the application, we create the following folders:
lib
: This folder is used for custom functionalitymodels
: This folder contains Mongoose models for users and notesroutes
: Instead of putting all the routes in theserver.js
file, we put them in this folder and require them in the main filetest
: This folder contains all the tests for the...