Monday, February 7, 2022

How To install MEVN stack On Ubuntu 20.04

in This Tutorial you will learn "How To install MEVN stack On Ubuntu 20.04"
MEVN stack
The acronym MEVN stands for MongoDB, Express.js, VueJS, Node.js.

MEVN stack is the open-source JavaScript software stack that has emerged as a new and evolving way to build powerful and dynamic web applications. Its software components can be used to effectively design frontend and backend development and improve the functionality of your website or app.

MongoDB: A document-oriented, No-SQL database used to store the application data.
ExpressJS: A framework layered on top of NodeJS, used to build the backend of a site using NodeJS functions and structures. Since NodeJS was primarily developed to run JavaScript on a machine instead of making websites, ExpressJS was created for the latter purpose.
Vue JS: VueJS is referred to as a client-side framework and is especially used in front-end web development. It has two-way data binding that allows seamless frontend development along with MVC capability and interactive server-side applications.
NodeJS: The JavaScript runtime environment. It is used to run JavaScript on a machine rather than in a browser.
_________________________________________________________________________________________
Server - Os:  Ubuntu 20.04.3 LTS 64Bit        | IP -192.168.1.80            |Hostname -  ubuntu.example.com
_________________________________________________________________________________________
lsb_release -d ; hostname -I ; hostname
apt-get install mongodb curl gnupg2 unzip git gcc g++ make -y
systemctl start mongodb ; systemctl enable mongodb
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
apt-get install -y nodejs

npm install -g express
mkdir myproject ; cd myproject
npm init -y
npm install express
nano app.js
const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => {
    res.send('Hello World!')
})

app.listen(port, () => {
    console.log(`Example app listening at http://localhost:${port}`)
})

node app.js
http://localhost:3000

VueJS -
npm install -g @vue/cli-service-global
npm install -g @vue/cli
vue --version
vue create mevnproject
cd mevnproject
npm run serve
http://localhost:8080/
_______________________________________________________________________________________

1 comment: