OpenAI chat app
This is a T3 Stack project bootstrapped with create-t3-app
.
- openai-api - OpenAI API
- headlessui/react - accessible UI components
- react-hook-form - frontend form validation
- react-toastify - toast notifications
- @formkit/auto-animate - simple enter/exit animations
- daisyui - Tailwind CSS chat UI components
- react-icons - icons
- @mantine/hooks - scroll to element hook
- tsx - typescript runner for db seed
- eslint-plugin-import - eslint plugin for import sorting
-
First, clone the repo:
git clone git@github.com:ErnestoR/Chatty-bot.git cd Chatty-bot
-
Then, install the dependencies:
yarn
-
Create a
.env.local
file and add the following:NEXTAUTH_SECRET="YOUR_SECRET" CHATGPT3_API_KEY="YOUR_API_KEY"
CHATGPT3_API_KEY needs to be obtained from OpenAI
-
Generate the Prisma client:
yarn prisma generate
-
Optionally, you can seed the database with some dummy data:
yarn prisma db seed
-
Finally, run the development server:
yarn dev
-
Open http://localhost:3000 with your browser to see the result.
-
Log in with the following credentials: (these are the credentials for the seeded user)
email: john@mail.com password: adminadmin yeah I know, not very secure 😅 note to self: use a hash/crypto library to hash the password before storing it in the db