Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

enableiot/iotanalytics-dashboard

Repository files navigation

PROJECT NOT UNDER ACTIVE MANAGEMENT

This project will no longer be maintained by Intel.

Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.

Intel no longer accepts patches to this project.

If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project.

Contact: webadmin@linux.intel.com

IoT Analytics Dashboard

Built with Grunt

public-interface

UI and API repo. This repo will contain content external accessible.

Pre-requirements

Configuring NGINX

Execute the following:

cd ./dashboard/public-interface/nginx
./install.sh

This script overwrites /nginx/default.conf by /etc/nginx/conf.d/default.conf to activate configuration. Then it creates sym link from /dashboard/public-interface/dashboard/public to /opt/dashboard/iotkit-dashboard/dashboard/public to make NGINX serves static resources as CDN. Finally it will restart nginx and make some curls for testing that everything is ok.

When using NGINX to access UI or API instead of using por 4001 you should port 80.

Troubleshooting
  • If nginx is not working properly (not taking our configuration) empty the folder:
    • /etc/nginx/sites-enabled/

Tests

We are using grunt in order to perform build activities, such static code analysis validation, running unit tests, packaging, etc.

Unit tests

For running unit tests you can:

    cd ./dashboard/public-interface
    NODE_ENV=local grunt

Localization

All UI labels are defined in file - public-interface/dashboard/public/locale/resourceBundle.json. You can edit resourceBoundle.json in order to modify some UI labels.

Requirements to run

  1. Generate a pair RSA keys and put your private and public keys in public-interface/keys/ as private.pem and public.pem

  2. Register your domain in Google ReCaptcha at http://www.google.com/recaptcha and set generated values in cloud foundry user-provided service:

     cf cups recaptcha-ups -p "{\"siteKey\":\"${SITE_KEY}\",\"secretKey\":\"${SECRET_KEY}\"}"
    

On Trusted Analytics Platform (https://github.com/trustedanalytics)

Before installation, make sure that you are logged into Trusted Analytics Platform with command:

cf login
  1. Create instances with specified name for each of required services from marketplace:

    • PostgreSQL 9.3 or newer with name mypostgres
    • Redis 2.8 or newer with name myredis
    • Smtp service with name mysmtp
  2. Create following user-provided services with properties filled with real values:

     cf cups dashboard-endpoint-ups -p "{\"host\":\"${ADDRESS}\"}"
     cf cups backend-ups -p "{\"host\":\"${ADDRESS}\"}"
     cf cups websocket-ups -p "{\"username\":\"${USER}\",\"password\":\"${PASSWORD}\"}"
     cf cups rule-engine-credentials-ups -p "{\"username\":\"${USER}\",\"password\":\"${PASSWORD}\"}"
     cf cups mail-ups -p "{\"sender\":\"${SENDER}\"}"
     cf cups recaptcha-ups -p "{\"siteKey\":\"${SITE_KEY}\",\"secretKey\":\"${SECRET_KEY}\"}"
     cf cups dashboard-security-ups -p "{\"private_pem_path\":${PRIVATE_PEM_PATH},\"public_pem_path\":${PUBLIC_PEM_PATH},\"captcha_test_code\":${CAPTCHA_TEST_CODE},\"interaction_token_permision_key\":${INTERACTION_TOKEN_PERMISSION_KEY}}"
     cf cups gateway-credentials-ups -p "{\"username\":\"${USER}\",\"password\":\"${PASSWORD}\"}"
    
  3. Executing ./cf-deploy.sh in main repository catalog builds package and pushes it to CF as an app with name {SPACE}-dashboard where space is currently selected space by cf t -s "SPACE"

  4. Check logs and wait for application start.