A8DOG

A8DOG

随便写写,记录折腾过程!
telegram

ChatGPT-WEB Building Tutorial

title: 'ChatGPT-WEB Setup Tutorial'
date: 2023-02-17 08:32:49
tags: [ChatGPT]
published: true
hideInList: false
feature: https://img.a8dog.com/i/2023/02/17/e4nobf.webp
isTop: false#

A few hours ago, I wrote a tutorial on how to set up your own ChatGPT bot (https://a8dog.com/post/IM38JhKI2/). Then I recommended three open-source ChatGPT-WEB programs, and the last one I think is particularly great, so I played around with it and created a tutorial for everyone!

Preface: I encountered some difficulties, but I managed to figure it out.

Setup Tutorial:#

GitHub: https://github.com/Chanzhaoyu/chatgpt-web
Environment I used: Baota+Nodev16.19.0
Baota-Website-Node Project-Node Version Manager can be used to install Node!

To set it up, you need the PNPM module, but you can't use the Node Version Manager to install it.
Please see the reason here: https://a8dog.com/post/IM38JhKI2/ at the bottom!

Install PNPM#

wget -qO- https://get.pnpm.io/install.sh | sh -

Deploy project dependencies:#

git clone https://github.com/Chanzhaoyu/chatgpt-web.git
cd chatgpt-web
# Install frontend dependencies
pnpm bootstrap
# Install backend dependencies
cd service
pnpm install

Deploy backend#

In the project directory /service/.env, configure your KEY, then go to Baota-Website-Node Project-Add Node Project.
The running directory is chatgpt-web/service, everything else is default, and the project port is 3002.

Snipaste_2023-02-17_08-44-48

Then you can bind a domain to this project!

Build frontend#

Edit the .env file in the root directory and modify VITE_GLOB_API_URL to your IP+3002 port, or if you have bound a domain, you can enter the domain name. Make sure it ends with /api!

Then execute pnpm build to build the frontend. The root directory will have a new folder called dist.
You can host this folder on both static and your own servers!

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.