This is an express app that uses chatgpt api to generate courses.
- first of all make sure that you have
npm
anddocker compose
installed on your machine. - navigate to
db
directory and rundocker compose up -d
- run
npm install
orpnpm install
- before continuing make sure to copy
.env.example
file to.env
and putting a correct OPENAI_API_KEY - run
(p)npm prisma generate
- after that you now can execute the server directly via
npm run dev
This project is structured into 3 main directories prisma
, routes
and controllers
, the main code is in controllers directory.
controllers/chatgpt.js
: contains the prompt for our project.controllers/courses.js
: contains the api methods to be invoked.prisma/schema.prisma
: contains the model definitions, we only have one model which is theCourse
model.routes/courses.js
: contains all the routes related to the courses api.app.js
: is the entrypoint for our application