This repo shows an example use case for how you setup Prisma with Clerk to achieve authenticated user access for your data.
Clerk is Hiring!
Would you like to work on Open Source software and help maintain this repository? Apply today https://apply.workable.com/clerk-dev/.
The Starter Posts App allows authenticated users to create posts in the Prisma MongoDB database. Each user can also delete his own posts.
This example app uses:
Authenticating Prisma data access using Clerk works by introducing a thin and customizable access management layer on top of the Prisma generated API for our collection.
- Authenticated resource access requests.
- Manage authenticated resource modification requests.
Another point which seems a major benefit to most is that depending on the nature of the application, the access management logic and the email-attribute enhancement of the Prisma models, can happen fully on the server side transparently from the client code.
To run the example locally you need to:
- Sign up for a Clerk account at http://clerk.dev/.
- Clone this repository
git clone git@github.com:clerkinc/clerk-prisma-starter.git
. - Setup the required API variables from your Clerk project as shown at the example env file.
npm install
to install the required dependencies.- Setup your Prisma database, following the instructions at the
db
folder. npm run dev
and you are good to go.
If you have any specific use case or anything you would like to ask, please reach out!