Skip to content

Latest commit

 

History

History
71 lines (42 loc) · 2.25 KB

deployment.md

File metadata and controls

71 lines (42 loc) · 2.25 KB

Deploying visualized-gpt on your own

1. Download the code

git clone [email protected]:yenche123/visualized-gpt.git
cd visualized-gpt

2. Install dependencies

# Please make sure you have pnpm installed beforehand
pnpm i

3. val town

Open Val Town and log in. When logging in, please remember the username you entered on the following page.

After logging in, go to the Secrets Page,and enter your openai_key as shown below.

The KEY name is openai_key, and the VALUE can be obtained from OpenAI Api Keys

4. Copy cloud function

Open cloud function, tap the Fork button, and then press Run, as shown below.

Next, you can tap the 🔒 icon next to the cloud function name (as shown below) to switch the cloud function to public or private. If it is set to private, you must configure VITE_VAL_TOWN_AUTH in step 5.

5. Configure environment variables

Go back to the project root directory and create a new file named .env.local. Copy all the text in .env.template to .env.local and fill in the corresponding values for each environment variable after =, as shown below.

# your username in val town
VITE_VAL_TOWN_USERNAME=Your val town username should be filled in here

6. Preview

pnpm run dev

After waiting for vite to process, press the o key to preview.

7. Build

pnpm run build

After waiting for vite to process, you can get the ./dist folder in the project root directory, where the files are the production code for the front-end.

8. Deployment

Put the files in ./dist into your own server, or use a third-party static website hosting service such as Zeabur / Netlify / Cloudflare / Vercel

Congratulations, you are done! 🎉