In this article, we will cover how to install mean stack in fedora and how to set everything up in order to get started.
What is the MEAN stack?
M in MEAN stands for MongoDB. MongoDB is a simple NoSql and object-oriented database technology that is efficient and scalable for large data storage. MongoDB stores data as objects in JSON format, in separate documents instead of storing in rows and columns like in a typical relational database. This increases productivity in the manipulation and retrieval of data in abundance.
E in MEAN stack stands for express JS. Express js or express is a node js framework that promotes the rapid development of node-based web and mobile applications. Express supports the MVC framework which helps in building more scalable, structured and dynamic websites. Express focuses more on the back-end or the developer side.
A in mean stack stands for Angular. Angular is an MVC framework for the client end or front end. Angular allows us to create a strong interactive web or mobile application. It also has great support for creating cross-platform and progressive web applications.
Fedora is a Linux distributed Operating System. In this section of the article, we will cover how to install MEAN/MERN/MEVN in fedora.
step 1: update
the first thing before starting is to update your OS
sudo dnf -y update
step 2: Install MongoDB
for installing mongoDB you need to first open the file for adding content to your repository.
sudo vi /etc/yum.repos.d/mongodb.repo
the terminal should give you an ok.
Now install mongoDB by simplifying running
sudo apt install -y mongodb
after the file is open, write the following content to add to your repository.
name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.2/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
now you can easily run the following command to install MongoDB in fedora.
sudo dnf install mongodb-org
Press ‘y’ to complete your installation. Now you need to start your newly installed mongodb. For that run the following command.
sudo systemctl enable mongod.service sudo systemctl start mongod.service
You can stop and restart MongoDB by the following commands
sudo systemctl stop mongod sudo systemctl restart mongod
Step 3: installing Node JS
from fedora 24 and onwards, npm comes in part with node js so you don’t have to install it separately
sudo dnf install nodejs
modules for available version can be looked up by running
dnf module list
and for installing different version
sudo dnf module install nodejs:10
step 4: install express js
run the following command to get and install express JS in fedora.
First install npm,
npm install -g express
Now this install express cli to help you in creating the basic web site structure.
Create a new project to test your installation. First create a new folder in which you will get all the dependencies of the project to be created
npm init mkdir projectName cd projectName express npm install
once the project is installed, try running it with node app
Run the command to install
Step 5: installing Angular
You will have to make sure that you have npm installed and running for Angular as well. You can install angular cli through running the command
npm install -g @angular/cli
you can install any specific version by
npm install -g @angular/cli@versionNumber
you can update your Vue if you already have it installed