youngle316 / chatgpt

ChatGPT build with Next.js app dir Tailwindcss and chatgpt-api

Home Page:https://chatgpt.younglele.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use chatgpt-api to make a mini ChatGPT

Screenshots

home

chat

Intro

This project is mini ChatGPT, use NextJS13, FireBase and chatgpt-api

Have a try -> chatgpt.younglele.cn

Problem

⚠️The project is deployed using Vercel, because I am a hobby user, the Serverless Function Execution Timeout (Seconds) is 10s(General Limits), so when the api response time is greater than 10s, nothing will be displayed

How to use

get token and keys

  1. Create a file named ".env.local" at the root dir.
GOOGLE_ID=
GOOGLE_SECRET=
NEXTAUTH_SECRET=ThisIsASuperSecretAuth
OPENAI_API_KEY=
FIREBASE_SERVICE_ACCOUNT_KEY=

you should follow the step to get your key

  1. Firstly, you should have an OpenAi account, and get your token.(This is the OPENAI_API_KEY)

image.png

image.png

  1. secondly, use google for auth
    1. use Firebase to create a project
    2. move to the Authentication part
    3. select Google and save
    4. get the GOOGLE_ID and GOOGLE_SECRET

image.png

image.png

image.png

image.png

  1. thirdly, get your FIREBASE_SERVICE_ACCOUNT_KEY

image.png

image.png

download your secret key file and open it, then copy them, open this website textfixer and remove line breaks

image.png

then get the new text and that is FIREBASE_SERVICE_ACCOUNT_KEY

Change firebaseConfig

image.png

image.png

then create one

image.png

copy these code to replace "firebase.ts" file

Create Firestore Database

image.png

Add Redirect Url

  1. go to google cloud console
  2. select your project
  3. add redirect url for your project

Start Project

npm install

npm run dev

About

ChatGPT build with Next.js app dir Tailwindcss and chatgpt-api

https://chatgpt.younglele.cn


Languages

Language:TypeScript 90.8%Language:CSS 7.1%Language:JavaScript 2.1%