Giter VIP home page Giter VIP logo

ibm-cloud / nodejs-data-lake-dashboard Goto Github PK

View Code? Open in Web Editor NEW
5.0 12.0 10.0 509 KB

Sample and tutorial that creates interactive dashboards using: Dynamic Dashboard Embedded, Cloud Object Storage, SQL Query, DB2 Warehouse and AppID.

Home Page: https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-smart-data-lake

License: Apache License 2.0

JavaScript 30.23% HTML 15.07% TypeScript 54.26% CSS 0.44%
ibm-cloud db2 data-lake db2-warehouse cloud tutorial ibm-cloud-solutions

nodejs-data-lake-dashboard's Introduction

Note: This code is no longer maintained, but kept as reference.

Data Lake Dashboard

Sample and tutorial that creates interactive dashboards using: Cognos Dashboard Embedded (formerly Dynamic Dashboard Embedded), Cloud Object Storage, SQL Query, DB2 Warehouse and AppID. Not all services are required, see tutorials for possible use cases and guidance.

Application

The solution works out of the box when following the Build a data lake using object storage tutorial. For customization, see the below notes.

Helpful starting points

  • Supports either Cloud Object Storage or DB2 Warehouse on Cloud
  • Dynamically reads CSV files and builds Cognos Dashboard Embedded datasources
  • Server-side encryption support for Cognos Dashboard Embedded datasources
  • Scope DB2 table data to specific users with App ID

Running the solution

This solution uses an Angular web client and server to provide APIs and host the web app. Before hosting in production, you must build the Angular web client.

Command Usage
npm start Runs server (requires pre-built web client)
npm run prod Builds web client and runs server
npm run dev Runs web client and server in dev (reload) mode
npm run push Builds web client and pushes to IBM Cloud

Server-side

The solution uses Express to deliver IBM Cloud services. Services are auto-discovered using cfenv, which requires the appropriate service bindings to exist in production or a local vcap-services.json file during development.

Service Name Middleware Usage
AppID dashboard-nodejs-appid server-appid.js Provides authentication support for web client; use npm install ibmcloud-appid -S to add App ID as a dependency
Cloud Object Storage dashboard-nodejs-cos server-cos.js Provides Cognos compatible datasources
DB2 Warehouse on Cloud dashboard-nodejs-db2 server-db2.js Provides Cognos compatible datasources (with encryption)
Cognos Dashboard Embedded dashboard-nodejs-dde server-dde.js Provides Cognos sessions for web client

Ensure that the manifest.yml file contains entries for corresponding services. By default, the solution is configured with Object Storage.

services:
  - dashboard-nodejs-dde
  - dashboard-nodejs-cos

To use DB2, make the following change.

services:
  - dashboard-nodejs-dde
  - dashboard-nodejs-db2

Client-side

The client is an Angular web client that automatically sets up a Cognos Dashboard Embedded (formerly DDE) session. Data for DDE can come from either IBM Cloud Object Storage or DB2 Warehouse on Cloud. Two DDEAdapter adapters exist to support these two backends, which will be loaded depending on whether the respective service is available on the server. Similarly, a Login button will load when the AppID service is available.

After a user has authored a dashboard, the dashboard can be saved and restored from browser storage.

Local development

During development use the dev script. This will launch ng serve and nodemon to automatically restart the app when changes occur.

  1. Copy the VCAP_SERVICES to the local sample application.
  • In the browser, go to https://cloud.ibm.com/resources and select the deployed dashboard-nodejs application. Click Runtime -> Environment variables. Alternatively, use the command ibmcloud cf env dashboard-nodejs to view environment variables.
  • Copy the VCAP_SERVICES to the clipboard using the copy button.
  • Paste the VCAP_SERVICES content to the sample applications vcap-services.json file overwriting existing content and save.
  1. Run npm run dev.
  2. Browse to http://localhost:4200. If Express is not listening on http://localhost:6008, update the properties in /src/environments/environment.ts.

The Cognos Dashboard Embedded service connects directly to CSV or JDBC datasources via a public URLs. To support access during local development, you should use a tool like ngrok to open a tunnel to the Express server. The sourceUrl property should be updated to reflect the ngrok URL in /src/environments/environment.ts.

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

nodejs-data-lake-dashboard's People

Contributors

data-henrik avatar l2fprod avatar van-ibm avatar vidyasagarmsc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodejs-data-lake-dashboard's Issues

npm run push fails

image
I Ran npm install from nodejs-data-lake-dashboard and got a few dependency warnings for angular and nguniversal.
npm run pus fails job name .."..getProjectMetadata" does not exist

Specified bucket does not exist

When click on select datasources, the modal is showing the available buckets. However, when select any of the bucket on the list, it is saying bucket does not exist.

image

websocket-driver 0.7.2 not found

While running npm install getting issue that the version 0.7.2. not found.

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.2.tgz
npm ERR! 404
npm ERR! 404  '[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'nodejs-data-lake-dashboard'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

This should be changed to 0.7.3. Mine worked after explicitly downloading the 0.7.3 version.
nodejs-data-lake-dashboard/package-lock.json need to be changed.

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.