There are startups all around the world who are using this technology stack to deliver their first MVP.
Why do developers like the MEAN stack?
As I can see, there are four (main) reasons why developers choose to develop using the MEAN stack.
1. It is free, and doesn't require a license cost to develop an application. For a developer (freelancer or not) who wants to work on a project such as a Web page, a mobile application, or a Web service, it is the perfect choice. For startups, the initial costs are very important; they need to reduce their costs, so they try to use open source and free stuff.
3. Large community support. Each of the technologies in the stack has a large and very active community, with fast responses to questions, bug reports and frequent releases.
4. It is modular. In case developers don't like Express.js, they can remove it from the stack and only implement the server side code using pure Node.js code. The flexibility of removing and adding parts to the stack makes it easy to use the MEAN stack for development.
1. MongoDB is a NoSQL (Not only SQL) document store database, created by 10gen. It is open source, but has enterprise support. It is a schema-less database and it stores data in a BSON format (the binary version of JSON objects). Since the result of database queries are JSON objects, it is very convenient to use with the other technologies in the stack. There is no need for manual data mapping and type conversion after querying the database.
2. Express.js is a Web framework built for Node.js. It is supported by StrongLoop and it has a code generator tool, which offers a standard code and folder structure for developing your application.
On an Ubuntu(14.04.1) machine, first you will have to install Node.js, NPM (Node Package Manager) and MongoDB:
greg@earth:~$ sudo apt-get install nodejs npm mongodb
Using NPM you will install express.js and express-generator, the tool for code generation (the -g flag of the npm install the package globally, not only for the local project):
greg@earth:~$ sudo npm install express -g greg@earth:~$ sudo npm install express-generator -g
First MEAN project
Using the express code generator you can create a minimal project to start with:
greg@earth:~$ express myFirstMeanApp
This will create a new folder named myFirstMeanApp, and it will create a basic directory structure for the project, having views, routes, bin and public folders. The naming is obvious.
To run the application, you will have to install the dependencies and start the project:
greg@earth:~/mean$ cd myFirstMeanApp greg@earth:~/mean/myFirstMeanApp$ sudo npm install greg@earth:~/mean/myFirstMeanApp$ ./bin/www
After the application starts, you can navigate to the http://localhost:3000/ and you will see the web-page below:
You now have a MEAN development environment and also a project set up for development.