Skip navigation

Integration

One page summary of how to integrate Frontend into Backend.

Configuration

Inside the /PreciseAlloy.Frontend/.env.production file, set following variables:

  • VITE_BASE_URL
    Set this variable to / unless the backend website is served using a sub-folder. In that case, include the sub-folder with a leading and trailing / (e.g., /portal/).

  • VITE_INTE_ASSET_DIR
    The assets folder inside the Backend project.
    This folder will contain the JavaScript, CSS, icons, and other files generated by the Frontend that are needed to run the site.

  • VITE_INTE_PATTERN_DIR
    The pattern folder.
    This folder will contain the generated HTML contents output by the Frontend. It is not required to run the site, but it serves as a helpful resource for tracking changes during re-integration.

Integration

Locally, you can run following command:

bun inte

In the repository, merge the fe-develop branch into the fe-release branch. This will build the Frontend code and create a pull request into the develop branch. Once merged, the code is ready for integration.

Note: If you're using Azure DevOps, you need to provide a value for CUSTOM_REVIEWER_ID in /PreciseAlloy.Frontend/.build/integration.yml. You can obtain this value by opening the Azure DevOps repository in a browser, then running the following script in the Developer Tools console:

(() => {
  const data = window.dataProviders?.data;
  if (!data) {
    console.log('No data');
    return;
  }

  const teamContext = data['ms.vss-tfs-web.team-context-data-provider'];
  if (teamContext) {
    console.log('CUSTOM_REVIEWER_ID:', teamContext.id);
    return;
  }

  const project = data['ms.vss-tfs-web.page-data']?.project;
  if (!project) {
    console.log('No project');
    return;
  }

  const projectImageUrl = project.imageUrl;
  if (!projectImageUrl) {
    console.log('No project image url');
    return;
  }

  const id = projectImageUrl.replace(/^.*MemberAvatars\/([a-z0-9_-]+).*$/gi, '$1');
  console.log('CUSTOM_REVIEWER_ID:', id);
})();