Skip to content

NCI-GDC/portal-ui

Repository files navigation

pre-commit


GDC Data Portal

#react #relay #redux #recompose #flow #jest #d3

Build Status

Technologies

  • React - JavaScript library for building user interfaces
  • Relay - JavaScript framework for building data-driven React applications
  • Redux - Predictable state container for JavaScript apps
  • Recompose - React utility belt for function components and higher-order components
  • Flow - Static type checker for JavaScript
  • Jest - Delightful JavaScript testing
  • d3 - Data-Driven Documents
  * [Technologies](#technologies)
  * [Installation](#installation)
  * [Tests](#tests)
  * [Development](#development)
  * [Setup pre-commit hook to check for secrets](#setup-pre-commit-hook-to-check-for-secrets)
  * [Contributing](#contributing)

Installation

Install Watchman

brew update
brew install watchman

We recommend using Node v8 (npm v5).

npm i

Tests

npm test

Development

By default the portal will attempt to connect to an api instance running on localhost:5000, however this can changed by setting the environment variable REACT_APP_API, or by setting localStorage.REACT_APP_API in the browser.

# start ui connected to localhost:5000 api server
npm start

# start ui connected to UChicago api server
REACT_APP_API=https://api.gdc.cancer.gov/v0/ npm start

// change api url during runtime in browser
localStorage.REACT_APP_API = 'https://api.gdc.cancer.gov/v0/'

Setup pre-commit hook to check for secrets

We use pre-commit to setup pre-commit hooks for this repo. We use detect-secrets to search for secrets being committed into the repo.

To install the pre-commit hook, run

pre-commit install

To update the .secrets.baseline file run

detect-secrets scan --update .secrets.baseline

.secrets.baseline contains all the string that were caught by detect-secrets but are not stored in plain text. Audit the baseline to view the secrets .

detect-secrets audit .secrets.baseline

Contributing

Read how to contribute here