# frontend-masters-registry
React-based frontend for OA pages managing our new masters registry

### Setup

Load the development version of node

```bash
nvm use
```

```bash
cp .env.shadow .env
```

Edit the .env file to set the following variables. Run the queries on QA art_relations.
* GRASS_TOKEN: set this to the token returned by https://oa.qaorch.com/grasssession.
* USER_ID: set to value returned by: ```select id from art_relations.orchadmin_users where login='<your username>';```
* CLIENT_ID: set to value returned by: ```select client_id from art_relations.vectorapi_access_tokens where user_id=<USER_ID> and user_type='oa';```
* VAPI_ACCESS_TOKEN: set to value returned by: ```select oauth_token from art_relations.vectorapi_access_tokens where user_id=<USER_ID> and user_type='oa';```

```bash
yarn install # install package.json dependencies
yarn start # start dev server
```

### Development

#### Tasks

* `yarn start` runs local development server at localhost:8080
* `yarn test` to run the linter and unit tests
* `yarn lint` to run only the linter
* `yarn test:unit` to run only the unit tests
* `yarn watch` to run unit tests every time a change is saved
* `yarn bundle` bundles all application js into build/bundle.js

Note: to see all available tasks, run `npm run`.

#### Adding a new dependency

yarn add package-name

https://yarnpkg.com/en/docs/cli/add#toc-adding-dependencies

