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.
prerequisite: create a Bluemix, and register for an Alchemy API Key.
There are two ways to deploy this 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,
In Bluemix:
- Create a Node.js runtime
- Bind a Mongolabs service instance with the "sandbox" plan
- Bind Alchemy with your API key
Once this is set up add these to your manifest.yml:
host: newsinsights
name: newsinsights
Then:
npm install
npm run build
cf push "electioninsights"
(or whatever you named your app), and you'll be all set.
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/config.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"
}
}]
}
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:
#!/bin/bash
npm install
npm run build
And your deploy should look like:
#!/bin/bash
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.
All of my contact information can be found here