ShipBit / slickgpt

SlickGPT is a light-weight "use-your-own-API-key" web client for the OpenAI API written in Svelte. It offers GPT-4 integration, a userless share feature and other superpowers.
https://slickgpt.vercel.app
MIT License
468 stars 97 forks source link

HowTo: Host on other providers than Vercel #7

Open Shackless opened 1 year ago

Shackless commented 1 year ago

SlickGPT is setup to use Vercel as hosting provider. It uses @sveltejs/adapter-vercel and configures the endpoints in the /api dir to run as Edge functions. Create some documentation and/or branches to show how to run it on:

I already tried with Netlify and encountered an unexpected issue where Netlify was not able to access env vars from $env/static/private. See this issue for more infos and a workaround. Another problem was that longer prompts timed out because the edge/serverless functions ran too long on Netlify.

Shackless commented 1 year ago

@theRealBithive It's a standard SvelteKit site, so it already is easily self-hostable. Do you have a Node server? Use @sveltejs/adapter-node and run it. You can remove all the "third parties" (Firebase) by disabling or rewriting the Share feature (see README and #6) in like 10 minutes time because for that to work you actually need a database of some kind.

This issue is just a reminder to add some documentation or forks/branches/templates to show people how to do it in case they don't know.

withLinda commented 1 year ago

In case someone wants to deploy using Railway app,

To successfully deploy the project using Railway app, I followed these steps:

  1. Since I didn't have access to a Firebase API, I used dummy data in the .env file. This only impacts the functionality of the share button, which won't work. However, all other functions, including chat, will work without any issues.

  2. I made the following updates in the package.json file:

  1. Here is the Nixpacks setup I used:

╔═════════ Nixpacks v1.13.0 ════════╗

║ setup │ nodejs-16_x, npm-9_x

║ install │ npm i

║ build │ npm run build

║ start │ npm run start

╚════════════════════════════╝