Feediator Readme

Feediator Readme

by John Vincent


Posted on August 12, 2017



Building and Configuring a Droplet can be very complex.

Home

Feediator

Feediator is a RSS Feed News Aggregator Web based application.

Feediator

Live Deployment

Feediator at Digital Ocean

Demo login

email: demo@feediator.com
password: demo

Updating of RSS Feeds is performed by a cron job which uses

https://www.feediator.com/api/rss/update/all
https://feediator.herokuapp.com/api/rss/update/all

Heroku Deployment

Heroku

Demo login

email: demo@feediator.com
password: demo

Deployment

Notes about how to deploy to a live system.

Deploy Feediator To Digital Ocean

Final Result

Development

My Git repository

Technologies

UI

  • Html5
  • CSS3
  • Sass
  • jQuery
  • Handlebars
  • x-editable
  • Balsamiq

Server

  • Node
  • Express
  • Mongo
  • Mongoose
  • Joi
  • Mocha
  • Chai
  • Winston
  • Morgan
  • JWT
  • Handlebars
  • Gmail OAuth 2
  • JS Doc
  • Facebook and Google Authentication

Deployed for Testing

  • Heroku
  • Travis
  • Mongo

Deployed

  • Digital Ocean
  • Ubuntu
  • Nginx
  • SSL certificates
  • Node
  • Npm
  • Mongo
  • PM2

Wireframes

Wireframes built using Balsamiq may be downloaded here

Development

Run the server

npm start

Build Handlebars Templates

npm run templates

Run Tests

npm tests

Run SASS Compiler

npm run sass

Run SASS Compiler for Production

npm run sass-min

Run JSDoc

npm run jsdoc

Test URLs

Website

http://localhost:8080

Update All Feeds

http://localhost:8080/api/rss/update/all

Update Feed

localhost:8080/api/rss/update/url/http%3A%2F%2Fnews.yahoo.com%2Frss

Heroku

App name: feediator
https://feediator.herokuapp.com/
https://git.heroku.com/feediator.git

Test Heroku App

To run the app on Heroku:

https://feediator.herokuapp.com/

https://feediator.herokuapp.com/api/rss/update/all

Configure for Heroku

Check travis.yml, only need:

language: node_js
node_js: node
services:
- mongodb

Ensure all checked in

cd /Users/jv/Desktop/MyDevelopment/github/thinkful/feediator
git status

Merge all to master

git checkout master
git merge feature_1
git push

To run the tests

npm test

Travis CI

TravisCI

From Github

  • Select {project}
  • Settings, Integrations & services (left menu)
  • Add a Service (mid-right)
    • Select Travis CI from drop-down
    • Add service(green button at bottom)

From Travis CI

  • click on <username> (top right)
    • Lists Github projects
    • Activate {project}

From Github, {project}

  • Settings, Integrations & services
    • Travis CI, Edit
      • Notice Travis CI entry in Webhooks

From Travis CI:

  • Select User-name, Accounts (top-right)
  • Sync Account (top-right)
  • Select {project}
  • Travis builds the project, see Job log
  • When complete, Restart build appears (mid-right)

If did not build the project, make a change, push to repository. Should force a build.

Set up continuous deployment

Configure Travis to work with Heroku.

  • Push changes to master on GitHub, or merge a pull request into master, our tests automatically run.
  • If our tests pass, TravisCI will deploy to Heroku. If our tests do not pass, it will not deploy.

If not already installed, install Travis CI command line interface

sudo gem install travis

Setup Travis to Deploy to Heroku

Travis login requires my Github login.

cd {project}
travis login
and provide github username & password

or:
have already setup SSH for github, thus
travis login --auto-password

To deploy to Heroku:

* travis setup heroku
    * "return" to the questions.
* git diff (see differences)

Note that changes have been made to .travis.yml

Deploy to Heroku

heroku create feediator

Notice:

* App name: feediator
* https://feediator.herokuapp.com
* https://git.heroku.com/feediator.git

Edit .travis.yml

deploy:
    app: feediator

Git commit changes to master

Configure Remote Mongo Database

Login to mLab

Create new database, name = feediator

Add new user: jvuser

Note

To connect using the mongo shell:
mongo ds131511.mlab.com:31511/feediator -u <dbuser> -p <dbpassword>
To connect using a driver via the standard MongoDB URI (what's this?):

mongodb://<dbuser>:<dbpassword>@ds131511.mlab.com:31511/feediator

Create App Data in MongoDB

cd /Users/jv/Desktop/MyDevelopment/github/thinkful/feediator/scripts
mongo ds131511.mlab.com:31511/feediator -u jvuser -p <dbpassword> test-data.js
mongo ds131511.mlab.com:31511/feediator -u jvuser -p <dbpassword> test-users.js

Configure Heroku

Go to heroku, select feediator
Settings

Add all configuration variables.

Test Heroku App

To run the app on Heroku:

https://feediator.herokuapp.com

Test CI is working

Change any file, git commit to master and verify Travis CI rebuilds the project.