This is a Next.js project bootstrapped with create-next-app
.
It uses Prisma for Object-relational mapping.
OpenAI will be used to generate post drafts.
- As a user, I want to be able to see the Authors of each post.
- As a user, when I create a new post, I want to be able to select the Author from a list of existing Authors in the database, right now the options are hard-coded.
- As a user, I want to be able to input a list of comma-separated keywords and get a post draft from ChatGPT. I want to be able to review the draft before submitting it as a new post.
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.