Giter Site home page Giter Site logo

seigenbrode / box-watson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibm-cloud/box-watson

0.0 2.0 0.0 1.73 MB

Sample app built to demonstrate how to integrate the Box API with Watson using Bluemix

Home Page: https://personality-box.mybluemix.net/

License: Apache License 2.0

JavaScript 80.80% CSS 7.97% HTML 11.23%

box-watson's Introduction

personality-box Overview

Build Status

Personality Box pulls the .txt files from your Box acount and allows you to analyze the unique personality traits of each file's author using the Watson Personality Insights API. For sample files, feel free to use either [President Obama's 2015 State of the Union Address] sotu_url or [Moby Dick - Chapter 1] moby_dick_url hosted in our Box account.

Deploy to Bluemix

Bluemix Deployments

Note: If deploying by this method, the app will fail on first deploy. After this initial failure, you must complete steps 9-12 as described in the section 'Running the app on Bluemix' below for your app to start successfully.

How it Works

  1. Sign up for a [Box account] box_signup_url if you do not have one already.

  2. Upload several txt files (we recommend each file contain a minimum of 3500 words) to the root folder of your account.

  3. Navigate to the app home page and select 'Sign in with Box' to log in with your Box account.

  4. Once your files load, select one to run its contents through the Personality Insights service and see the author's personality breakdown.

  5. To view a visualization of the full result set, select the 'Full Personality Graph' button beneath the Big 5 results.

Running the app on Bluemix

  1. If you do not already have a Bluemix account, sign up here

  2. Download and install the Cloud Foundry CLI

  3. Clone the app to your local environment from your terminal using the following command

git clone https://github.com/IBM-Bluemix/box-watson.git
  1. cd into this newly created directory

  2. Edit the manifest.yml file and change the <application-host> parameter to something unique.

applications:
- name: personality-box
  host: personality-box
  framework: node
  runtime: node12
  memory: 128M
  instances: 1

The host you use will determinate your application url (e.g. <application-host>.mybluemix.net)

  1. Connect to Bluemix using the CF CLI and follow the prompts to log in.
$ cf api https://api.ng.bluemix.net
$ cf login
  1. Create the Personality Insights service in Bluemix
$ cf create-service personality_insights tiered personality-insights-box
  1. Push your app to Bluemix. We need to perform additional steps once it is deployed, so we will add the option --no-start argument
$ cf push --no-start
  1. Next, you need to sign up for a Box developer account if you do not have one already

  2. Once you have created an account, select 'Create a Box Application' from the side panel. Name your app, select the Box Content API, and click 'Create Application'. On the next page you will find your API key and your app's client_id and client_secret, which you will need for the following step.

  3. Navigate to the Box service in the Bluemix Catalog. Select your recently created app to bind the service, name the service box, and fill out the API Key, Client ID, and Client Secret with the credentials you received in step 10.

  4. Finally, we need to restage our app to ensure these env variable changes took effect

$ cf restage APP_NAME

And voila! You now have your very own instance of Personality Box running on Bluemix.

Running the app locally

  1. If you do not already have a Bluemix account, sign up here

  2. If you have not already, download node.js and install it on your local machine.

  3. Clone the app to your local environment from your terminal using the following command

git clone https://github.com/IBM-Bluemix/box-watson.git
  1. cd into this newly created directory

  2. Install the required npm and bower packages using the following command

npm install
  1. Next, you need to sign up for a Box developer account if you do not have one already. You can do this here.

  2. Once you have created an account, select 'Create a Box Application' from the side panel. Name your app, select the Box Content API, and click 'Create Application'. On the next page you will find your API key and your app's client_id and client_secret, which you will need for the following step.

  3. Using the credentials you received in step 7, replace the default Box configs in vcap-local.json.

  4. Create a Personality Insights service using your Bluemix account and replace the default credentials in vcap-local.json.

  5. Start your app locally with the following command.

npm start

Your app will be automatically assigned to a port which will be logged to your terminal. To access the app, go to localhost:PORT in your browser. Happy developing!

Troubleshooting

To troubleshoot your Bluemix app the main useful source of information is the logs. To see them, run:

$ cf logs personality-box --recent

Privacy Notice

The Personality Box sample web application includes code to track deployments to Bluemix and other Cloud Foundry platforms. The following information is sent to a [Deployment Tracker] deploy_track_url service on each deployment:

  • Application Name (application_name)
  • Space ID (space_id)
  • Application Version (application_version)
  • Application URIs (application_uris)

This data is collected from the VCAP_APPLICATION environment variable in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.

Disabling Deployment Tracking

Deployment tracking can be disabled by removing require("cf-deployment-tracker-client").track(); from the beginning of the app.js main server file.

box-watson's People

Contributors

jsloyer avatar jakepeyser avatar germanattanasio avatar

Watchers

James Cloos avatar Shelbee Eigenbrode avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.