Prisma

Prisma

Application and Data / Data Stores / Object Relational Mapper (ORM)
Application Developer at KPI suite tech·
Needs advice
on
PrismaPrisma
and
SequelizeSequelize

Can you help me with the following:

  1. What additional functionality is present in Prisma when compared with Sequelize?
  2. Is getter and setter method available in Prisma? If then please provide any reference or resource.
  3. Is Hooks, hierarchy present in Prisma?
READ MORE
4 upvotes·126.6K views
Replies (1)
Recommends
on
Sequelize
  1. The key things to know about Prisma is that it is Typescript native, and that it (intentionally) does not support downward migrations.

  2. Prisma does not natively support the Getter/Setter pattern, but you can choose to implement middlewares to accomplish the same outcome. You may also want to consider custom client queries

  3. Prisma does not currently do hooks in the same sense as sequelize does hooks. Middleware would however enable you to create a similar construct. Please refer to this thread to see the discussion.

READ MORE
4 upvotes·99 views
Front End Developer ·
Needs advice
on
Next.jsNext.jsPostgreSQLPostgreSQL
and
PrismaPrisma

Hi everyone, I need to make a website for a moving company. The website features include users with three different roles, payment methods, tracking, quotes, and admin. I was thinking of using next.js with Prisma to build it, but I don't know if this tool will work in this case basically Next.js will communicate through Prisma to our PostgreSQL db and save the data of our users, quotes, and everything we catch on the front end.

I really need your advice, thank you in advance

READ MORE
9 upvotes·27.1K views
Replies (1)
Cofounder & CTO at KSDAC LLP·
Recommends
on
PostgreSQL
Prisma

First off, that seems like a pretty solid draft. That being said, you might want to give the following some thought -

  1. Build the frontend in Next.js and use rest calls to a separate api server.
  2. Use Nest.js to create your api layer. It supports Prisma and is a really mature framework.
  3. If most of your apps functionality is auth walled (ie. users need to be logged in to see the pages) you might find Remix interesting as it gives you a must more performant alternative to Next.js for the frontend.
READ MORE
3 upvotes·7.5K views
Needs advice
on
HasuraHasuraNode.jsNode.js
and
PostgreSQLPostgreSQL

Hey guys! I am looking for some advice. I would like to start learning new technologies but I am confused about some concepts:

My objective is to have a Next.js frontend application (which will be getting data from a custom API), and a backend web app running ExpressJS.

I would like to use GraphQL, so I found that I can use Hasura to expose the PostgreSQL data directly to the frontend, so my question is: is it possible for the backend to connect to Hasura and do CRUD on the database or should I use something like Prisma + Graphql?

Could you please give an example of a working application using these technologies, or an approach on how you will implement it? Thanks!

A simple diagram of what I think could be implemented: https://miro.com/app/board/uXjVOow62HA=/?share_link_id=548654600442

READ MORE
8 upvotes·91.2K views
Replies (1)
Software Engineer at Hobbyist/Early Startups·
Needs advice
on
Next.jsNext.js
and
Nuxt.jsNuxt.js

SaaS project and need to decide on a front-end framework. Will use Node.js for restful API services, and PostgreSQL for the database. Possibly introduce Prisma/Apollo if required. Infrastructure is likely to be AWS. This is a business to business SaaS project, not the consumer. 1-2K potential org subscribers, where the orgs are small businesses with 1-15 employees. The product would be used daily, mostly serving the North American market. I'm struggling with what front-end framework. I lean towards Vue.js/ Nuxt.js as it's what I have the most experience with, it's an easier learning curve for new inexperienced developers, and it had great growth in recent years. However, React/Next.js are established frameworks, with a larger community but a steeper learning curve (if I can't get intermediate to senior react developers) and I haven't worked with it. I'm looking for not answers, but advice from the community regarding what other factors I should be considering when deciding. This is a new project (not a re-write of an existing one). Appreciate everyone's feedback.

READ MORE
5 upvotes·36.3K views
Needs advice
on
DjangoDjango
and
Node.jsNode.js
in

Situation: I need to make a website for my Final Year Project. It's the website for brain analysis. The website features include chat, blogs, posts, users, payment methods. One of the main features includes the use of AI, which I know only in Python.

Decisions and Confusions: I decided to make two backends and one front-end. One backend will be using Django with GraphQL/RestAPI that will be running my AI models. The other backend is for the website. It will add users, chat, post, etc. I'm thinking of using TypeScript, Prisma, ExpressJS, GraphQL, MongoDB/PostgreSQL.

Please guide me to the latest and stable tech stack I can use. Because one of the requirements of our Final Year Project is to use the latest tech stacks. 1st Backend advice? (This will be used to run AI models) 2nd Backend advice? Frontend to 2nd Backend advice?

Thank you.

READ MORE
7 upvotes·118.4K views
Replies (2)

Hey there 👋,

Daniel from the Prisma team here.

I think your choice of a stack would work well for your final year project.

Some recommendations: - Use PostgreSQL if you need a stable stack. Prisma support for MongoDB is currently in Preview and therefore isn't stable. Moreover, PostgreSQL being a relational database enforces a schema more strictly than MongoDB which is useful given that your data model involves multiple relations. - If your Django backend exposes a REST API, you can also expose it over the GraphQL API by proxying requests from the GraphQL API to the REST API. That way, you have a unified API for all operations. This is typically known as wrapping. - Regarding the GraphQL part, I would consider looking at Nexus and nexus-prisma.

For inspiration, check out the Prisma Examples ​repository which contains many ready-to-run examples.

Here's another fully-fledged example using Prisma, Fastify, GraphQL, and PostgreSQL: https://github.com/2color/fastify-graphql-nexus-prisma

READ MORE
6 upvotes·91.2K views
Recommends
on
FastAPI
Kubernetes

Hi. Maybe you can try use FastAPI instead Django https://fastapi.tiangolo.com It could be faster. The FastAPI documentation is so useful and elegant.

Also you can try split a little more the backend and use an "microservice" architecture. Using Kubernetes to deploy your services.

READ MORE
2 upvotes·74.9K views