A repo to get you shipping your own GPT thing in minutes ๐
Created using the ts-nextjs-tailwind-starter repo by Theodorus Clarence. See the original repo for all the things packed into this starter. For a rundown of the original starter, check out this blog post.
git clone [email protected]:Disruptive-Kiwi/gpt-starter.git
It is encouraged to use yarn so the husky hooks can work properly.
yarn install
cp .env.example .env.local
Create a free account at https://platform.openai.com/account/api-keys and then grab your API key and pop it into the .env.local
file.
Start you local server using this command:
yarn dev
Open http://localhost:3000 with your browser to see the result. You can start editing the page by modifying src/pages/index.tsx
.
To change the prompt being sent to GPT, update src/pages/api/generate.ts
.
There are some additional things you'll need to change including title, urls, favicons, etc.
Find all comments with !STARTERCONF, then follow the guide.
Don't forget to change the package name in package.json
.
This starter is using conventional commits, it is mandatory to use it to commit changes.
Deploying a Next.js project to Vercel is super easy peasy lemon squeezy but their limit of 10s on all serverless function calls for Hobby tier apps makes it unusable for this starter (because OpenAI API can take up to 30 seconds to respond).
Instead, we'll be deploying to Railway.app.
- Click on Create new project
- Choose Deploy from Github repo
- Login to Github (if needed)
- Choose your Github repo that you want to deploy
- Click on Add variables -> Add all the environment variables in your
.env.local
file - Click on your app and jump to the Settings tab
- Click on Generate domain and then load the generated domain in your browser
- You're off to the races ๐
This repo comes with a whole bunch of pre-built components that can be found at http://localhost:3000/components
.
This starter is equipped with an expansion pack.
You can easily add expansion such as React Hook Form + Components, Storybook, and more just using a single command line.
Check out the expansion pack repository for the commands.