clerk / clerk-prisma-starter

Official Clerk-Prisma starter project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Open in VS Code


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:

  • Clerk as an authentication provider.
  • Prisma for data storage.

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.

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:

  1. Sign up for a Clerk account at http://clerk.dev/.
  2. Clone this repository git clone git@github.com:clerkinc/clerk-prisma-starter.git.
  3. Setup the required API variables from your Clerk project as shown at the example env file.
  4. npm install to install the required dependencies.
  5. Setup your Prisma database, following the instructions at the db folder.
  6. npm run dev and you are good to go.

Deploy to Heroku

Deploy

Contact

If you have any specific use case or anything you would like to ask, please reach out!

About

Official Clerk-Prisma starter project


Languages

Language:TypeScript 97.6%Language:Shell 2.1%Language:JavaScript 0.3%