Skip to content

umccr/data-portal-client

Repository files navigation

UMCCR Data Portal App

React frontend for UMCCR Data Portal API

Deployment

  • See build specification buildspec.yml reference for AWS CodeBuild

GitOps

NOTE: Here, we use GitOps and, release to deployment environments are all tracked by long-running Git branches as follows.

  • The default branch is dev. Any merges are CI/CD to DEV account environment.
  • The staging branch is stg. Any merges are CI/CD to STG account environment.
  • The main branch is production. Any merges are CI/CD to PROD account environment.

Git Flow

  • Typically, make your feature branch out from dev to work on your story point. Then please submit PR to dev.

  • Upon finalising release, create PR using GitHub UI from dev to stg or; from stg to main accordingly.

  • Merge to stg should be fast-forward merge from dev to maintain sync and linearity as follows:

git checkout stg
git merge --ff-only dev
git push origin stg
  • Merge to main should be fast-forward merge from stg to maintain sync and linearity as follows:
git checkout main
git merge --ff-only stg
git push origin main

Local Development

TL;DR

node -v
v20.16.0

npm i -g yarn

(NOTE: yarn should auto resolve to local version from `.yarn` that configure in `package.json` > `packageManager`)
yarn -v
4.4.0

yarn install

aws sso login --profile dev
export AWS_PROFILE=dev
yarn start
(CTRL+C to stop the dev server)

Htsget

See htsget/README for local dev htsget server setup

Code Formatting

  • Run prettier: yarn prettier
  • Fix prettier: yarn prettier-fix

Lint

  • Run eslint: yarn lint
  • See eslint help: yarn lint --help

Audit

  • Run yarn audit for package security vulnerabilities
  • Recommend fixing/updating any package with direct dependencies
  • If vulnerabilities found in transitive dependency, but it has yet to resolve, then list them in package.json > resolutions node as Selective Dependency Resolutions condition explained here.

Pre-commit Hook

NOTE: We use pre-commit. It will guard and enforce static code analysis such as lint and any security audit via pre-commit hook. You are encouraged to fix those. If you wish to skip this for good reason, you can by-pass Git pre-commit hooks by using git commit --no-verify flag.

git config --unset core.hooksPath
pre-commit install
pre-commit run --all-files

IDE

  • Recommended to use JetBrains WebStorm IDE
  • Code style use indent with 2 spaces, no tab
  • For Visual Studio Code, the following extensions are recommended