Skip to content

SciKnowEngine/digapp-ht

 
 

Repository files navigation

digapp-ht

Web application for searching and exploring entity graphs in Elasticsearch indices.

Overview

This web application is built primarily with Web Components using the Polymer library. The technology stack also includes Node.js, Express.js, Gulp.js, Elastic Search Client, Elastic.js and many other Bower and NPM javascript modules. The public web components used in this application and others are located in DigElements.

Prerequisites

  • node.js - download and install node.js
  • gulp.js - npm i -g gulp
  • bower.js - npm i -g bower
  • polyserve - npm i -g polyserve
  • web component tester - npm i -g web-component-tester
  • elastic search server with ht data index. See elastic.co

Installation

  • clone this repo
  •   cd digapp-ht && npm install && bower install

Getting started

  • create digapp-ht/server/config/local.env.js with contents that look like:

    'use strict';
    
    // Use local.env.js for environment variables that gulp will set when 
    // the server starts locally.
    // Use for your api keys, secrets, etc. This file should not be tracked by git.
    //
    // You will need to set these on the server you deploy to.
    
    module.exports = {
        ELASTIC_CONFIG:'{"host":"http://vinisvr:9200"}',
        ELASTIC_INDEX:'dhtcat1op',
        ANNOTATION_INDEX: 'dig-annotations',
        ANNOTATION_TYPE: 'annotation'
    };

Development workflow

Serve / watch

gulp serve

This outputs an IP address you can use to locally test and another that can be used on devices connected to your network.

Run tests

To successfully run unit tests, you must have a copy of sample data for the elastic search index that this application will use. These are kept in dig-data

gulp test:local

This runs the unit tests defined in the app/test directory through web-component-tester.

Build & Vulcanize

First update the version in package.json. Then run:

gulp

Build and optimize the current project, ready for deployment. This includes vulcanization, image, script, stylesheet and HTML optimization and minification. The version from package.json will also be available in the user settings dropdown menu (the gear icon in the upper-right corner of each page).

Unit Testing

The client code uses Web Component Tester

Read more about using Web Component tester.

Contributing

Pull requests are welcome. Please fork this repo, then create a topic branch on your forked copy. Ensure that all unit tests are working before and after making modifications on your topic branch. Add necessary unit tests to accompany your feature or bug fix, and then submit a pull request with upstream branch set to the default (master) branch, and downstream branch set to your topic branch on your forked repo.

Deployment

First update the version in package.json. Then run:

gulp docker

This will build & vulcanize the application, build the docker container (using the version from package.json), and push it to docker hub.

License

Apache 2.0

About

Copy of dig-polymer for new data set

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 90.3%
  • JavaScript 7.8%
  • Perl 1.4%
  • Other 0.5%