Use chatgpt-api to make a mini ChatGPT
Screenshots
Intro
This project is mini ChatGPT, use NextJS13, FireBase and chatgpt-api
Have a try -> chatgpt.younglele.cn
Problem
How to use
get token and keys
- 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
- Firstly, you should have an OpenAi account, and get your token.(This is the OPENAI_API_KEY)
- secondly, use google for auth
- use Firebase to create a project
- move to the Authentication part
- select Google and save
- get the GOOGLE_ID and GOOGLE_SECRET
- thirdly, get your FIREBASE_SERVICE_ACCOUNT_KEY
download your secret key file and open it, then copy them, open this website textfixer and remove line breaks
then get the new text and that is FIREBASE_SERVICE_ACCOUNT_KEY
Change firebaseConfig
then create one
copy these code to replace "firebase.ts" file
Create Firestore Database
Add Redirect Url
- go to google cloud console
- select your project
- add redirect url for your project
Start Project
npm install
npm run dev