Getting MEAN - with Mongo, Express, Angular and Node

Simon Holmes

Published by






Reviewed by

Patrick Hill CEng MBCS CITP


10 out of 10

In recent years, a variety of JavaScript frameworks supporting browser-based user interfaces have been developed. At the same time, JavaScript itself has escaped the confines of the web browser to be used in a variety of application components such as web servers and databases. The MEAN stack is one configuration of JavaScript-based components, specifically MongoDB, Express, Angular.js and Node.js, which together provide the necessary building blocks and tools to enable the development of complete web applications using JavaScript end-to-end.

This book provides an in-depth introduction to MEAN for readers with some knowledge of JavaScript and web applications. The book is presented in four sections.

An introductory section outlines the theory and practice of each of the principal components of the MEAN stack. The content includes a useful overview of document databases, of which MongoDB is an example, as well as discussing the use of the Mongoose.js object modelling library to help work with MongoDB.

In subsequent sections, the author takes a hands-on approach, developing a simple but illustrative example throughout the book to motivate discussion of general aspects of modern web application design, and the corresponding implementation techniques using the MEAN stack.

The second section guides the reader through using Node.js, Express and the Jade templating engine to develop a static web application which is then enhanced by using Mongoose and MongoDB to provide dynamic data. The application is further developed to expose database interactions as a REST API. As well technical topics, this chapter describes approaches to structuring project code when working with the MEAN stack.

The third section focuses on developing the user interface using Angular.js. First the application is built as a traditional web application, with pages being fetched from the server in response to client requests. Then the application is transformed into a Single Page Application (SPA) in which the entire application is delivered to and run by the browser. The author describes how routing within the SPA can be handled using Angular.js and the HTML5 history API.

The final section explores user authentication both within the user interface, and then at the level of API endpoints. The author considers topics such as password storage, the implementation of user registration and login pages using Angular and the use of the Passport library to facilitate authentication.

There are three appendices in the print edition which together cover topics such as the installation of the MEAN stack components, configuring and using tools to deploy applications to the Heroku cloud application platform, and further consideration of UI implementation techniques using Angular.js. A freely downloadable appendix provides a useful introduction to JavaScript. In addition, the code for each chapter is available from the author’s github site.

I think this is an excellent book. It contains a wealth of detailed material written in an easy-to-read style, making this an enjoyable end-to-end read. The reader will learn not just how to use the discrete MEAN components, but also how to structure MEAN projects and use free tools to expedite the development process. However, I think the real value of the book comes from working through each chapter, ideally keying in and experimenting with the code yourself. Recommended.

Further information: Manning

October 2016