This is the frontend of the Taxonomy Model App.
To develop the frontend locally, you must install the following:
- Node.js ^16.0
- Yarn ^1.22
- A recent version of git (e.g. ^2.37 )
To develop this application locally, follow these steps:
-
Ensure you have the prerequisites installed before proceeding.
-
Clone the repository
-
Navigate to the frontend directory:
cd ./frontend -
Install the project's dependencies:
yarn installAfter running the above command, the
postinstallscript in the package.json will also run, and it will build and link the api-specifications dependency. -
Make sure to set up a
env.jsfile in the public/data directory. You can use theenv.example.jsfile as a template. Please request the necessary environment variables from the project team.
After installing and setting up the project locally, run the development server with the following command:
yarn start
The server will run on port 3000, and you can preview the application in your browser by visiting http://localhost:3000.
NOTE: This project uses HashRouter for routing. HashRouter uses the URL hash to simulate a full URL so that the page won't be reloaded when you navigate between routes. More on of how to define routes using HashRouter.
We use Storybook to test and demonstrate components in the browser. To run Storybook, execute the following command:
yarn storybook
To run the test cases for the application, execute the following command:
yarn test
The application uses Storybook and Axe-Playwright to test the accessibility of the components.
To run the accessibility tests cases locally, execute the following commands, open a shell and start storybook:
yarn storybook
Then, open another shell and run:
yarn test-storybook
Alternatively, you can run the following command in a single shell:
yarn build-storybook && yarn test:accessibility
Failing to comply to WAG 2.0 A rules will generate errors.
Failing to comply to WAG 2.0 AA, WAG 2.0 AAA, or Best Practice Rules will only generate warnings.
See UI Guidlines for more information on accessibility.
To build the React application, execute the following command:
yarn build
To run the linter, execute the following command:
yarn lint
Contributions are highly valued in this project.
In addition to the contribution guidelines mentioned in the parent directory, please follow these specific rules while working on the frontend project:
-
Please consult our UI Guidelines before proceeding with frontend work.
-
Before pushing your work, make sure to: