Getting MEAN with Mongo, Express, Angular, and Node, Second Edition
Simon D. Holmes
  • MEAP began March 2017
  • Publication in Spring 2018 (estimated)
  • ISBN 9781617294754
  • 450 pages (estimated)
  • printed in black & white


An eBook copy of the previous edition, Getting MEAN with Mongo, Express, Angular, and Node, is included at no additional cost. It will be automatically added to your Manning Bookshelf within 24 hours of purchase.

Traditional web dev stacks use a different programming language in every layer, resulting in a complex mashup of code and frameworks. Together, the MongoDB database, the Express and Angular frameworks, and Node.js constitute the MEAN stack - a powerful platform that uses only one language, top to bottom: JavaScript. Developers and businesses love it because it's scalable and cost-effective. End users love it because the apps created with it are fast and responsive. It's a win-win-win!

Getting MEAN, Second Edition is completely revised and updated to cover Angular 2, Node 6 and the latest mainstream release of JavaScript ES2015 (ES6). This Second Edition will walk you through how to develop web applications using this updated MEAN stack. First, you'll create the skeleton of a static site in Express and Node, and then push it up to a live web server. Next, add a MongoDB database and build an API before using Angular to handle data manipulation and application logic in the browser. Finally you'll add an authentication system to the application, using the whole stack. When you finish, you'll have all the skills you need to build a dynamic data-driven web application.

Table of Contents detailed table of contents

Part 1: Setting the Baseline

1. Introducing full-stack development

1.1. Why learn the full stack?

1.1.1. A very brief history of web development

1.1.2. The trend toward full-stack developers

1.1.3. Benefits of full-stack development

1.1.4. Why the MEAN stack specifically?

1.2. Introducing Node.js: The web server/platform

1.2.1. JavaScript: The single language through the stack

1.2.2. Fast, efficient, and scalable

1.2.3. Using prebuilt packages via npm

1.3. Introducing Express: The framework

1.3.1. Easing your server setup

1.3.2. Routing URLs to responses

1.3.3. Views: HTML responses

1.3.4. Remembering visitors with session support

1.4. Introducing MongoDB: The database

1.4.1. Relational versus document databases

1.4.2. MongoDB documents: JavaScript data store

1.4.3. More than just a document database

1.4.4. What is MongoDB not good for?

1.4.5. Mongoose for data modeling and more

1.5. Introducing Angular: The front-end framework

1.5.1. jQuery versus Angular

1.5.2. Two-way data binding: Working with data in a page

1.5.3. Using Angular to load new pages

1.5.4. Are there any downsides?

1.5.5. Developing in TypeScript

1.6. Supporting cast

1.6.1. Twitter Bootstrap for user interface

1.6.2. Git for source control

1.6.3. Hosting with Heroku

1.7. Putting it together with a practical example

1.7.1. Introducing the example application

1.7.2. How the MEAN stack components work together

1.8. Summary

2. Designing a MEAN stack architecture

2.1. A common MEAN stack architecture

2.2. Looking beyond SPAs

2.2.1. Hard to crawl

2.2.2. Analytics and browser history

2.2.3. Speed of initial load

2.2.4. To SPA or not to SPA?

2.3. Designing a flexible MEAN architecture

2.3.1. Requirements for a blog engine

2.3.2. A blog engine architecture

2.3.3. Best practice: Build an internal API for a data layer

2.4. Planning a real application

2.4.1. Planning the application at a high level

2.4.2. Architecting the application

2.4.3. Wrapping everything in an Express project

2.4.4. The end product

2.5. Breaking the development into stages

2.5.1. Rapid prototype development stages

2.5.2. The steps to build Loc8r

2.6. Hardware architecture

2.6.1. Development hardware

2.6.2. Production hardware

2.7. Summary

Part 2: Building a Node Web Application

3. Creating and setting up a MEAN project

3.1. A brief look at Express, Node, and npm

3.1.1. Defining packages with package.json

3.1.2. Installing Node dependencies with npm

3.2. Creating an Express project

3.2.1. Installing the pieces

3.2.2. Creating a project folder

3.2.3. Configuring an Express installation

3.2.4. Creating an Express project and trying it out

3.2.5. Restarting the application

3.3. Modifying Express for MVC

3.3.1. A bird's eye view of MVC

3.3.2. Changing the folder structure

3.3.3. Using the new views and routes folders

3.3.4. Splitting controllers from routes

3.4. Import Bootstrap for quick, responsive layouts

3.4.1. Download Bootstrap and add it to the application

3.4.2. Using Bootstrap in the application

3.5. Make it live on Heroku

3.5.1. Getting Heroku set up

3.5.2. Pushing the site live using Git

3.6. Summary

4. Building a static site with Node and Express

4.1. Defining the routes in Express

4.1.1. Different controller files for different collections

4.2. Building basic controllers

4.2.1. Setting up controllers

4.2.2. Testing the controllers and routes

4.3. Creating some views

4.3.1. A look at Bootstrap

4.3.2. Setting up the HTML framework with Pug templates and Bootstrap

4.3.3. Building a template

4.4. Adding the rest of the views

4.4.1. Details page

4.4.2. Adding Review page

4.4.3. The About page

4.5. Take the data out of the views and make them smarter

4.5.1. How to move data from the view to the controller

4.5.2. Dealing with complex, repeating data patterns

4.5.3. Manipulating the data and view with code

4.5.4. Using includes and mixins to create reusable layout components

4.5.5. The finished homepage

4.5.6. Updating the rest of the views and controllers

4.6. Summary

5. Building a data model with MongoDB and Mongoose

6. Writing a REST API: Exposing the MongoDB database to the application

7. Consuming a REST API: Using an API from inside Express

Part 3: Adding a dynamic front end with Angular

8. Creating an Angular application with TypeScript

9. Building a Single Page Application with Angular: Foundations

10. Building a Single Page Application with Angular: The next level

Part 4: Managing Authentication and User Sessions

11. Authenticating users, managing sessions and securing APIs


Appendix A: Installing the stack

A.1. Installing Node and npm

A.1.1. Long Term Support versions of Node

A.1.2. Installing Node on Windows

A.1.3. Installing Node on Mac OS X

A.1.4. Installing Node on Linux

A.1.5. Verifying installation by checking version

A.2. Installing Express globally

A.3. Installing MongoDB

A.3.1. Installing MongoDB on Windows

A.3.2. Installing MongoDB on Mac OS X

A.3.3. Installing MongoDB on Linux

A.3.4. Running MongoDB as a service

A.3.5. Checking the MongoDB version number

A.4. Installing Angular

Appendix B: Installing and preparing the supporting cast

B.1. Twitter Bootstrap

B.1.1. Adding some custom styles

B.2. Font Awesome

B.3. Installing Git

B.4. Installing a suitable command-line interface

B.5. Setting up Heroku

B.5.1. Signing up for Heroku

B.5.2. Installing Heroku CLI

B.5.3. Logging in to Heroku using terminal

Appendix C: Dealing with all of the views

Appendix D: Reintroducing JavaScript

What's inside

  • Full-stack development using JavaScript
  • Responsive web techniques to build mobile-ready web applications
  • Everything you need to get started with MEAN
  • Best practices for efficiency and reusability

About the reader

Readers should have some web development experience. This book is based on MongoDB 3, Express 4, Angular 2, and Node.js 6, making use of the ES2015 JavaScript syntax.

About the author

Simon Holmes has been a full-stack developer since the late 1990s, manages the European Solutions Engineering team for LivePerson and runs Full Stack Training Ltd.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
MEAP combo $44.99 pBook + eBook
MEAP eBook $35.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks