waylaidwanderer / PandoraAI

PandoraAI is a web chat client powered by node-chatgpt-api, allowing users to easily chat with multiple AI systems while also offering support for custom presets. With its seamless and convenient design, PandoraAI provides an engaging conversational AI experience.
https://github.com/waylaidwanderer/node-chatgpt-api
MIT License
840 stars 219 forks source link

UX features and bugfixes #133

Open qwqVictor opened 1 year ago

qwqVictor commented 1 year ago

This fork contains some improvements, which are briefly descibed below:

Let's talk about Docker.

  1. We should not use npm run dev as Docker image entrypoint, since it starts Vite development server, which can hardly handle requests behind reverse proxies. Because Vite development server injects port number it binds, if we are behind reverse proxies, it will never connect to Vite's websocket endpoint, which causes infinite refreshing. In this case, I compiled the nitro server at image build time and used npm run preview.
  2. We should use layered building, to make use of Docker's layer cache. So I splitted node_module fetching and postinstall triggering.

Another important change is the environment variable. In recent versions the api server endpoint setting is broken, since Nuxt does not recognized the environment variable from .env. I replaced API_BASE_URL with NUXT_PUBLIC_API_BASE_URL to fix the problem. (maybe the root cause of this problem is not here, but it can be a fix. I'm not an expert with Vue ecosystem)

Some demo photos are also updated with HiDPI version.