Building a rich internet application using JavaScript for UI, Rails or the Servlets for the server layer is pretty common. How about using JavaScript to build an application from start to end in all the layers? How about making use of the popular JavaScript libraries to build a complete application? The MEAN (MongoDB-ExpressJS-AngularJS-NodeJS) stack helps you do that. In this article, you’ll get introduced to the MEAN stack to develop an application using JavaScript.
Let’s take baby steps
The acronym MEAN corresponds to the four libraries: MongoDB, the NoSQL database, ExpressJS, the server-side web framework, AngularJS, the client-side web framework, and NodeJS, the server runtime.
In the first part of this article, I am not going to explain all these libraries in detail, as that would mean writing a book. Let’s keep it simple.
If you’re already breathing heavily, relax, let’s go slow. Let me help you visualize this. It’s football time, so let’s say you want to develop a simple page that feeds-in the data about all the teams.
We create a web server using NodeJS. In other words, our application runs on NodeJS. ExpressJS is used to build the server-side web application. It’s an MVC-style framework where the controller receives the request, processes it, and gives a response back. So, if you want to add the Brazil team, the data is passed on to the controller. The controller connects to the MongoDB database and stores the data. How’s the user going to feed the data? The user enters his data in a page that’s developed using the AngularJS framework. AngularJS is a client-side MVC library. The figure below shows the components of MEAN in action.
Let’s continue with installation the next post.