A few hours ago, I wrote about setting up your own ChatGPT bot, and then I recommended three ChatGPT-WEB open-source programs. The last one I thought was particularly great, so I tinkered with it a bit and decided to create a tutorial for everyone!
Preface: I encountered some challenges, but eventually figured it out.
Setup Tutorial:#
GitHub: https://github.com/Chanzhaoyu/chatgpt-web
Environment I used: Baota + Node v16.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 it with the Node Version Manager.
For the reason, please see: https://k7blog.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 in Baota-Website-Node Project-Add Node Project.
The running directory is chatgpt-web/service, everything else is default, project port is 3002.
Then you can bind a domain to this project!
Build frontend#
Edit the .env file in the root directory, change VITE_GLOB_API_URL to your IP+3002 port, or if you have bound a domain, you can enter the domain as well, make sure to end with /api!
Then run pnpm build to build the frontend, a dist folder will be added to the root directory.
You can host this folder on a static server or your own server!