Skip to content

Commit 3b2ae00

Browse files
author
Predix Robot
committed
First commit
0 parents  commit 3b2ae00

31 files changed

+5449
-0
lines changed

.cfignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
test

.eslintrc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true
5+
},
6+
"extends": "eslint:recommended",
7+
"rules": {
8+
"indent": [
9+
"warn",
10+
"tab"
11+
],
12+
"linebreak-style": [
13+
"error",
14+
"unix"
15+
],
16+
"semi": [
17+
"error",
18+
"always"
19+
]
20+
}
21+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/*
2+
./manifest-vpc.yml

COPYRIGHT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The dependencies in this project are resolved by Maven pom.xml. Copyrights from those projects are included [here](http://predixdev.github.io/predix-rmd-ref-app/copyright.html). This list may be a superset of projects actually referenced by this project.

LICENSE.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
###GE Limited Availability (Beta) Software Development License Agreement
2+
3+
THIS SOFTWARE LICENSE AGREEMENT (the “License”) describes the rights granted by the General Electric Company, operating through GE Digital (also referred to as “GE Software”), located at 2623 Camino Ramon, San Ramon, CA 94583 (herein referred to as “Licensor”) to any entity (the “Licensee”) receiving a copy of any of the following GE Digital development materials: Predix DevBox; Predix Reference Application (“RefApp”); Predix Dashboard Seed; Predix Px, Predix Security Service redistributable .jar files; Predix Machine redistributable .jar files; and Predix Machine SDK . These materials may include scripts, compiled code, supporting components, and documentation and are collectively referred to as the “Licensed Programs”. Both Licensor and Licensee are referred to hereinafter as a “Party” and collectively as the “Parties” to this License
4+
5+
### Section 1 – Conditional Grant.
6+
No Licensee is required to accept this License for use of the Licensed Programs. In the absence of a signed license agreement between Licensor and Licensee specifying alternate terms, any use of the Licensed Programs by the Licensee shall be considered acceptance of these terms. The Licensed Programs are copyright and are licensed, not sold to you. If you are not willing to be bound by the terms of this License, do not install, copy or use the Licensed Programs. If you received this software from any source other than the Licensor, your access to the Licensed Programs is NOT permitted under this License, and you must delete the software and any copies from your systems.
7+
8+
###Section 2 – Warranty Disclaimer.
9+
NO WARRANTIES. LICENSOR AND OUR AFFILIATES, RESELLERS, DISTRIBUTORS, AND VENDORS, MAKE NO WARRANTIES, EXPRESS OR IMPLIED, GUARANTEES OR CONDITIONS WITH RESPECT TO USE OF THE LICENSED PROGRAMS. LICENSEE’S USE OF ALL SUCH PROGRAMS ARE AT LICENSEE’S AND CUSTOMERS’ OWN RISK. LICENSOR PROVIDES THE LICENSED PROGRAMS ON AN “AS IS” BASIS “WITH ALL FAULTS” AND “AS AVAILABLE.” LICENSOR DOES NOT GUARANTEE THE ACCURACY OR TIMELINESS OF INFORMATION AVAILABLE FROM, OR PROCESSED BY, THE LICENSED PROGRAMS. TO THE EXTENT PERMITTED UNDER LAW, LICENSOR EXCLUDES ANY IMPLIED WARRANTIES, INCLUDING FOR MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, AND NON-INFRINGEMENT. NO GUARANTEE OF UNINTERRUPTED, TIMELY, SECURE, OR ERROR-FREE OPERATION IS MADE.
10+
11+
THIS LICENSED PROGRAMS ARE PRE-PRODUCTION SOFTWARE AND ARE BELIEVED TO CONTAIN DEFECTS. A PRIMARY PURPOSE OF THIS LICENSE IS TO OBTAIN FEEDBACK ON SOFTWARE PERFORMANCE AND THE IDENTIFICATION OF DEFECTS. LICENSEE IS ADVISED TO SAFEGUARD IMPORTANT DATA, TO USE CAUTION, NOT TO RELY IN ANY WAY ON THE CORRECT FUNCTIONING OR PERFORMANCE THE SOFTWARE AND/OR ACCOMPANYING MATERIALS, AND NOT TO USE THE SOFTWARE IN A PRODUCTION ENVIRONMENT.
12+
13+
###Section 3 – Feedback.
14+
It is expressly understood, , acknowledged and agreed that you shall provide GE reasonable suggestions, comments and feedback regarding the Software, including but not limited to usability, bug reports and test results, with respect to Software testing (collectively, "Feedback"). If you provide such Feedback to GE, you shall grant GE the following worldwide, non-exclusive, perpetual, irrevocable, royalty free, fully paid up rights:
15+
16+
1. to make, use, copy, modify, sell, distribute, sub-license, and create derivative works of, the Feedback as part of any product, technology, service, specification or other documentation developed or offered by GE or any of its affiliates (individually and collectively, "GE Products");
17+
2. to publicly perform or display, import, broadcast, transmit, distribute, license, offer to sell, and sell, rent, lease or lend copies of the Feedback (and derivative works thereof) as part of any GE Product;
18+
3. solely with respect to Licensee's copyright and trade secret rights, to sublicense to third parties the foregoing rights, including the right to sublicense to further third parties; and
19+
4. to sublicense to third parties any claims of any patents owned or licensable by Licensee that are necessarily infringed by a third party product, technology or service that uses, interfaces, interoperates or communicates with the Feedback or portion thereof incorporated into a GE Product, technology or service. Further, you represent and warrant that your Feedback is not subject to any license terms that would purport to require GE to comply with any additional obligations with respect to any GE Products that incorporate any Feedback.
20+
21+
###Section 4 – Confidentiality.
22+
The Licensed Programs, including documentation, are proprietary. They shall be handled as the confidential information of GE Software, and shall be used by any receiving Party solely for any licensed uses of the Licensed Programs. Any receiving Party shall exercise the same degree of care with regard to the protection of the Licensed Programs as it uses in protecting and preserving its own confidential and proprietary information and shall restrict distribution of the Licensed Programs to only those employees, contractors, consultants, affiliates, and subsidiaries who are subject to an obligation to keep such information confidential.
23+
###THIS PRE-PRODUCTION RELEASE OF THE LICENSED PROGRAMS MAY NOT BE REDISTRIBUTED OR PUBLISHED IN WHOLE OR IN PART TO ANY THIRD PARTY OTHER THAN THE LICENSEE.
24+
You therefore agree not to transfer, copy, disclose, provide or otherwise make available such proprietary information in any form to any third party without the prior written consent of GE.
25+
26+
###Section 5 – Limitation of Liability.
27+
LIABILITY ARISING UNDER THIS LICENSE, WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), SHALL BE LIMITED TO DIRECT, OBJECTIVELY MEASURABLE DAMAGES. LICENSOR SHALL HAVE NO LIABILITY TO THE OTHER PARTY OR TO ANY THIRD PARTY, FOR ANY INCIDENTAL, PUNITIVE, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LIABILITY FOR ANY SOFTWARE LICENSED FROM THIRD PARTIES FOR USE WITH THE SERVICES IS EXPLICILTLY DISCLAIMED AND LIMITED TO THE MAXIMUM EXTENT PERMITTED BY LAW.
28+
29+
Notwithstanding anything to the contrary, the aggregate liability of Licensor and its suppliers under this License shall not exceed the total amounts paid by Licensee to Licensor hereunder during the one-year period immediately preceding the event which gave rise to the claims.
30+
31+
###Section 6 – License.
32+
33+
1. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants Licensee a worldwide, perpetual, royalty-free, non-exclusive license to:
34+
35+
1. install the Licensed Programs on Licensee’s premises, and permit Licensee’s users to use the Licensed Programs so installed, solely for Licensee’s own development, testing, demonstration, staging, and production of Licensee’s own software that makes use of the Licensed Programs in a way that adds substantial functionality not present in the Licensed Programs (the result, a “Licensee Application”);
36+
37+
2. permit Licensee to permit third-party hosts (“Hosts”) to install the Licensee Application on such Hosts’ respective premises on Licensee’s behalf, and permit Licensee’s users to access and use the Licensed Programs so installed, solely for Licensee’s own development, testing, demonstration, staging and production purposes
38+
39+
3. install the Licensee Application on Licensee’s own premises and permit its own users to use the Licensee Application so installed on the same terms as sub-sections (i) and (ii) above.
40+
41+
2. For the purposes of this License, the right to “use” the Licensed Programs shall include the right to utilize, run, access, store, copy, test or display the Licensed Programs. No right or license is granted or agreed to be granted to disassemble or decompile any Licensed Programs furnished in object code form, and Licensee agrees not to engage in any such conduct unless permitted by law. Reverse engineering of Licensed Programs provided in object code form is prohibited, unless such a right is explicitly granted by any explicit license subject to sub-section (d) below or as a matter of law, and then only to the extent explicitly permitted. Licensor shall have no obligation to support any such reverse engineering, any product or derivative of such reverse engineering, or any use of the Licensed Programs with any modified versions of any of their components under this License.
42+
43+
3. Licensee shall ensure that any Licensee Applications incorporate the Licensed Programs in such a way as to prevent third parties (other than Hosts) from viewing the code of the Licensed Programs or gaining access to any programmatic interface or other hidden aspect of the Licensed Programs.
44+
45+
4. Use of some open source and third party software applications or components included in or accessed through the Licensed Programs may be subject to other terms and conditions found in a separate license agreement, terms of use or “Notice” file located at the download page. The Licensed Programs are accompanied by additional software components solely to enable the Licensed Programs to operate as designed. Licensee is not permitted to use such additional software independently of the Licensed Programs unless Licensee secures a separate license for use from the named vendor. Do not use any third party code unless you agree with the applicable license terms for that code.
46+
47+
5. Title. Title to and ownership of the Licensed Programs shall at all times remain with Licensor.
48+
49+
###Section 7 – Termination.
50+
Your rights to this pre-production release of the Licensed Programs will terminate six months after the date you receive the Licensed Programs or any update, or two-months after the general availability of a production release of the Licensed Programs, whichever comes first. No rights to use the production release of the Licensed Programs are provided by this License. Notwithstanding the foregoing, either Party may terminate this License at any time for any reason or no reason by providing the other party written notice thereof. Upon any expiration or termination of this License, the rights and licenses granted to you under this License shall immediately terminate, and you shall immediately cease using and delete the Licensed Programs. Licensee Applications based upon the Licensed Programs (see Section 6(a) above) are not subject to this limitation. In the event of any expiration or termination of this Licensee, its Confidentiality provision, disclaimers of GE’s representations and warranties, and limitations of GE’s liability shall survive.
51+
52+
###Section 8 – Applicable Law.
53+
The License shall be governed by and interpreted in accordance with the substantive law of the State of California, U.S.A., excluding its conflicts of law provisions, and by the courts of that state.

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Predix Development Kit - NodeJs Starter Application
2+
==========================================================
3+
4+
This is simple starter Node application that demonstrates user authentication with Predix UAA,
5+
and integration with microservices.
6+
7+
## Running locally
8+
Edit the config.json to run the application locally for your UAA client.
9+
10+
Sample :
11+
```
12+
"development":{
13+
"clientId": "${clientId}",
14+
"uaaUri" : "${UAA URL}",
15+
"base64ClientCredential": "${base 64 encoding of clientId:secret}",
16+
"appUrl": "http://localhost:3000",
17+
"assetZoneId": "${asset zone id for Asset service instantiated}",
18+
"tagname": "${tag name list to query. Separated by comma}",
19+
"assetURL": "${The asset url to query the tags from. https://<assetURI>/<assetType>}",
20+
"timeseries_zone": "${timeseries zone id for Timeseries service instantiated}",
21+
"timeseriesURL": "${Timeseries to query for data. <TimeseriesURI>/v1/datapoints}",
22+
"uaaURL": "${The UAA URI. <UaaURI>/predix.io",
23+
}
24+
```
25+
*Note:* You can encode your clientId:secret combination using <https://www.base64encode.org/> or the base64 command on Unix / Mac OSX.
26+
27+
`echo -n clientId:clientSecret | base64`
28+
29+
#### Install and start local web server
30+
```
31+
npm install
32+
node app.js or npm start
33+
```
34+
Navigate to <http://localhost:3000> in your web browser.
35+
36+
Debugging
37+
```
38+
DEBUG=predix-boot-node-app:* npm start
39+
DEBUG=express:* npm start
40+
```
41+
42+
#### Run sample tests
43+
A sample unit test is included, which you can run with npm:
44+
`npm test`
45+
46+
#### Running locally behind a corporate firewall
47+
48+
If you are behind a corporate firewall, make sure you have the `http_proxy` environment variable set in the same terminal window where you start the server.
49+
50+
## Running in the cloud
51+
52+
Set up the manifest file for Cloud deployment
53+
54+
1. Copy manifest.yml.template to my-app-manifest.yml.
55+
2. Edit the my-app-manifest.yml
56+
```
57+
---
58+
applications:
59+
- name: <front end app name>
60+
memory: 128M
61+
buildpack: nodejs_buildpack
62+
#command: DEBUG=express:* node app.js
63+
command: node app.js
64+
services:
65+
- <asset instance service name>
66+
- <timeseries instance service name>
67+
- <uaa instance service name>
68+
env:
69+
node_env: cloud
70+
uaa_service_label : predix-uaa
71+
clientId: <client id with timeseries and asset scope>
72+
base64ClientCredential: <base64 encoding of client id>
73+
# Following properties configured only for Timeseries WindData service Integration
74+
assetMachine: <The asset name pushed to Asset service>
75+
tagname: <The asset tag pushed to Asset service>
76+
```
77+
78+
`cf push <appName> -f my-app-manifest.yml`
79+
80+
[![Analytics](https://ga-beacon.appspot.com/UA-82773213-1/predix-nodejs-starter/readme?pixel)](https://github.com/PredixDev)

manifest.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
applications:
3+
- name: predix-nodejs-starter
4+
memory: 128M
5+
buildpack: nodejs_buildpack
6+
#command: DEBUG=express:* node app.js
7+
command: node server/app.js
8+
#services:
9+
# - <your-name>-secure-uaa-instance
10+
# - <your-name>-timeseries-instance
11+
# - <your-name>-asset-instance
12+
env:
13+
node_env: cloud
14+
uaa_service_label : predix-uaa
15+
#clientId: {Enter client ID, e.g. app_client_id, and place it here}
16+
#base64ClientCredential: dWFhLWNsaWVudC1pZDp1YWEtY2xpZW50LWlkLXNlY3JldA==
17+
# Following properties configured only for Timeseries WindData service Integration
18+
#windServiceURL: "{URL of the microservice <your-name>-winddata-timeseries-service}, e.g. https://your-name-winddata-timeseries-service.run.asw-usw02-pr.predix.io"
19+
#assetMachine: my-type

manifest.yml.template

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
applications:
3+
- name: <your-name>-predix-nodejs-starter Change
4+
memory: 128M
5+
buildpack: nodejs_buildpack
6+
#command: DEBUG=express:* node app.js
7+
command: node app.js
8+
#services:
9+
# - <your-name>-secure-uaa-instance
10+
# - <your-name>-timeseries-instance
11+
# - <your-name>-asset-instance
12+
env:
13+
node_env: cloud
14+
uaa_service_label : predix-uaa
15+
#clientId: {Enter client ID, e.g. app_client_id, and place it here}
16+
#base64ClientCredential: {Get clientID:clientSecret then base64 encode and place it here}
17+
# Following properties configured only for Timeseries WindData service Integration
18+
#windServiceUrl: "{URL of the microservice <your-name>-winddata-timeseries-service}, e.g. https://your-name-winddata-timeseries-service.run.asw-usw02-pr.predix.io"

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "predix-nodejs-starter",
3+
"version": "1.0.3",
4+
"private": true,
5+
"scripts": {
6+
"start": "node server/app.js",
7+
"test": "mocha",
8+
"preversion": "npm test",
9+
"version": "git add package.json && git commit -m \"version bump\"",
10+
"postversion": "git push"
11+
},
12+
"dependencies": {
13+
"body-parser": "~1.13.2",
14+
"chart.js": "^1.0.2",
15+
"cookie-parser": "~1.3.5",
16+
"debug": "~2.2.0",
17+
"express": "~4.13.1",
18+
"express-http-proxy": "^0.6.0",
19+
"express-session": "^1.12.1",
20+
"http-proxy-middleware": "^0.9.1",
21+
"https-proxy-agent": "^1.0.0",
22+
"passport": ">= 0.0.0",
23+
"passport-oauth2-middleware": "*",
24+
"passport-predix-oauth": "https://github.build.ge.com/adoption/passport-predix-oauth.git#master",
25+
"request": "~2.67.0",
26+
"url": "~0.11.0"
27+
},
28+
"author": "swapnavad,gstroup",
29+
"devDependencies": {
30+
"chai": "^3.5.0",
31+
"mocha": "^2.5.3"
32+
}
33+
}

public/images/monogram-wdmk.png

5.52 KB
Loading

public/images/predix_logo.svg

Lines changed: 27 additions & 0 deletions
Loading

public/images/wind-turbine-2.png

57.8 KB
Loading

0 commit comments

Comments
 (0)