Simplified Chinese | English
TerraMours practical project realizes functions such as user login and SK-based multi-language model chat, and multi-model image generation based on chatgpt and SD. The management side realizes data board, chat record management, picture record management, user management, system configuration, etc.
TerraMours-Gpt-Web is based on the ChatGPT project front-end of vue3.0+ts+naive UI+vite.
Official website address: https://terramours.site/
AI chat : supports multiple models: gpt-3.5-turbo, gpt-3.5-turbo-16k, gpt-4, ChatGLM. Supports Semantic Kernel integration.
AI drawing : Image generation of dallE models that support Stable Diffusion and chatgpt
Data board : Shows multiple data statistics, including several data types that managers care about the most. The chart shows the number of chats and drawings in multiple dimensions, which are divided into three dimensions: on the same day (statistic by hour), on day and on month. The following are the data counted by day
System Management :
Chat record : Chat record management, query user session information. (todo: 1. Export function 2. Create fine-tuning model)
Sensitive word management : Sensitive word management, custom sensitive word filtering, and strengthen system security
Key pool management : Key pool management, supports managers to add multiple keys to form a Key pool, polling when calling the AI interface, and strengthening stability
System prompt words : System prompt words, add various character prompt words to allow users to better use Ai dialogue.
Drawing record : View the generated record of pictures in the system
Menu Management : The backend management system implements dynamic configuration of menus. The menu is set through the menu management interface. The backend API will add basic menus when initializing.
Role Management : Role Control of the backend management system. The super administrator role is created by default and the ordinary user role.
User Management : Management of registered users in the system
Product Management - Product Category : Set the product type, classification and other information to facilitate product management
Product Management - Product List : Set Product Information
Order List : View generated orders
2023.12.24 V1.8-preview NEW!: 1. A new gpt4-version model was added to the chat module to realize the image analysis function 2. Mobile phone adaptation optimization of the chat module 2023.12.21 V1.7:
1.A new chat module is added to the management system 2.Fix error bugs in saving chat history 3.Fix abnormal image display bugs 4.Optimize database initialization data
2023.12.15 V1.6:
1. Role configuration module has been added 1. Administrator role configuration 2. User default role configuration 2. New user gift balance settings 3. Change the setting to 1k token pricing for easy filling 4. Fix bugs with inconsistent product interface type settings after refactoring 5. Fix bugs with shared picture interface not taking effect 6. Fix order and product interface bugs
2023.12.15 V1.5: 1. Refactor the background API service to solve the problem of query concurrency
2. New items added to the data board function:
1. 销售额订单统计表
2. token 消耗量时间分布统计图
3. 上线人数时间分布统计图
4. 销售额时间分布统计图
5. 各模型的提问次数/图片生成次数/token消耗量 统计数量和比例分布图
2023.12.4 V1.4: 1. Update AllInAI.Sharp.API sdk to version 1.1.6, supporting the token value acquisition of openai's streaming interface
2023.12.4 V1.3: 1. Add support for Wen Xinyiyan's Stable-Diffusion-XL model. 2. The model configuration for chat and drawing calls is unified to the key pool configuration. 3. Use the AllInAI.Sharp.API model to call SDK version 1.15 and call the AI model uniformly.
2023.12.4 V1.2: 1. Add model support for Wen Xin Yi Yan and Tong Yi Qian Questions. 2. The management system adds a model key pool configuration with Wen Xin Yi Yan and Tong Yi Qianwen. 3. Use the AllInAI.Sharp.API model to call the SDK and call the AI model uniformly.
2023.11.16 V1.1.1: 1. Solve some bugs after updating the key pool
2023.11.15 V1.1: 1. Added support for ChatGLM, and the front-end model chooses to add ChatGLM 2. Reconstruct the key pool interface. The new key pool can set a specified model 3. Fixed the problem of insufficient balance when the price is 0.
├─ docker-compose(部署)
├─ kubernetes(部署)
├─ public(logo图片)
├─ service(接口)
├─ src(前端代码)
│ ├─ api(接口调用)
│ ├─ components(组件)
│ ├─ hooks(钩子)
│ ├─ plugins(插件)
│ ├─ router(路由)
│ ├─ store(主要记的本地缓存)
│ ├─ views(页面)
│ │ └─ chat
│ │ │ └─ components
│ │ │ └─layout(布局)
│ │ │ │ └─ Layout.vue(布局vue,基础)
│ │ │ │ └─ Permission.vue(免责声明和验证码弹窗,重要,登录框根据这个改)
│ │ │ └─index.vue(聊天页面)
│ └─ README.md
├─ .gitignore
└─ package.json
Create a new empty file and name it docker-compose.yml, paste the following content into the file and save it
version : " 3.9 "
services :
redis :
image : redis
container_name : redis_container
ports :
- " 6379:6379 "
restart : always
networks :
- server
postgres :
image : postgres
container_name : postgres_container
environment :
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=terramours1024
- POSTGRES_DB=TerraMoursGpt
ports :
- " 5432:5432 "
restart : always
networks :
- server
seq :
image : datalust/seq
container_name : seq_container
environment :
- ACCEPT_EULA=Y
ports :
- " 5341:80 "
restart : always
networks :
- server
server :
image : raokun88/terramours_gpt_server:latest
container_name : terramours_gpt_server
environment :
- TZ=Asia/Shanghai
- ENV_DB_CONNECTION=Host=postgres;Port=5432;Userid=postgres;password=terramours1024;Database=TerraMoursGpt;
- ENV_REDIS_HOST=redis:6379
- ENV_SEQ_HOST=http://<YOUR-SERVER-IP>:5341/
volumes :
# 图片挂载地址,将容器中的图片挂载出来
- /path/terra/images:/app/images
# 可挂载自定义的配置文件快速进行系统配置
# - F:Dockerterraserver/appsettings.json:/app/appsettings.json
ports :
- " 3116:80 "
restart : always
networks :
- server
depends_on :
- postgres
- redis
admin :
image : raokun88/terramours_gpt_admin:latest
container_name : terramoursgptadmin
environment :
- VUE_APP_API_BASE_URL=http://<YOUR-SERVER-IP>:3116
ports :
- " 3226:8081 "
restart : always
networks :
- server
web :
image : raokun88/terramours_gpt_web:latest
container_name : terramoursgptweb
environment :
- VUE_APP_API_BASE_URL=http://<YOUR-SERVER-IP>:3116
ports :
- " 3216:8081 "
restart : always
networks :
- server
networks :
server :
driver :
bridge
1. Modify yml: Replace <YOUR-SERVER-IP> with server IP
2. Default administrator account password: [email protected] [email protected]
3. The system reports an error, view through seq, and view the address: http://<YOUR-SERVER-IP>:5341/
4. The seq log shows that初始化数据库成功, which means that the back-end service is initialized successfully. There may be an error in the first installation. It is recommended to restart the terramours_gpt_server container after the dockercompose installation is completed.
5. More service configurations, you can copy the appsettings.json file on github on the server to the server, and modify the configuration files in the container by mounting.
# 可挂载自定义的配置文件快速进行系统配置
- /path/terra/appsettings.json:/app/appsettings.json
Uploading the dockercompose file to the server, I am using XFTP.
docker-compose upIn addition to dockercompose, we have uploaded the front-end image to dockerhub, and we can also use the docker command to quickly build front-end projects. Execute the docker command on the server, the command is as follows
docker run --name terramoursgptweb -p 3216:8081 -e VUE_APP_API_BASE_URL=http://localhost:3002 --restart always -d raokun88/terramours_gpt_web:latest //VUE_APP_API_BASE_URL为后端API地址,请替换成对应的内容Note: VUE_APP_API_BASE_URL is the backend API address, please replace it with the corresponding content
pnpm devdocker build -t terramoursgptweb .
# 前台运行
docker run --name TerraMours_Gpt_Web -d -p 3002:4173 --restart always TerraMours_Gpt_Web
# 保存镜像
docker save -o chatweb.tar TerraMours_Gpt_Web
# 运行地址
http://localhost:3002/






solve issue xxx,add xxxIf you wish to participate in the contribution, welcome Pull Requests, or give us Issues
raokun:https://www.raokun.top/
firstsaofan:https://www.firstsaofan.top/
raokun , Mortal , firstsaofan