Architecture of Mean Stack
The MEAN.js is designed or developed to build a robust framework for helping developers use better practices when working with the popular JavaScript components, building a robust framework for supporting daily development needs, and solving common issues with connecting to MongoDB, Express.js, Node.js, AngularJS frameworks. For back-end and front-end, the MEAN stack is very simple and easy to use. There are several technologies which use different languages for both client-side and server-side execution. In MEAN technology, we use only one language for both client and server-side.
For building an application, the MEAN stack includes the following four building blocks which are as follows:
MongoDB
MongoDB is a document database in which the data is stored in flexible, JSON-like documents.
Express.js
Express.js is a web application framework for Node.js. A flexible Node.js web application framework used for making the development process easy is referred to as Express.js.
AngularJS
AngularJS is a web front-end framework written in JavaScript. Using AngularJS, we can create a single page and dynamic applications in the MVC (MVC stands for Model View Controller) way.
Node.js
Node.js is a server-side platform for designing web applications such as single-page applications, video streaming sites, and other web applications. It gives us a rich library of various JavaScript modules.
- AngularJS is a client-side language written in JavaScript. So, firstly the client request is processed by it.
- After that, the request enters the server (Node.js), i.e., phase 2. Node.js is a server-side language written in JavaScript.
- After that, ExpressJS makes the request to the database, and it is treated as phase 3.
- After getting a request, MongoDB retrieves the data & returns the response back to the ExpressJS.
- A response is sent back to the Node.js from Express.js, and then it is forwarded to the AngularJS by Node.js for displaying the result.
Features of MEAN stack architecture
These are the following features of MEAN stack architecture:
- One of the most important features of the MEAN stack architecture is that the developer writes the entire code from the client to the server in JavaScript.
- MEAN stack architecture supports the MVC, i.e., Model View Controller architecture.
- The MEAN components are free and open-source.
- It is flexible to understand and easy to use.
- It helps the developers to customize as per the requirement.
- It uses JSON for data transferring and has a massive module library of node.js.