/website-v1

Personal Website Used to Host Blog, Resume, Projects, etc

Primary LanguageJavaScriptMIT LicenseMIT

Website Description

www.pauldeng.co (atm..)

Landing page to my Personal Website Used to Host Blog, Resume, Projects, etc

Using node.js and express framework to deploy onto Heroku, npm for package management, Twitter's bootstrap3 to create initial landing page. May extend to custom html5/css in the future.

Files

.gitignore

Used by git to ignore files. In this case, node modules are ignored.

Procfile

A text file used by Heroku to start specific web dynos. In this case node is initiated to run the web.js script

web.js

The express() app which calls index.html and opens port 8080 for local debug

package.json

Heroku uses package.json to identify the application as a node.js app. The file contains all the npm dependencies which app requires.

npm install

to install equivalent dependencies on local machine for local debug.

index.html

Utilizes Twitter's bootstrap3 for stylization as of now. Will incorporate Google Analytics for market reearch.

Setup:

  1. On a clean EC2 instance clone and run setup
sudo apt-get install -y git-core
git clone https://github.com/paulliwali/setup.git
./setup/setup.sh
  1. Generate a new ssh key and updated it on Github
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
  1. Clone over this git
git clone git@github.com:paulliwali/website.git
  1. Setup git config
git config --global user.name $USERNAME
git config --global user.email $EMAIL
  1. Exit and re-enter the EC2 instance
exit
ssh -i  filename.pem ubunutu@ip_address
  1. Install npm dependencies inside the website directory
cd website
npm install
  1. Update Heroku with ssh key, and create the Heroku apps is not previously created
heroku login
heroku keys:add
heroku apps:create appname-s --remote staging-heroku
heroku apps:create appname --remote production-heroku
  1. To add existing Heroku apps to git remotes
heroku git:remote -a appname-s -r staging-heroku
heroku git:remote -a appname -r production-heroku
  1. To push to git and Heroku
git push origin develop
git checkout staging
git merge develop
git push origin staging
git push staging-heroku staging:master
git checkout master
git merge develop
git push origin master
git push production-heroku master:master

References

node.js Heroku Deployment

node.js

express

Coursera: Startup Engineering