docs: updated documentation and scripts
This commit is contained in:
38
README.md
38
README.md
@@ -2,28 +2,22 @@
|
||||
|
||||
## Commands
|
||||
|
||||
Install vercel cli
|
||||
Install dependencies
|
||||
|
||||
```bash
|
||||
yarn add -g vercel@latest
|
||||
yarn
|
||||
```
|
||||
|
||||
Link to vercel
|
||||
Run Postgres on Docker
|
||||
|
||||
```bash
|
||||
yarn vercel:link
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
Pull env variables from vercel
|
||||
Run Prisma migrations
|
||||
|
||||
```bash
|
||||
yarn vercel:env
|
||||
```
|
||||
|
||||
Push Prisma schema to vercel
|
||||
|
||||
```bash
|
||||
yarn db:push
|
||||
yarn prisma:migrate
|
||||
```
|
||||
|
||||
Generate Prisma client
|
||||
@@ -38,8 +32,24 @@ Reset Prisma database
|
||||
yarn db:reset
|
||||
```
|
||||
|
||||
Run on Docker
|
||||
## Auth0 Webhook
|
||||
|
||||
Auth0 Flow to register new users
|
||||
|
||||
```bash
|
||||
docker-compose up --build
|
||||
const axios = require('axios');
|
||||
|
||||
exports.onExecutePostUserRegistration = async (event) => {
|
||||
await axios.post(event.secrets.WEBHOOK_URL, { email: event.user.email }, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${event.secrets.AUTH0_API_SECRET_KEY}`,
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
};
|
||||
```
|
||||
|
||||
Add the following secrets to your Flow:
|
||||
|
||||
- `WEBHOOK_URL`: The URL of your webhook.
|
||||
- `AUTH0_API_SECRET_KEY`: The Auth0 API secret key.
|
||||
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
- '5432:5432'
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
|
||||
|
||||
@@ -10,10 +10,7 @@
|
||||
"format": "prettier --config .prettierrc 'app/' --write",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"prepare": "husky install",
|
||||
"vercel:link": "vercel link",
|
||||
"vercel:env": "vercel env pull .env",
|
||||
"prisma:migrate": "npx prisma migrate dev",
|
||||
"prisma:push": "npx prisma db push",
|
||||
"prisma:generate": "npx prisma generate",
|
||||
"prisma:reset": "npx prisma db push --force-reset"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user