For the remainder of this chapter, we will create a sample microblogging application from scratch with error handling included.
Guests should be able to register, log in, and publish posts on the home page of the application. Everybody should be able to view published posts (from newest to oldest) and new post notifications should be sent in real time to the web interface. A counter will display the number of posts that have been published since viewing the page, and there will be a button for the users who want to load them.
We will use the following modules:
mongoose: This module will be used for the database layer (thus, MongoDB as the database)
EJS: This module will be used for rendering views