version: 3.4
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.
- Docker - Containerization Platform - Version 19.03 (or higher)
- Node - JavaScript Runtime Environment
- Aurelia - JavaScript Web Application Framework
- A running instance of the CodeHub API (and therefore ElasticSearch)
- A running instance of the Constant Contact API
- A running instance of Codehub UI Image Server
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.
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:
- 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. - 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. - Run the
./build-and-run-docker.sh
script present in the top level of this repository.
Unit tests are run via the aurelia-cli and use karma and jasmine as test-runners.
au test
au test --watch
Integration tests are performed with Protractor.
- Place your E2E-Tests into the folder
test/e2e/src
- Install the necessary webdriver.
gulp webdriver-update
-
Configure the path to the webdriver by opening the file
protractor.conf.js
and adjusting theseleniumServerJar
property. Typically its only needed to adjust the version number. -
Make sure your app runs and is accessible
au run
- In another console run the E2E-Tests
au protractor
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.
See CHANGELOG.md file.
This project is licensed under the Apache 2.0 License, see LICENSE.
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.
Digital Object Identifier: