Thursday, November 14, 2013

MEAN stack for BitNami: MongoDB, Express, AngularJS & NodeJS

http://bitnami.com/stack/mean

We are glad to announce that MEAN stack has been released as part of the BitNami Library! The MEAN acronym was introduced by Valeri Karpov from the MongoDB team in this blog post and stands for MongoDB NoSQL database, Express, AngularJS and NodeJS.


In addition to these components, the stack also ships some useful development tools:
  • - Apache
  • - MongooseJS
  • - Bower
  • - Git
  • - RockMongo, a MongoDB web administration tool (optional, will automatically install PHP as well)
BitNami MEAN stack is available for free from the BitNami app store as a native installer or virtual machine for local development, or as a cloud template for the Amazon and Windows Azure cloud computing platforms.

BitNami MEAN stack installer welcome
BitNami MEAN stack installation

Once the installation process has been completed, you can access the welcome page from your browser at http://localhost on Windows or http://localhost:8080 on OS X or Linux. If you have enabled RockMongo during the installation you can also manage your MongoDB from this web application.


BitNami MEAN stack welcome screen
RockMongo, MongoDB administration tool

Because BitNami MEAN stack is self-contained, it runs independently from the rest of the software or libraries installed on your system, and you will need to load specific environment variables. BitNami stacks ship a script that loads this environment for all platforms we support. Note that this applies mainly to native installers, not for Virtual Machines or cloud images.

For instance, you can create your first Express application running the following command from a Terminal:

$ ./use_meanstack
$ express testapp

Now you can deploy your your first Express application.

$ cd testapp
$ node app

The following sample application uses the MongoDB driver for Node.js. You can clone this project from GitHub repository:

$ git clone https://github.com/vkarpov15/mean-stack-todo

Then edit the "app.js" file to change the default MongoDB connection. This example uses the "admin" database and the "root" user.

var db = Mongoose.createConnection('mongodb://root:PASSWORD@localhost/admin');

Then, check that MongoDB is already running in the graphical manager tool and start the sample application:

$ node app

You can see something similar to this at http://localhost:3000

MEAN sample application

We documented more details and more features of MEAN in our Quick Start Guide. Do you have questions? We will be happy to help you at our community forum!