Why MEAN Stack?
MongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and easy scalability. It works on concept of collection and document.
MongoDB is, a kind of NoSQL database. As a NoSQL database, MongoDB shuns the relational database’s table-based structure to adapt JSON-like documents that have dynamic schemas which it calls BSON. This makes data integration for certain types of applications faster and easier.
AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly. AngularJS’s data binding and dependency injection eliminate much of the code you would otherwise have to write. And it all happens within the browser, making it an ideal partner with any server technology.
### Linux * Node.js – Download and Install Node.js, nodeschool has also free node tutorials to get you started. We recommend node-4.x as the preferred node version to run mean.io. * MongoDB – Download and Install mongodb – Checkout their manual if you’re just starting.
If you’re using ubuntu, this is the preferred repository to use.
$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash –
$ sudo apt-get update
$ sudo apt-get install nodejs
- Git – Get git using a package manager or download it.
- Node.js – Download and Install Node.js, nodeschool has free node tutorials to get you started.
- MongoDB – Follow the great tutorial from the mongodb site – “Install Mongodb On Windows”
- Git – The easiest way to install git and then run the rest of the commands through the git bash application (via command prompt) is by downloading and installing Git for Windows
- Node.js – Download and Install Node.js or use the packages within brew or macports.
- MongoDB – Follow the tutorial here – Install mongodb on OSX
- git – Get git from here.
- Mean currently uses gulp as a build tool and bower to manage frontend packages. $ npm install -g gulp // and bower $ npm install -g bower
To start with MEAN install the mean-cli package from NPM. This will also add the mean command which lets you interact (install, manage, update …) your Mean based application.
Install the MEAN CLI
In linux install in globally as root
bash $ sudo npm install -g mean-cli $ mean init <myApp> $ cd <myApp> && npm install
Invoke node with a task manager
Mean supports the gulp task runner for various services which are applied on the code. To start your application run – bash $ gulp
Alternatively, when not using gulp (and for production environments) you can run: bash $ node server Then, open a browser and go to: bash http://localhost:3000
Running on a different port
If you have a rails, node, or other MEAN project already running, you may need to use a different port. You can set the port and start your new MEAN project with one command: bash $ export PORT=3001 && gulp
Then, open a browser and change the port number before you visit: bash http://localhost:3001
Update NPM, Bower or Gulp
Sometimes you may find there is a weird error during install like npm’s Error: ENOENT. Usually updating those tools to the latest version solves the issue.
- Update NPM: bash $ npm update -g npm
- Updating Gulp: bash $ npm update -g gulp
- Updating Bower: bash $ npm update -g bower
Cleaning NPM and Bower cache
NPM and Bower has a caching system for holding packages that you already installed. We found that often cleaning the cache solves some troubles this system creates.
- NPM Clean Cache: bash $ npm cache clean
- Bower Clean Cache: bash $ bower cache clean
Mean Stack Development Tutorials
Want to learn Mean Stack development quickly . You can find few resources here