GithubHelp home page GithubHelp logo

decodedco / predix-seed-xlp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from predixdev/predix-seed

0.0 4.0 1.0 48.52 MB

Dashboard Seed is an application that uses Px Web Components and Px UI Elements inside an Angular application.

License: Other

JavaScript 12.83% HTML 81.65% CSS 5.52%

predix-seed-xlp's Introduction

Predix Experience 2.0 Seed

Dashboard Seed is an application that uses Px Web Components inside a Polymer web application. It runs on the Express web server.

Getting Started

Get the source code

Make a directory for your project. Clone or download and extract the seed in that directory.

git clone https://github.com/PredixDev/predix-seed.git

Install tools

If you don't have them already, you'll need node, bower and gulp to be installed globally on your machine.

  1. Install node. This includes npm - the node package manager.
  2. Install bower globally npm install bower -g
  3. Install gulp globally npm install gulp -g

Install the dependencies

Change directory into the new project you just cloned, then install dependencies.

npm install
bower install

Running the app locally

The default gulp task will start a local web server. Just run this command:

gulp

Browse to http://localhost:5000. Initially, the app will use mock data for the views service, asset service, and time series service. Later you can connect your app to real instances of these services.

Running in Predix Cloud

With a few commands you can build a distribution version of the app, and deploy it to the cloud.

Create a dist version

Use gulp to create a distribution version of your app. You will need to run this command during development every time before you cf push to make the latest dist.

gulp compile:all

Deploy to the cloud

First make sure you're logged in to the Predix Cloud using the cf login command. Then deploy your app using this command:

cf push my-seed-app

You can give the app any unique name you like. "my-seed-app" is just an example.

UAA

1. Setup UAA service

  1. cf create-service predix-uaa Tiered xlpuser04-uaa -c '{"adminClientSecret":"clientsecret"}'
  2. Add xlpuser-04-uaa to manifest.yml
  3. cf push
  4. cf env xlp-polymer to extract

2. Add client for UAA

  1. uaac target <uaa-URI>
  2. uaac token client get admin
  3. uaac client add xlpuser04-uaa-client -i:
  4. scope: openid uaa.none
  5. authorized grant types: password client_credentials authorization_code
  6. authorities: uaa.resource openid uaa.none
  7. echo -n xlpuser04-uaa-client:clientsecret | base64 - save in manifest.yml under base64ClientCredential
  8. Update clientId in manifest.yml

3. Add users to app

  1. uaac user add <my-user> --emails <my_user>@domain.com --password <my_password>
  2. uaac group add uaa.user
  3. uaac member add uaa.user user

Predix Time series

1. Create Service

  1. cf env xlp-polymer - grab issuer id from uaa
  2. cf create-service predix-timeseries Tiered xlpuser04-timeseries -c '{"trustedIssuerIds":["https://xxx.run.aws-usw02-pr.ice.predix.io/oauth/token"]}'
  3. Update manifest.yml with timeseries instance, cf push

2. Config Service

  1. cf env xlp-polymer - grab zone id
  2. uaac client update xlpuser04-uaa-client -i add
  3. authorities: timeseries.zones.<zone-id>.user timeseries.zones.<zone-id>.query timeseries.zones.<zone-id>.ingest
  4. scope: timeseries.zones.<zone-id>.user timeseries.zones.<zone-id>.query timeseries.zones.<zone-id>.ingest

3. Use Timeseries

  1. Simply access /predix-api/predix-timeseries/v1/tags..
  2. To test with curl, copy the cookie_name from your browser and curl --cookie "cookie_name=xxxx" http://localhost:5000/predix-api/predix-timeseries/v1/tags

Predix Machine

On the Pis, update the following:

  1. ~/PredixMachine/configuration/machine/com.ge.dspmicro.predixcloud.identity.config with UAA details
  2. com.ge.dspmicro.websocketriver.send-0.config with Zone ID for TS
  3. com.ge.dspmicro.hoover.spillway-0.config updated com.ge.dspmicro.hoover.spillway.destination="WS Sender Service"

Questions?

Copyright

Copyright © 2015 GE Global Research. All rights reserved.

The copyright to the computer software herein is the property of GE Global Research. The software may be used and/or copied only with the written permission of GE Global Research or in accordance with the terms and conditions stipulated in the agreement/contract under which the software has been supplied.

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.