Seeking Advice on Backend Stack for Next.js Project
Unanswered
American black bear posted this in #help-forum
American black bearOP
I hope you're all doing well. I'm currently working as a junior frontend developer on a full stack project that involves Next.js with TypeScript on the frontend. I've made some decisions such as using MySQL for the database and opting for Prisma ORM to manage it. However, I'm at a crossroads when it comes to selecting the right backend stack.
I recently came across an explanation by Theo regarding the potential of using Next.js with APIs instead of a traditional backend. This idea has sparked my interest, but I find myself questioning the best path forward. Additionally, with the introduction of the new version of Next.js featuring the app router, I'm facing some architectural considerations.
Given these factors, I'm reaching out to this knowledgeable community to gather insights and suggestions on the most suitable architecture. My intention is to seamlessly integrate Prisma and MySQL into the backend structure. I've even been exploring the possibility of leveraging tRPC.
I greatly value the collective expertise present here and would be incredibly grateful for any thoughts, advice, or recommendations you can share. Your input will undoubtedly assist me in making an informed decision as I navigate through this critical phase of the project.
Thank you for taking the time to read my message. I'm eagerly looking forward to your valuable input.
I recently came across an explanation by Theo regarding the potential of using Next.js with APIs instead of a traditional backend. This idea has sparked my interest, but I find myself questioning the best path forward. Additionally, with the introduction of the new version of Next.js featuring the app router, I'm facing some architectural considerations.
Given these factors, I'm reaching out to this knowledgeable community to gather insights and suggestions on the most suitable architecture. My intention is to seamlessly integrate Prisma and MySQL into the backend structure. I've even been exploring the possibility of leveraging tRPC.
I greatly value the collective expertise present here and would be incredibly grateful for any thoughts, advice, or recommendations you can share. Your input will undoubtedly assist me in making an informed decision as I navigate through this critical phase of the project.
Thank you for taking the time to read my message. I'm eagerly looking forward to your valuable input.
2 Replies
hello 👋
I would advise you to start simple and grow as your needs grow.
Nextjs is capable of being your only backend, consuming and mutating your db with Prisma. No need for trpc (a valuable tech but overkill I think) if you go with server component (to fetch from your db) and server actions (to mutate your data, still alpha, but it’s the future).
I would advise you to start simple and grow as your needs grow.
Nextjs is capable of being your only backend, consuming and mutating your db with Prisma. No need for trpc (a valuable tech but overkill I think) if you go with server component (to fetch from your db) and server actions (to mutate your data, still alpha, but it’s the future).
If you want to stay on stable production-grade features, you can use API routes to mutate your data. It is a more traditional way (clear boundaries between front and back).
You can use classic
You’ll have to learn the diff between client and server components but it should be fine 😉
You can use classic
fetch to post your form data / JSON or swr/react query (starting with fetch will help you to evaluate the need and the benefit of using something else, more complex).You’ll have to learn the diff between client and server components but it should be fine 😉