sbhanuteja / Dress4Win

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dress4Win

Launching db-server

  1. Provision a Google Compute Engine (GCE)
  2. SSH into the db-server. Switch as root user using sudo -s and below command to install MySQL Server. When prompted for password give a strong like P@ssW0rd2020
    apt update
    apt install mysql-server -y
  3. Comment bind-address configuration using vi /etc/mysql/mysql.conf.d/mysqld.cnf and save the configuration using ESC followed :wq!
  4. Restart MySQL Service using systemctl restart mysql
    mysql -u root
    mysql> CREATE USER 'new_user'@'%' IDENTIFIED BY 'new_password';
    mysql> GRANT ALL PRIVILEGES ON . TO 'new_user'@'%';
    mysql> FLUSH PRIVILEGES;
    mysql> GRANT ALL PRIVILEGES ON . TO 'new_user'@'%' WITH GRANT OPTION;
    mysql> ALTER USER 'new_user'@'%' IDENTIFIED BY 'new_password';
    Restart MySQL Service using systemctl restart mysql
  5. Logging to mysql using mysql -h 127.0.0.1 -u new_user -p
  6. Create a database named eCommerce using CREATE DATABASE eCommerce;
  7. Exit mysql session
  8. Change directory to home directory using cd ~ and run git clone https://github.com/sbhanuteja/Dress4Win.git
  9. Change directory to Dress4Win/sql
  10. Create the table schema using mysql -h 127.0.0.1 -u new_user -p eCommerce < ecommerce.sql

Launching app-server

  1. Provision a Google Compute Engine (GCE) with below startup script
apt update
apt install -y git
curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh
bash nodesource_setup.sh
apt install -y nodejs
npm install -g forever
git clone https://github.com/learngcpwithmahesh/Dress4Win.git
cd Dress4Win
npm install
2. SSH into the app-server. Switch as root user using sudo -s and change the database IP address in database/config.js file
3. Now, run the Node JS app to in daemon mode using forever start index.js
4. Use the external IP of app-server to access the Dress4Win App

About


Languages

Language:EJS 67.5%Language:JavaScript 32.5%