DEV Community

Discussion on: Is it a good idea to build backend with nextJS?

Collapse
 
franciscomendes10866 profile image
Francisco Mendes • Edited

First try to create a minimal viable product with the tools you are used to work with. As for creating a Full Stack app using Next.js, nowadays it is conceivable and you can take advantage of technologies like tRPC.

In case, a few years later, if you want to leave the monolith and split the frontend and the backend, you can reuse the tRPC router and use it with an adapter in an Express api. And if you want to change the frontend framework eventually, you have the possibility to use the vanilla client.

But speaking outside the scope of Next.js, if you want to work with job queues, data processing, etc. I would create a REST or GraphQL api to be honest and to solve most problems I would have in the future I would use a high scope framework like NestJS or Adonis.

If I had an idea and wanted to take the idea off paper and test it with real users, I would choose:

Stack: Next.js + tRPC + Prisma ORM
External services:

  • Vercel
  • Planetscale
  • Upstash

But this question of scale and which tools to use has a lot to be said.
Find the problem you want to solve, then deconstruct it and make it possible with what you know and the things you need to learn. All this takes time and planning.

Cheers mate! 💪

Collapse
 
mozammelh profile image
Mozammel Haque

Thanks for the great overview of the entire thing, Francisco. I would love to checkout your API solution. Make it opensource if possible, and provide an update on dev.to

Collapse
 
franciscomendes10866 profile image
Francisco Mendes • Edited

The tRPC documentation has great guides, if you want to take a look at the adapter for Express you can click on this link.

If you want to read the Next.js guide you can click on this link.