https://github.com/prisma/chat-with-policy
https://github.com/prisma/chat-with-policy
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/prisma/chat-with-policy
- Owner: prisma
- Created: 2025-02-19T21:26:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-07T15:59:42.000Z (about 1 year ago)
- Last Synced: 2025-06-22T01:46:58.389Z (about 1 year ago)
- Language: TypeScript
- Size: 167 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chat With Policy
## 0. Setup
1. Clone this repository
1. Run `pnpm install`
## 1. Setup Prisma
1. As usual, you need to get Prisma configured.
1. Get your PPg URL and put it in `.env`.
1. Migrate your database against the schema.
## 2. Define your rules
Go to `rules.ts` and define your rules.
## 3. Deploy your rules
Run `pnpm prisma rules deploy ...` to deploy your rules.
To make things simpler, we've created an npm script to deploy the rules.
```sh
pnpm rules:deploy
```
> Check out your `package.json` to see how it's done.
> On the first run it may take a bit of time, because the CLI is downloaded and cached.
> Subsequent runs will be faster, and will only redownload if a new version is available.
## 4. Access your client
The previous step will return a JWT token, that we'll call ``.
Go to `App.tsx` and replace `` with the token you received.
## 5. Execute queries
Run `pnpm dev` to execute your app and start sending queries.