[Mean] Learn & Build Your Mean Stack Application Using YEOMAN Generator Within A Day


This post will help you to learn MEAN Stack application. MEAN Stack Application uses MongoDB as the database, Express Framework as an app server, Angular JS for client View and NodeJS for server side.

Prerequisite:

Please make sure Latest version of Node and MongoDB installed and running on your machine.


We are going to use YEOMAN Generator to Generate Mean Stack Application code for us. Yeoman Generator contains 6000+ code generators available and it will really help us to kick start into the project. Browse generators available with Yeoman.

We are going to using npm to install all the components so if you are not familiar with npm. Check this URL npm video tutorial by nodesimplified.com. If you want to learn more about npm go through the npm demystified series.


Step 1: The First step install yo scaffolding tool globally using npm. Please make sure user have enough permission to install the packages globally else user need to install these package as sudo.

npm install -g yo


Step 2: Once yo get installed, User need to install Mean.js generator in their machine and it also needs to installed globally.

npm install -g generator-meanjs


Step 3: Now you need to create your application, run the following command which will ask series of questions lets go with default for this case but you can update the details based on your application.

yo meanjs

Once all the data entered, it will fetch the boilerplate code from GitHub and it will do npm install and bower install which will install all the server side and client side dependencies. You don't need to manually do an installation of node and client packages.

If you face any error while npm or bower installation then do npm install and bower install manually.

npm install    //Install all node dependencies mentioned in package.json.

bower install  //Install all front end dependencies mentioned in bower.json.

Once Installation is successful, Our application is ready for the first run. Please make sure MongoDB is up and running on your machine.


Step 4: Run the application. Run the following command to start the application.

grunt

Above command will start the application and when you hit http://localhost:3000/ in your machine you can able to see following web page getting rendered in your browser.



Now you have successfully started running your application. Grunt is the Javascript task runner which will perform some tasks like code cleanup and alignment checks then it will kick start the application. Even you can use Gulp for running your application.


This code contains predefined functionalities like the sign in, signup and so on features already implemented based on coding standards so you can directly use these functionalities and you can build your application on top of this stack. I believe you can build this application within an hour without much struggle. 


If you enjoyed this article, Please share it with your developer friends and in social media. 

You can follow our facebook page for latest updates.

Comments