scottpcipriano / connectfour

1 stars 0 forks source link

Connectfour

Introduction

You remember old school ConnectFour. That was pre-hipster. This is ConnectFour post-hipster.

Technologies at play

Installed software

Local dev

To get the project running:

Clone project

git clone git@github.com:spcip82/connectfour.git

Install dependencies

sudo npm install nodemon -g
sudo npm install -g node-inspector
npm install

Start a local mongodb?

mongod --config mongo/mongod-dev.conf

How do you test to see if your mongo db is up

mongo
use testdb;
db.testdb.save( { id: 1, name: 'scott' } )
db.testdb.find()
db.testdb.remove({})

Create a configuration file

cp config-sample.json config.json   

(config.json is in .gitignore so you can change your local configurations w/out worrying about accidentally committing your own development configuration.)

nconf essentially takes the config.json file and creates a pseudo set of process.env.* variables. Note, however, that for every used local "environment" variable in config.json there must be an actual production environment variable set up.

Start the webapp

nodemon app.js

Testing the webapp

make test

Deployment at Heroku

App currently deployed at: http://connectfour-hipster.herokuapp.com

Heroku dashboard (to see app Scott needs to set you up as a collaborator): https://dashboard.heroku.com

Install Heroku toolbelt: https://toolbelt.heroku.com/

Initial deployment setup

Changes to app

Instructions from here

Heroku provisioning
heroku login
heroku create
heroku addons:add mongohq
git push heroku master
heroku ps:scale web=1   
heroku config:add NODE_ENV=production --app connectfour-hipster
heroku config:add MONGO_URL=mongodb://**REDACTED**
heroku config:add DOMAIN=connectfour-hipster.herokuapp.com --app connectfour-hipster
heroku config:add AUTH_RETURN_HOST=connectfour-hipster.herokuapp.com --app connectfour-hipster

Also please note in Heroku dashboard the application was renamed after it was created

Deploy for the first time

git remote add heroku git@heroku.com:connectfour-hipster.git
git push heroku master

Deploy update

git push heroku master

View logs

heroku logs -t --app connectfour-hipster