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.
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.
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 does npm install and bower installs 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.
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.
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.