Skip to main content

Ezsale Dify Tool

Requirements​

Trước khi chạy project, cần cài đặt các công cụ sau:

.NET SDK​

Cài đặt .NET SDK 8 trở lên.

Tải tại:

https://dotnet.microsoft.com/en-us/download/dotnet/8.0

Kiểm tra version:

dotnet --version

Node.js​

Cài đặt Node.js version 20 trở lên.

Tải tại:

https://nodejs.org/en/download/

Kiểm tra version:

node -v

Khuyến nghị sử dụng nvm để quản lý nhiều version Node.js trên cùng một máy.

Yarn​

Cài đặt Yarn version 1.22.21.

Kiểm tra version:

yarn -v

Running the development server​

1. Cấu hình biến môi trường web project​

Chỉnh sửa file .env trong web project.

Khi chạy local, hệ thống sẽ sử dụng các biến môi trường này.

VITE_API_URL="https://dev.ezdifyapi.winds.vn/api"
VITE_API_EZZALO="https://ezalov2.api.ezsale.vn"
VITE_API_EZSOCIAL="https://api.ezpage.ezsale.vn"
VITE_META_APP_ID="1950218635708309"
VITE_META_APP_SECRET="e63e0820f56aea704a327d44e8ca885e"
VITE_EZPAGE_API="https://api.ezpage.winds.vn"

2. Cấu hình biến môi trường api project​

Chỉnh sửa file appsettings.json trong api project.

Khi chạy local, hệ thống sẽ sử dụng các biến môi trường này.

{
"ConnectionStrings": {
"Dify": "your dify connection string",
"Default": "your dify page string"
},
"AppSettings": {
"Secret": ""
},
"Crons": {
"SendEmailJob": "0 * * ? * *"
},
"BaseApiUrl": "http://localhost:5001",
"ServerIp": "your server ip",
"ServerUsername": "your username",
"DifyPrivateKeysFolder": "your path to dify/docker/volumes/app/storage/privkeys"
}

3. Chạy dự án​

3.1. Chạy API​

dotnet watch run

3.2. Chạy Web​

yarn dev