A demo repo based on OpenAI GPT-3.5 Turbo API.
- Node: Check that both your development environment and deployment environment are using
Node v18
or later. You can use nvm to manage multiplenode
versions locally。node -v
- PNPM: We recommend using pnpm to manage dependencies. If you have never installed pnpm, you can install it with the following command:
npm i -g pnpm
- OPENAI_API_KEY: Before running this application, you need to obtain the API key from OpenAI. You can register the API key at https://beta.openai.com/signup.
- Install dependencies
pnpm install
- Copy the
.env.example
file, then rename it to.env
, and add your OpenAI API key to the.env
file.OPENAI_API_KEY=sk-xxx...
- Run the application, the local project runs on
http://localhost:3000/
pnpm run dev
Deploy with the
SITE_PASSWORD
Step-by-step deployment tutorial:
- Fork this project,Go to https://app.netlify.com/start new Site, select the project you
forked
done, and connect it with yourGitHub
account.
- Select the branch you want to deploy, then configure environment variables in the project settings.
- Select the default build command and output directory, Click the
Deploy Site
button to start deploying the site。