Prepare Infrastructure for the DeploymentSetting Up Maven

Setting Up Maven

Install Maven, add it to PATH, and set the environment variables algoQA needs. Maven is a tool used for building and managing Java-based projects. Set up Maven and the environment variables needed for the algoQA deployment on a Windows machine.

Setting Up Maven and Environment Variables

Perform the following:

Adding Maven to the PATH variable

  1. After downloading Maven, unzip the folder and copy it to a location on your computer (for example, C:\Program Files\apache-maven-3.9.6).
  2. Search for "Environment Variables" in the Windows search bar and select "Edit the system environment variables."
  3. In the System Properties window, click on "Environment Variables."
  4. In the Environment Variables window, under "System variables," select the "Path" variable and click "Edit."
  5. Add the path to the Maven bin directory (for example, C:\Program Files\apache-maven-3.9.6\bin) to the list of paths. Ensure to replace with the actual path.

Setting up Maven environment variables

  1. In the Environment Variables window, click "New" under the "User variables" section.
  2. For "Variable Name," enter MAVEN_HOME.
  3. For "Variable Value," enter the path to the Maven folder (for example, C:\Program Files\apache-maven-3.9.6).
  4. Click "OK" to save the variable.
  5. Repeat the above steps to add another variable:
  6. Variable Name: M2_HOME
  7. Variable Value: Enter the path to the Maven folder, (for example, C:\Program Files\apache-maven-3.9.6).

Editing the Path environment variable

  1. In the Environment Variables window, find the "Path" variable under "System variables" and click "Edit."
  2. Add %M2_HOME%\bin to the list of paths.
  3. Click "OK" to save the changes.

Verifying the Maven installation

  1. Open a new command prompt.
  2. Run the command mvn -version to verify the Maven version.

Adding Key Pair

Add the following key pair as the system environment variable as shown in the table:

Variable NameVariable Value
NODE_OPTIONS--openssl-legacy-provider
IS_LOCAL
DATABASE_HOST
DATABASE_PORT
DATABASE_USER
DATABASE_PASSWORD
DATABASE_NAME
DATABASE_HOST_CLIENT
DATABASE_PORT_CLIENT
DATABASE_USER_CLIENT
DATABASE_PASSWORD_CLIENT
DATABASE_NAME_CLIENT
ALGOQA_PROJECT_BASE_PATH./AlgoQA_Data

These are applicable if you are managing user authentication locally. The list from IS_LOCAL to DATABASE_NAME in the Variable Name column are used for user authentication locally.

Creating the .env file

  1. Create AlgoQA folder.
  2. Create a new file named .env inside AlgoQA folder.
  3. Open the .env file and replace the actual values for the PLACE_HOLDER with the appropriate values:
    .env file showing SECRET_KEY, JWT_EXPIRY, AWS_REGION, PORT and database PLACE_HOLDER values

Note that the last five are applicable for authentication of users on your local machines.