# frontend-catalog

## Workstation SPA
`frontend-catalog` is part of the workstation single page application. Read up on the framework and tooling by visiting the [frontend-workstation](https://github.com/theorchard/frontend-workstation) repo.

## Setup / Installing
Make sure your environment is up to date:
- node >= `24`
- pnpm >= `9`


Make sure you have configured the private npm registry used by `workstation-cli`. **Read the documentation on how to configure it.**
https://github.com/theorchard/frontend-workstation/blob/master/docs/cli.md


Initialize environment configuration:

```shell
cp .env.shadow .env
```

Install dependencies

```shell
pnpm install
```

## Running

_**Note**: You will need to be on the VPN (or in the NYC office) to be able to access Orchard services._

Run the local development server:

```shell
pnpm start
```

## Local development, auth and feature flags
Local-dev setup, auth and feature-flag testing are documented in the workstation shell: [frontend-workstation / Local development](https://github.com/theorchard/frontend-workstation/blob/master/docs/local-development.md).

The old `GRASS_TOKEN`, `USER_FEATURES` and `USER_RESTRICTIONS` `.env` knobs are gone. To test a given vendor state, impersonate a vendor that already has it.

## Localization
For loading the module in different locales, add the `POEDITOR_PROJECT_ID` and `POEDITOR_API_TOKEN` variables to your .env file.

```bash
#.env file
POEDITOR_PROJECT_ID=252559
POEDITOR_API_TOKEN=xxxxxx
```

Then you can start development in e.g. german.
```bash
pnpm start -l de
```

## Testing

Run the linter and the tests:

```shell
pnpm test
```

Run the linter independently:

```shell
pnpm lint
```

Run the unit tests independently:

```shell
pnpm test:unit
```

Run the unit tests in watch mode:

```shell
pnpm test:unit --watch [pattern]
```
