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
- 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). - Search for "Environment Variables" in the Windows search bar and select "Edit the system environment variables."
- In the System Properties window, click on "Environment Variables."
- In the Environment Variables window, under "System variables," select the "Path" variable and click "Edit."
- Add the path to the Maven
bindirectory (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
- In the Environment Variables window, click "New" under the "User variables" section.
- For "Variable Name," enter
MAVEN_HOME. - For "Variable Value," enter the path to the Maven folder (for example,
C:\Program Files\apache-maven-3.9.6). - Click "OK" to save the variable.
- 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)
- Variable Name:
Editing the Path environment variable
- In the Environment Variables window, find the "Path" variable under "System variables" and click "Edit."
- Add
%M2_HOME%\binto the list of paths. This references theM2_HOMEvariable you created in the previous section. - Click "OK" to save the changes.
Verifying the Maven installation
- Open a new command prompt.
- Run the command
mvn -versionto 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 Name | Variable Value |
|---|---|
NODE_OPTIONS | --openssl-legacy-provider |
IS_LOCAL | true |
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
- Create a folder named
AlgoQAin your deployment directory. - Create a new file named
.envinside theAlgoQAfolder. - Open the
.envfile and replace everyPLACE_HOLDERvalue 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
- Prerequisites for On-Premises Deployment: Review software and hardware requirements before deploying
- Pre-requisites to Use algoQA: Complete the remaining prerequisites
- On-Premises Overview: Learn about the on-premises deployment process
- System Requirements: Check the minimum hardware and software requirements