Let's Just Blog-105


MEAN Stack?
Following Let's Just Blog-102 and a link on Digital Ocean, I will install MEAN stack on f1-micro instance of GCP, and you should able to build a website without much of a initial capital expense. Please enable Google Cloud with your email, and provision an free f1-micro VM.

Install NodeJS on Ubuntu

ssh-keygen -t rsa -f ./yourkey -C ubuntu ssh -i yourkey ubuntu@youripaddress
After generating the ssh key and associating it with your instance, please connect to your vm with ssh.
You should also allow the http traffic and easiest way to enable the "Allow Http Traffic" checkbox.
sudo apt update sudo apt install apache2 sudo ufw app list http://youripaddress/ sudo apt-get install git

Install NodeJS sudo apt-get install nodejs sudo apt-get install npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
node -v [v4.2.6] npm --version [3.5.2]

Install NGINX
sudo apt-get update sudo apt-get install nginx nginx -v [nginx version: nginx/1.10.3 (Ubuntu)] Congratulations on installing the NodeJS on ubuntu!
Now let's relate a bit to Wordpress on LAMP stack install in Let's Just Blog-103 , we have linux as common OS on both stack, we are using NGINX as a web server but Apache is supported, and NodeJS is Javascript engine which is more preferred over PHP engine these days. In LAMP stack, we have MySQL as a DB engine, and MEAN stack uses MongoDB. Express is a node module that helps you create an app server supporting REST features. I will say that MongoDB has ATLAS as a cloud offering, which has a free-tier and you can skip the DB install on Ubuntu.


Single Page App on MEAN Stack?
Let's now try to create a single page app running on MEAN stack. Following the letjustblog naming standard, I will start by creating a repository with the name letjustblog-mean. Node App has package.json file for mentioning dependencies and I am running with express 4, bootstrap 4 and mongoose. You are welcome to download the repository and design your own pages. On the client side, I am running with AngularJS and routing between different views is enabled with Angular-Route.


git clone https://github.com/madajee/letjustblog-mean.git cd letjustblog-mean/ npm start Configure NGINX to forward port 80 to 3000 http://youripaddress:3000


Comments

Popular posts from this blog

Let's Just Blog-106