'Prisma in Backend Directory or Frontend Directory? [closed]

Where's the right project directory to put Prisma ? Backend Directory/Server or Frontend Directory/Server ?

Going for an Webapp with Nextjs, NextAuth(MagicLink), Prisma and PostgreSQL.

Every example that I see people use prisma inside Next folder which is frontend.



Solution 1:[1]

Yes you can separate frontend and backend to two different servers and Prisma should ideally be in the backend.

Here is a blog post which describes the best practices and a demo to create web app using NextAuth and Prisma.

Here is an official prisma-example to get you started with NextAuth and Prisma and also demonstrated the ideal practices which should be followed.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nurul Sundarani