MEAN is a Java-Script FOSS for developing web applications and a web interface. On the stack, MEAN supports JavaScript software, which means that only one language is required for development on the server (backend) and website (web interface). MEAN stands for MongoDB, ExpressJS, AngularJS, and NodeJS, which are separate technologies.
Install MongoDB
Already on the existing server Ubuntu 20.04 must first install MongoDB
$ sudo apt update && sudo apt install -y mongodbNext, launch and enable MongoDB at boot.
$ sudo systemctl start mongodb
$ sudo systemctl enable mongodbInstall NodeJS and Dependencies
Using the official source script mode to get the latest version of NodeJS.
$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -Install NodeJS, build dependencies and git
$ sudo apt install -y nodejs gcc g++ make gitUse npm to set yarn and a sip
$ sudo npm install -g yarn
$ sudo npm install -g gulpClone the official MeanJS repository
$ git clone https://github.com/meanjs/meanGo to the MeanJS directory
$ cd meanSet the dependencies using yarn.
$ yarn installTest
Open the server.js file
$ nano server.jsThen you need to replace the contents with the following code:
const express = require('express');
const MongoClient = require('mongodb').MongoClient;
const app = express();
app.use('/', (req, res) => {
    MongoClient.connect("mongodb://localhost:27017/test", function(err, db){
        db.collection('Example', function(err, collection){
            collection.insert({ pageHits: 'pageHits' });
            db.collection('Example').count(function(err, count){
                if(err) throw err;
                res.status(200).send('Page Hits: ' + Math.floor(count/2));
            });
        });
    });
});
app.listen(3000);
console.log('Server running at http://localhost:3000/');
module.exports = app;Start the server
$ gulpIn the end, in order to make sure that the server is working properly and that the databases are handled correctly, you need to go to the URL of your page. Replace 192.168.8.8 with your north IP
