Introduction to MEANJS

MEAN.JS is a full-stack JavaScript solution that helps you build fast, robust, and maintainable production web applications using MongoDB, Express, AngularJS, and Node.js.

The official website of MEAN.JS is: http://meanjs.org/

This post is the first post in a series of tutorials about MEAN JS. In this series, I will use MEANJS to create a MEAN application to do hotel management.

You can access the source code of this series at: https://github.com/quanhua92/MEANJS-HotelManagement/

The source code of this blog is at: https://github.com/quanhua92/MEANJS-HotelManagement/releases/tag/v0.1

Table of contents:

1. Introduction to MEANJS
2. Understanding MEANJS Structure

First, you need to install a few softwares on your machine.
1. Node.JS and npm (http://www.nodejs.org/download)
2. mongodb (http://www.mongodb.org/downloads)
3. bower: sudo npm install -g bower
4. grunt-cli: sudo npm install -g grunt-cli

In this blog, I will show you how to use Yo Generator to create a MEAN application.

1. Install Yo Generator

sudo npm install -g yo

2. Install MeanJS Generator

sudo npm install -g generator-meanjs

3. Change directory to your project location. For example:

cd /Users/quanhua92/workspace/MEANJS-HotelManagement

4. Create your MEAN application with the following command:

yo meanjs

5. After answering some basic questions, your project will be ready. The following screenshot shows the created application in the project directory.



6. Open a terminal tab and start MongoDB. In this case, I want the database to be created in "data" folder in my application.

mkdir data
mongod --nojournal --dbpath=data


7. Change to your previous tab, start your MEANJS application with the grunt command:

grunt



8. At this moment, your MEAN application is ready at http://localhost:3000/



9. The created application already has a Sign in / Sign up feature.



10. After creating an account, we can sign in. The application has a simple CRUD module. (CRUD means Create - Read - Update - Delete).

11. You can try create an Articles by clicking the "New Article"



12. The following screenshot shows the "List Articles" page after we created a new article



In the next post, I will guide you how to create a Hotel type and add some fields to suit our need.

Share this:

ABOUT THE AUTHOR

Hello, My name is Quan. I love blogging to share my knowledge to the world. Tell me want you want to read. I will try to blog about it. Have a nice day!

1 comments:

  1. iZombie Season 3 will portray Liv gulping down the brain of a dominatrix. Therefore, we can expect the upcoming installment to be more engaging than the previous ones. iZombie Season 3 Release Date

    ReplyDelete