Skip to main content

Working with Yeoman


Let's take a look at Yeomen. Yeomen is not part of MEAN Stack but allow us to quickly get startup providing us with generators that can create starter temples. It helps to setup the links between some or all the components of MEAN Stack, without having to do it all by hand. We will be focusing a developing an app with MEAN Stack in the tutorial. Let's begin installing Yeoman using npm.

$npm install -g yo

Now that yeoman is installed we can next install a generator with it. Let's head to yeoman.io website and click discover generators. We going to use the gulp-angular generator.


It will save us a lot of time setting up some tedious tasks that make our development process much faster. Gulp allow us to automate tedious and dependent tasks which are moving files over to publish folder or linking libraries or packages that needed our app. Click the gulp-angular generator and we can see the dependencies we need to install in order to run it. So let's open up our command prompt in order to do that. We also need to install bower, we can type both commands as follow. Bower is a package manager that works in the frontend, and finally, we install the generator.

$npm install -g gulp bower generator-gulp-angular



After installing we can go start our MEAN stack project by typing the following command in the command line inside your project folder.

yo gulp-angular my-test-app



As we create the app we will get asked several questions by the generator. After getting and collecting use statistics you will get ask what version of angular you would like to use. Then it asks what angular models we would like to use. Then ask about jQuery. Next, we will get asked by how we going to handle REST-full services and so on.  After that give a minute or two to install all of that.

After the installing is complete go and initialize it with the gulp command.

$gulp



Next, we can try out our app by typing gulp serve. This should automatically open the browser for us. As we can see the demo application is showing.

$gulp serve



Comments

Popular posts from this blog

Getting Started with Git & GittHub

Creating a Git Project Git is a version control system that keeps track of the files in a project. In order to use git, we start by identifying a folder as a git repository. we do it by running init command in the folder. Before running the git command go to your project folder and create two files called file1.txt and file2.txt and add some sample text to it and save the file. Now open up the git command line in the project folder and type the following command. An easy way to is by right clicking anywhere inside your project folder and click git bash here. $ git init Checking Status Now we created a git repository. Now we can check the status of our repository by typing git status in the git terminal. $ git status You can see there are two files in red which called as untracked files. This is because we still didn't add any file to our git repository. Adding files to Git repository To add files to your git repository by simply typing git add file1.t

Unit Testing with Mocha

Unit testing is the best way to uncover hidden bugs in your system. JavaScript Community has produced several testing frameworks that will help us with the task of writing Unit Tests. Some of them are Jasmin, Mocha, Jaster, Quint. These are all JavaScript Testing frameworks, that you can use to test JavaScript Code. Today we are going to focus on the Mocha testing framework. Let's go and install Mocha globally that we can use on any of our projects. $ npm install  -g mocha To run a Mocha test all you need is to type mocha. But you need to have directory named test. Before running mocha first make sure you have created a directory call test. $ mocha Now Mocha is ready to use. Now let's go and create our first test. Create a folder MochaTesting anywhere in your folder. This is the folder we are going to work. Inside that folder create a folder called test. Inside the test, folder create a file call my-test.js We are going to use Test Driven Development. That mean

Introduction to MEAN Stack

MEAN stands for Mongo, Express, Angular and Node. In the world of modern software, we typically deal with frontend and backend. MEAN Stack includes both technologies for both sides frontend and backend. Mongo Mongo is a cross-platform document-oriented database. Meaning is not like more traditional SQL database. Which is where NoSQL term comes from, with that means Mongo DB Store JSON-like documents with dynamic schemas making it better and faster for some applications.Companies with large scale deployments of Mongo DB includes Adobe, eBay, LinkedIn and much more. There is no database we can call as the best. It depends on the type of the system. Mongo DB is one in many options. Mongo DB is good for developers who is familiar with JavaScript and JSON and also easy to start learning. Express Express or ExpresJS is Node JS web application framework. It's the server framework for NodeJS. It allows quick development of robust web APIs by providing the thin and performa