Sentiment analysis and visualization on all things election
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.bluemix use npm instead of git submodules for easier installation Sep 4, 2015
client use stateless functions for "dumb" components instead of classes Jun 14, 2016
public use webpack instead of gulp, update all other dependencies that need … Jun 10, 2016
server update comment on newsscraper to reflect recent changes Jun 14, 2016
webpack use webpack instead of gulp, update all other dependencies that need … Jun 10, 2016
.cfignore initial commit Aug 11, 2015
.gitignore updates to server code: use es6 syntax when applicable. use cfenv ins… Jun 13, 2016
LICENSE initial commit Aug 11, 2015
NOTICE updates to server code: use es6 syntax when applicable. use cfenv ins… Jun 13, 2016
manifest.yml move to personal mongolab account Nov 11, 2015

Election Insights

Currently hosted here

The Election Insights app uses Alchemy News API to display a bubble map of what's being talked about in real time and how people feel about them. The app uses Alchemy's taxonmy breakdown to focus specifically on the election, and uses Alchemy's entity breakdown and sentiment analaysis to display the data visually.

The size of the bubbles are dictated by how much they're being discussed and the color is dictated by the average sentiment around that entity.


Deploy to Bluemix


Create a Bluemix, and register for an Alchemy API Key.

Create a MongoLab account, and create your database

Once you have a MongoLab account and a database and run the command

cf cups mongolab_ei_jk -p '{"uri": "mongodb://username:password@yourdatabase/port/db_name"}'

(You can name your service whatever you want but you'll need to update the manifest file)

You can find out the link of your database by clicking on the "Tools" menu. On the top of the page you'll see something like.


There are two ways to deploy this to Bluemix:

Option 1: Click the button below:

Now all you gots to do is click this button!

Deploy to Bluemix

This will set up a build pipeline - every time you push to the jazzhub repo this will create, it will automatically trigger a build and deploy.

After the initial deploy is done, you'll need to go to your dashboard, go to the space that you choose for this application, go to the application itself,

Option 2: The manual route:

In Bluemix:

  1. Create a Node.js runtime
  2. Bind a Mongolabs service instance with the "sandbox" plan
  3. Bind Alchemy with your API key

Once this is set up add these to your manifest.yml:

host: newsinsights
name: newsinsights


npm install
npm run build
cf push "electioninsights"

(or whatever you named your app), and you'll be all set.

Running the app locally

All you need to do is:

npm install
npm run build
npm start

There's also a helper npm dev that kicks off the server and runs gulp dev which handles watchify and re-compiling less->css when files change.

Make server/VCAP_SERVICES.json that is the same structure as VCAP_SERVICES is on Bluemix. For example:

  "user-provided": [{
    "name": "AlchemyAPI-2e",
    "label": "user-provided",
    "credentials": {
      "apikey": "your-key-goes-here"
  "mongolab": [{
    "name": "MongoLab-bh",
    "label": "mongolab",
    "plan": "sandbox",
    "credentials": {
      "uri": "mongodb://yourmongouri"

Using IBM DevOps

Note: if you used the "Deploy to Bluemix" button, this will all be set up for you.

I like to use IBM DevOps to automatically build and deploy my code whenever I push to git. Your build stage should look like:

npm install
npm run build

And your deploy should look like:

cf push "${CF_APP}"

# view logs
#cf logs "${CF_APP}" --recent


Feel free to fork this repo and open a Pull Request or open an issue!


This app is licensed under the Apache 2.0 License. Full license text is available in LICENSE.

Contact Me

All of my contact information can be found here