Book Image

Mastering Web Application Development with Express

By : Alexandru Vladutu
Book Image

Mastering Web Application Development with Express

By: Alexandru Vladutu

Overview of this book

Table of Contents (18 chapters)
Mastering Web Application Development with Express
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing the SmartNotes application


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.

The bootstrapping phase

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 functionality

  • models: This folder contains Mongoose models for users and notes

  • routes: Instead of putting all the routes in the server.js file, we put them in this folder and require them in the main file

  • test: This folder contains all the tests for the...