Development Environment Setup ============================= This guide describes how to set up and run the QA Display locally for development purposes. For deployment and integration with the QA Data API and the SDP system, see :doc:`/userguide/running` and :doc:`/userguide/integration`. Prerequisites ------------- - **Node.js:** Version 20 or higher (`Node.js `_) - **Yarn:** Version 1.22.x (`yarn `_) - **Dependencies:** Listed in ``package.json`` Environment Configuration ------------------------- The QA Display supports configuration via environment variables. Common variables include: - ``REACT_APP_USE_LOCAL_DATA``: Set to ``true`` to use mock data for development, or ``false`` to connect to a live backend. - Backend API endpoint variables: Configure the connection to the QA Data API as needed for your environment. To use mock data, create a file named ``.env`` in the root of the project and add: .. code-block:: REACT_APP_USE_LOCAL_DATA=true **The ``.env`` file is not committed to the repository and set to be ignored by Git.** Local Development Workflow -------------------------- 1. **Install Dependencies:** .. code-block:: bash yarn install --frozen-lockfile 2. **Configure Data Source (Optional):** - By default, the app connects to a live backend. To use mock data, set ``REACT_APP_USE_LOCAL_DATA=true`` as above. 3. **Run the Development Server:** .. code-block:: bash yarn dev The app will open in your browser at `localhost `_. 4. **Stopping the Environment:** - Press ``ctrl-c`` in the terminal to stop the server. Connecting to a Live QA Data API -------------------------------- To connect to a live data source, ensure ``REACT_APP_USE_LOCAL_DATA`` is set to ``false`` or remove the ``.env`` file. The application will use the backend configured in your environment variables. For more details, see the `QA API documentation `_. Containerized Deployment ------------------------ A Dockerfile is provided for containerized deployments. To build and run the container: .. code-block:: bash docker build -t sdp-qa-display . docker run -p 3333:3333 sdp-qa-display This will expose the application on port 3333.