Closed some-user123 closed 2 years ago
Hi, I am working on project where I want to combine an nestjs api, prisma and a nextjs FE all in one monorepo and dockerized. I am following this course. Sometimes it can be tricky, especially if you want to use containers in development. I agree, nestjs deserves a more 'production-ready' starter as it is not easy to make things working.
I'm currently using NestJS with with Next.js in a yarn workspace context, i don't have any issues with it so far. The NestJS app is dockerized too.
@yassinebridi Do you mind sharing a link to the repo?
It's a private repo unfortunately, but i will make a minimal repo when i have time.
Here is a great example for monorepo including Nestjs + Prisma: https://github.com/alitnk/nest-prisma-monorepo
Maybe its also valid to look into Nx or Turborepo. Awesome video by fireship about monorepos.
Hi,
thanks a lot for this starter, really appreciate it!
I'm trying to put this starter together with same frontend project in the same repo using yarn workspaces.
My approach so far:
apps/api/
package.json
like this:yarn install
yarn workspace nestjs-prisma-client-starter start:dev
That works for the starter. However, for my existing project with frontend included already I'm experiencing several issues (e.g. nest-cli-plugins not working, VSCode configuration getting tricky, ...). I haven't really found out why (maybe the hoisting is problem...) and it is difficult to debug (for me).
I would assume having a frontend as well is kind of usual and I'm not the only one facing this problem ;-)
What is the standard way to approach this challenge?
I know, that Nestjs has some its own support for monorepos (https://docs.nestjs.com/cli/monorepo). However, this approach does not allow to have a different dependencies (
package.json
) etc. per app (which I would like to have to avoid dependency problems...).Is there some middle ground between keeping everything in separate repos and completely sharing all dependencies, that is proven and well established in the community?