This is a Next.js project bootstrapped with create-next-app
.
It uses Prisma for Object-relational mapping.
OpenAI compatible API will be used to generate chat completions.
Bedrock Access Gateway (Nextjs+Ts) is recommended as an alternative to OpenAI for use-cases where sending chats to an external managed service is not compliant with data policies.
Install dependencies
npm install
Create a .env
file in the root of the project:
cp .env.example .env
Add the OpenAI API key to the .env
file:
OPENAI_API_KEY=sk-...
Then, initialize the database:
docker-compose up -d
Run the migrations:
npm run migrate
Seed the database:
npm run seed
Then, run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
If you make changes to the database schema you can run the migrations with:
npm run migrate
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Prisma Documentation - learn about Prisma features and API.
- OpenAI API Reference - learn about OpenAI API.