Skip to content

Built application end-to-end using Express, NodeJS, React framework, optimized display function with GoogleAPI

Notifications You must be signed in to change notification settings

itswcl/WCLSHOP_2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WCLSHOP_2

Preview

WCLSHOP (1)

AWS instance

  • choose Ubuntu18.04 1

  • choose free tier 2

  • go to step 6 configure security group - update SSH, My IP / add rules for http & https, Anywhere 3

  • launch instances with key 4

AWS connect

  • click connect on dashboard and go SSH client copy 3 and 4 information Screen Shot 2022-03-12 at 6 17 29 PM
  • go local terminal paste information as below
    • chmod 400 <keyname.pem>
      1. from SSH client bullet 3
      2. make sure you are on key directory to run command
    • ssh -i <"keyname.pem" [email protected]>
      1. from SSH client Example

update/install software version

  • sudo apt update
  • sudo apt install nodejs npm nginx git -y
  • nodejs -v

this should print out version 10.19.0

this should now print out version 14.7.0 or newer

  • sudo apt install build-essential

install code on instance

set up frontend - react

  • cd ~/MERN-Deployment/client
  • sudo rm -rf /var/www/html
  • sudo mv build /var/www/html
  • sudo service nginx restart
  • fix fronend route start with /
    • sudo grep -rl localhost /var/www/html | xargs sed -i 's/http://localhost:8000//g'

set up backend and mongoDB

  • cd ~/MERN-Deployment/server
  • npm i
  • wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
  • echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
  • sudo apt update
  • sudo apt install -y mongodb-org
  • sudo service mongod start
  • service mongod status
  • sudo rm /etc/nginx/sites-available/default
  • sudo vim /etc/nginx/sites-available/default
    • import the code below in lines
      • MERN-Deployment Configuration 1-16-2020 server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.html index.htm index.nginx-debian.html; server_name MERN-Deployment; location /api { proxy_pass http://localhost:8000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade;
        } location / { try_files $uri $uri/ =404; } error_page 404 /index.html; }

About

Built application end-to-end using Express, NodeJS, React framework, optimized display function with GoogleAPI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published