clerk-prisma-starter
clerk-prisma-starter copied to clipboard
Official Clerk-Prisma starter project
Clerk - Prisma example repo
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/.
Starter Posts App
The Starter Posts App allows authenticated users to create posts in the Prisma MongoDB database. Each user can also delete his own posts.
Under the hood
This example app uses:
Where the magic happens
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.
User authentication logic transparent from the client
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.
Running the example
To run the example locally you need to:
- Sign up for a Clerk account at http://clerk.dev/.
- Clone this repository
git clone [email protected]:clerkinc/clerk-prisma-starter.git. - Setup the required API variables from your Clerk project as shown at the example env file.
npm installto install the required dependencies.- Setup your Prisma database, following the instructions at the
dbfolder. npm run devand you are good to go.
Deploy to Heroku
Contact
If you have any specific use case or anything you would like to ask, please reach out!