Next.js Discord

Discord Forum

Automatically generating endpoints and/or their documentation?

Unanswered
Asian Brown Flycatcher posted this in #help-forum
Open in Discord
Asian Brown FlycatcherOP
Hey, everyone!

I've built apps with Next in the past, but they've always been small, at least in terms of data relationships. I'm now looking to build an app with complex many-to-many relationships. If you know about Doctrine and OpenAPI, you know that all you pretty much have to do is write a Model and Service, and there's tooling that allows you to generate your endpoints. I know that Next is an endpoints-first framework, but given I'll be doing a lot of data manipulation where one entity depends on the other, I was wondering what could I pair Prisma with, so that most of this work is automated? For example, I'd like to define a type Course as such:
type Course = {
  id: uuid;
  teacher: Teacher;
  categories: Categories;
}

Where I could have a get${domain}${property} transformed to an getCourseTeacher automatically for me. Same would go for all CRUD operations. Naturally, I should be able to overwrite those operations with custom logic myself.

Any ideas on what I should look at? Thank you!

0 Replies