A web client for ChatGPT based on official API.
As we all know, ChatGPT is very popular now, and so many tools has been developed, such as:
- Desktop application
- Chrome Extension
- Visual Studio Code Extension
- Chat Bots
- etc
However, we have found that, they are still a bit complex for people to interact with ChatGPT and feel the wonderful experience brought by technology.
We thought the Web might be the best choice to help people use ChatGPT more conveniently because of its accessibility and simple interaction, and that's why we decide to develop this web client.
- Easy to interact
- Easy to deploy independently
- Use token and CORS to access (limit malicious access)
- Limit access frequency (the API of ChatGPT has limitations)
- RESTful API and easy to adjust request parameters
The whole project has been divided into two parts:
- Client
- Server
which could be deployed independently, and the easiest way to do this is by using Vercel and Docker.
- Vercel: using vercel to deploy the Client (free, simple enough and do not need extra machine)
- Docker: using docker to deploy the server, because too long timeout is not allowed by vercel (limits 10 seconds)
-
Deploy Server:
$ git clone https://github.com/plantree/ChatGPT-Web.git && cd Server # change config.yml $ docker build -t chat-server . # export port $ docker run -it -p 8000:8000 --name chat-server chat-server
-
Client
// Client/.env VITE_SERVER=http://127.0.0.1:8000
-
Server
# Server/config.yml # export port port: 8000 max_retry: 3 timeout: 20 # CORS use_cors: false origins: - 'http://localhost:*' - 'https://localhost:*' # limit of per minute limit: 10 # encryption obfuscation (not use recently) salt: chatgpt # for login tokens: - test # api key (random select) keys: - sk-xxxx
- Front-end
- Vue
- Vite
- Back-end
- Flask
- Client: add Spin and login error message
- Server: request
api.openai
with retry and timeout, add CORS and query limitation for protecting - Client: login and chat with server upon token