This web-app is helpful to display various services, food items offered at each branch separately where Admins can add,edit and remove the food items for their specific branches and Customers can search,sort & filter the food items and order the food online & track the placed orders.
This is a Full-Stack Web Project done by using the Technologies- Angular (HTML, CSS & Type Script) for Frontend; SPRING Boot as Middleware; JAVA, Data JPA for Backend and MySQL Database. Software used : Visual Studio Code for Frontend, Intellij for Backend and MySQL DB.
This application is a 3-tier application where we have :
- a frontend : developed with Angular
- a backend : developed with Java and Spring Boot
- a database : MySQL.
We can deploy this application in 3 different ways: deployment on a Centos 7 server, deployment with Docker, and deployment with Docker-Compose.
In the following description, we will give the main steps to deploy this application on a Centos 7 server.
In this step, we will :
- connect to our Centos server
- update the server
- install git,
- create a folder and enter this folder.
- clone the repository that contains the source codes of our application
sudo yum update
sudo yum update
sudo yum install git -y
mkdir fastfood_deplyer
cd fastfood_deplyer/
git clone https://github.com/utrains/fastfood.git
In this step, we will install on our server, a MySQL database, create a database of our Application. Here is the list of steps to follow to install MySQL on our Centos 7 server:
- We need to update our system
- install wget
- download the MySQL using wget
- prepare the repository
- use yum install command to install MySQL
- Start MySQL and Check its Status
- Configure MySQL and Changing MySQL Root User Password
sudo yum update
sudo yum install wget -y
sudo rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
sudo yum install mysql-server -y
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
sudo yum update -y
sudo yum install mysql-server -y
sudo systemctl start mysqld
sudo systemctl status mysqld
sudo grep 'password' /var/log/mysqld.log
sudo grep 'password' /var/log/mysqld.log
: this command will generate the temporary password for the root user of the database.
- This password will allow us to change and set the root password of the root user of our application's database.
- Please note that for the configuration of our database, the developers have used the following configurations:
- user : root
- password : 2j5R1HtsE7@mpM8Tdn92
- database name : sandwitchdatabase
- in the following commands, please change the password generated by the root user, by the password of our developer friends.
sudo mysql_secure_installation
- following this command, you will enter our developer password, then answer a few questions to validate the password change
- we will connect to MySQL with the user root, enter the password we just changed.
- then create our database with the name that the developers specified in their configuration files
mysql -u root -p
SHOW DATABASES;
CREATE DATABASE sandwitchdatabase;
Note : you can see the database config in the this file : application config file
- install and configure the JDK 8 environment variable
- install and configure the environment variable of maven 3.8.5
- download maven
- unzip the archive
sudo yum install java-1.8.0-openjdk -y
#--- install Maven
sudo -i
cd /opt
wget https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz --no-check-certificate
tar -xf apache-maven-3.8.5-bin.tar.gz
rm -rf apache-maven-3.8.5-bin.tar.gz
mv apache-maven-3.8.5/ maven
- config these enviroment variable : MAVEN_HOME and JAVA_HOME
vim ~/.bash_profile
M2_HOME=/opt/maven
M2=$M2_HOME/bin
PAHT=<Existing_PATH>:$M2_HOME:$M2
- Compile and start the Backend : The Sprint boot App
cd utrains_fastfood_repo/fastfood/fastfood_BackEnd
mvn clean package
- a target folder is created and contains a .jar file for the backend. run the command below to launch it.
java -jar target/fastfood-0.0.1-SNAPSHOT.jar
- At this stage when everything is going well, you can connect to your database and see the information in it.
the steps of the node installation are the following:
- First, update the local repository
- Next, add the NodeSource repository
- install nodejs
sudo yum update -y
sudo yum install curl -y
curl –sL https://rpm.nodesource.com/setup_10.x | sudo bash -
sudo yum install –y nodejs
node –version
- go to the fastfood_FrontEnd folder, then Install Nodejs and npm dependencies for the client
cd utrains_fastfood_repo/fastfood/fastfood_FrontEnd
npm install -g @angular/cli@10.0.5
npm install --force
- make this commands to start the frontend :
ng serve
- open the browser and make this url to start FrontEnd : http://localhost:4200
- utrains@utrains.test | Role : Admin | pwd : Utrains_p@ss
- alain@utrains.test | Role : Customer | pwd : Alain_p@ss