GithubHelp home page GithubHelp logo

disruptive-kiwi / gpt-starter Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 2.0 701 KB

A starter to build and ship GPT powered full stack apps using Next.js, Tailwind CSS and Typescript.

Shell 0.20% JavaScript 7.37% TypeScript 62.83% CSS 29.61%
ai chatgpt chatgpt-api gpt gpt-3 nextjs openai openai-api reactjs starter tailwind tailwindcss typescript

gpt-starter's Introduction

GPT Starter with Next.js + Tailwind CSS + TypeScript

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.

Getting Started

1. Clone this repo

git clone [email protected]:Disruptive-Kiwi/gpt-starter.git

2. Install dependencies

It is encouraged to use yarn so the husky hooks can work properly.

yarn install

3. Get an OpenAI API key

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.

3. Run the development server

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.

4. Change defaults

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.

5. Commit Message Convention

This starter is using conventional commits, it is mandatory to use it to commit changes.

Shipping it 🚀

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.

  1. Click on Create new project
  2. Choose Deploy from Github repo
  3. Login to Github (if needed)
  4. Choose your Github repo that you want to deploy
  5. Click on Add variables -> Add all the environment variables in your .env.local file
  6. Click on your app and jump to the Settings tab
  7. Click on Generate domain and then load the generated domain in your browser
  8. You're off to the races 🚀

Pre-built components

This repo comes with a whole bunch of pre-built components that can be found at http://localhost:3000/components.

Expansion Pack 📦

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.

gpt-starter's People

Contributors

iamhitarth avatar

Stargazers

Cameron King avatar João Mesquita avatar Tuan Duc Tran avatar  avatar John Tillery avatar Kacper Bąk avatar Brian Roach avatar José Coelho avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.