Giter VIP home page Giter VIP logo

advocated's Introduction

/advocated

This is the IBM Watson Data platform developer advocacy reporting tool. It records events, presentations, blogs and expenditure that the team makes in a Cloudant database.

It consists of the following components:

  • a web front end hosted on Github pages - no servers required
  • a set of serverless actions that form an API, hosted on IBM Cloud Functions (OpenWhisk)
  • a Cloudant database

Deployment

You need to create two databases in your Cloudant service:

  1. to store the advocacy stats, say advocated
  2. to store the session tokens that allow users to be logged in, say tokens

Create these empty databases in the Cloudant dashboard.

Knowing the URL of your Cloudant service and the name of the database to use, set the following environment variables:

export COUCH_HOST="https://USER:[email protected]"
export COUCH_DATABASE="advocated"

Then run the deployment script to create the serverless actions.

./deploy.sh

You need your bx wsk tool to be installed and authenticated against the locale, org and space you wish to deploy to.

Make a note of the URL where your actions are served out as an API.

Configuration

The API of your serverless application is configured at the top of js/lib.js.

Web application

The contents of the gh-pages branch are served out automatically at https://ibm-watson-data-lab.github.io/advocated.

Logging in

You need to be invited to use this app. This involves creating a document in the tokens database of this form.

{
  "_id": "c8d4ecc06ca25f48bcb53391a4cd1a15",    <-- auto generated
  "teamid": "wdpdevadv",                        <-- constant
  "userid": "[email protected]",            <-- the email address of the user to invite
  "userDisplayName": "glynn.bird"               <-- the display name of the user to invite.
}

e.g cut-n-paste this bit below the auto-generated _id in the Cloudant dashboards

  "teamid": "wdpdevadv",                       
  "userid": "[email protected]",          
  "userDisplayName": "glynn.bird" 

Replication

To replicate just the blogs from the main database to a blogs database, you can create a document in the _replicator database like this:

{
  "_id": "blogs",
  "source": "https://USER@[email protected]/advocated",
  "target": "https://USER@[email protected]/blogs",
  "continuous": true,
  "filter": "report/bycollection",
  "query_params": {
    "collection": "blog"
  }
}

This initiates a continuous replication job from the advocated database to the blogs database, only including documents that belong to the blog collection.

advocated's People

Contributors

glynnbird avatar lornajane avatar

Watchers

James Cloos 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.