Skip to content

mary-vandyke/codehub-ui

 
 

Repository files navigation

Build Status Quality Gate Status

codehub-ui

version: 3.4

Project Description

This repository holds the frontend user-interface (UI) code for the United States Department of Transportation (U.S. DOT) Joint Program Office (JPO) Intelligent Transit Systems (ITS) CodeHub website located at https://its.dot.gov/code.

Prerequisites

Usage

The CodeHub UI is a Dockerized application. While it is possible to run this application natively, we strongly recommend that you use Docker to abstract away the complications of Node version management and package installation.

Installing

The UI requires a running CodeHub API instance to which it can connect. See the codehub-api repository for instructions.

After you have the CodeHub Web API and Constant Contact API running, you may run the CodeHub UI in Docker using the following steps:

  1. Set the PROXY_PASS_WEBAPI environment variable to the following: proxy_pass "PROTOCOL://URL:PORT"; where the protocol is http or https, URL is the location of your CodeHub Web API, and port is the port it is running on.
  2. Set the PROXY_PASS_APICC environment variable to the following: proxy_pass "PROTOCOL://URL:PORT"; where the protocol is http or https, URL is the location of your Constant Contact API, and port is the port it is running on.
  3. Run the ./build-and-run-docker.sh script present in the top level of this repository.

Testing

Running Unit Tests

Unit tests are run via the aurelia-cli and use karma and jasmine as test-runners.

To execute the unit tests, execute the following command:

au test

To execute the unit in a Test Driven Development (TDD) mode:

au test --watch

Running Integration Tests

Integration tests are performed with Protractor.

  1. Place your E2E-Tests into the folder test/e2e/src
  2. Install the necessary webdriver.
gulp webdriver-update
  1. Configure the path to the webdriver by opening the file protractor.conf.js and adjusting the seleniumServerJar property. Typically its only needed to adjust the version number.

  2. Make sure your app runs and is accessible

au run
  1. In another console run the E2E-Tests
au protractor

Execution

Deployment of the UI is similar to running in Docker locally, you must set the two proxy pass environment variables.

Important: if the CodeHub Web API or the Constant Contact API are running behind load balancers, you will need to set their proxy pass environment variables using the nginx resolver directive, as follows:

export PROXY_PASS_WEBAPI='resolver 10.0.0.2 valid=10s; set $backend "http://example-loadbalancer.amazonaws.com:3000"; proxy_pass $backend;'
export PROXY_PASS_APICC='resolver 10.0.0.2 valid=10s; set $backend "http://example-loadbalancer.amazonaws.com:3000"; proxy_pass $backend;'

Where 10.0.0.2 is the location of your network's domain name server (10.0.0.2 is the default for an AWS VPC with the default 10.0.0.0/16 CIDR), and the example-loadbalancer is the URL and port of your API's load balancer.

Run "npm start serve" at your root codehub-ui repo.

Version History and Retention

See CHANGELOG.md file.

License

This project is licensed under the Apache 2.0 License, see LICENSE.

Contribution

Please read CONTRIBUTING.md for details on our Code of Conduct, the process for submitting pull requests to us, and how contributions will be released.

Contact Information

Acknowledgements

Digital Object Identifier:

Releases

No releases published

Packages

No packages published

Languages

  • CSS 52.4%
  • JavaScript 20.6%
  • HTML 16.5%
  • Less 5.4%
  • SCSS 5.1%
  • Shell 0.0%