Skip to content

This is a demo project to showcase how we can use Question and answer process for handling existing database using Prisma, Next.js and OpenAI

Notifications You must be signed in to change notification settings

tigranbs/nextjs-prisma-gpt-queries

Repository files navigation

This is a standard Next.js + Prisma + TailwindCSS + TypeScript project setup, which I used to connect with OpenAI and experiment with making Q&A on top of the existing Relational database.

Video

Getting Started

Don't forget to install packages first before running the development server 🙌

# Install packages
npm i

First, we must ensure we have Prisma generated and the DB file created. By default, this project uses SQLite for the simplicity of setup in the development process. You can change the DB to Postgres or MySQL by following the Prisma documentation.

npx prisma db push
npx prisma generate client

Secondly, we have to ensure we have an OpenAI API key. You can get one by signing up on OpenAI. After that, we can create a .env file and put the API key in there.

# .env

OPENAI_API_KEY=<YOUR_API_KEY>

Lastly, we can run the development server.

# Run the development server
npm run dev

Open http://localhost:3000 with your browser to see the result.

About

This is a demo project to showcase how we can use Question and answer process for handling existing database using Prisma, Next.js and OpenAI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published