Chapter 3. Creating and setting up a MEAN project

 

This chapter covers

  • Managing dependencies by using npm and package.json
  • Creating and configuring Express projects
  • Setting up an MVC environment
  • Adding Twitter Bootstrap for layout
  • Publishing to a live URL, and using Git and Heroku

In this chapter, you’ll start building your application. Remember from chapters 1 and 2 that, throughout this book, you’re going to build an application called Loc8r—a location-aware web application that displays listings near users and invites people to log in and leave reviews.

Getting the source code

The source code for this application is on GitHub at https://github.com/cliveharber/gettingMean-2. Each chapter with a significant update will have its own branch. We encourage you to build it up from scratch through the course of the book, but if you want to, you can get the code that you’ll be building throughout this chapter from the chapter-03 branch on GitHub. In a fresh folder in terminal, if you already have Git installed, the following two commands will clone it:

$ git clone -b chapter-03 https://github.com/cliveharber/
gettingMean-2.git

This gives you a copy of the code that’s stored on GitHub. To run the application, you need to install some dependencies with the following commands:

$ cd gettingMean-2
$ npm install

Don’t worry if some of this doesn’t make sense yet or if some of the commands aren’t working. During this chapter, you’ll install these technologies as you go.

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

3.2. Creating an Express project

3.3. Modifying Express for MVC

3.4. Importing Bootstrap for quick, responsive layouts

3.5. Making it live on Heroku

Summary

sitemap