This service is responsible for providing the categories of the items that can be sold in the shop. It is a RESTful service that returns the categories based on the product description. The service uses the LangChain4j library to generate the categories based on the product information.
To run the Item Category Service locally, you need first to build the common module and then start the service. Follow the instructions below in the order they are presented:
-
Ensure that the Eurka Server is running. If not, start the Eureka Server
-
Set the following environment variables:
export AZURE_OPENAI_API_KEY=<your-azure-openai-api-key> export AZURE_OPENAI_ENDPOINT=<your-azure-openai-endpoint> export AZURE_OPENAI_DEPLOYMENT_NAME=<your-azure-openai-deployment-name>
-
Start the Item Category Service
./mvnw spring-boot:run
-
Set the following environment variables:
CONTAINER_REGISTRY_NAME=<your-acr-name> TAG=1.1.0
-
Login to Azure Container Registry
az acr login --name $CONTAINER_REGISTRY_NAME
-
Build the image
docker build -t $CONTAINER_REGISTRY_NAME.azurecr.io/item-category-service:$TAG .
-
Push the image
docker push $CONTAINER_REGISTRY_NAME.azurecr.io/item-category-service:$TAG