Prepare Infrastructure for the DeploymentSetting Up Maven

Setting Up Maven

Set up Maven on a Windows machine and configure the environment variables algoQA needs for on-premises deployment, including database credentials and the .env file.

Maven is a build automation tool used to manage Java-based projects. This page walks you through installing Maven, adding it to your system PATH, setting up the environment variables algoQA requires, and creating the .env configuration file for on-premises deployment.

Download Maven from the official website. This guide assumes you have already downloaded the Maven binary zip file.

Installing Maven and Setting Up Environment Variables

Follow these steps on your Windows machine:

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. Replace the example with the actual path to your Maven installation.

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 steps 1–4 to add a second variable with the following values:
    • Variable Name: M2_HOME
    • Variable Value: 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. This references the M2_HOME variable you created in the previous section.
  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. You should see output displaying the Maven version, Java version, and operating system details.

Setting Up Database Environment Variables

Add the following system environment variables for database configuration:

Variable NameVariable Value
NODE_OPTIONS--openssl-legacy-provider
IS_LOCALtrue
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

The variables from IS_LOCAL through DATABASE_NAME are used for local user authentication. The _CLIENT variants configure the client database. Replace the empty values with your actual database credentials.

Creating the .env file

  1. Create a folder named AlgoQA in your deployment directory.
  2. Create a new file named .env inside the AlgoQA folder.
  3. Open the .env file and replace every PLACE_HOLDER value with the appropriate credentials for your environment:
SECRET_KEY="THIS IS USED TO SIGN AND VERIFY JWT TOKENS, REPLACE IT WITH YOUR OWN SECRET, IT CAN BE ANY STRING"
JWT_EXPIRY=3600
AWS_REGION="ap-south-1"
PORT=4000
JAVA_URL="http://localhost:8080"
PY_URL="http://127.0.0.1:8083"
AWS_S3_ENABLED=""
AWS_BUCKET=""
baseURL="PLACE_HOLDER"
projectBasePath="./AlgoQA_Data"
dataPath="AlgoQA_Data"
MONGO_ENABLE="false"
DATABASE_HOST_CLIENT="PLACE_HOLDER"
DATABASE_PORT_CLIENT=3306
DATABASE_USER_CLIENT="PLACE_HOLDER"
DATABASE_PASSWORD_CLIENT="PLACE_HOLDER"
DATABASE_NAME_CLIENT="PLACE_HOLDER"
IS_LOCAL="true"
DATABASE_HOST="PLACE_HOLDER"
DATABASE_PORT=3306
DATABASE_USER="PLACE_HOLDER"
DATABASE_PASSWORD="PLACE_HOLDER"
DATABASE_NAME="PLACE_HOLDER"

The last five variables (DATABASE_HOST through DATABASE_NAME) are used for local user authentication.

Next Steps