Build a production-grade REST API with Node.js, Express, PostgreSQL, Prisma ORM, JWT, and rate limiting.
Build a robust backend API service featuring user authentication, role-based access control (RBAC), database migrations with Prisma, input validation with Zod, and rate-limiting middleware.
Define User, Role, and Resource entities with relations and indexes in schema.prisma.
1234567891011121314151617181920212223242526datasource db {provider = "postgresql"url = env("DATABASE_URL")}generator client {provider = "prisma-client-js"}model User {id String @id @default(uuid())email String @uniquepassword Stringrole String @default("USER")createdAt DateTime @default(now())posts Post[]}model Post {id String @id @default(uuid())title Stringcontent Stringpublished Boolean @default(false)authorId Stringauthor User @relation(fields: [authorId], references: [id])}