docs: updated documentation and scripts
This commit is contained in:
38
README.md
38
README.md
@@ -2,28 +2,22 @@
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
Install vercel cli
|
Install dependencies
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn add -g vercel@latest
|
yarn
|
||||||
```
|
```
|
||||||
|
|
||||||
Link to vercel
|
Run Postgres on Docker
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn vercel:link
|
docker-compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
Pull env variables from vercel
|
Run Prisma migrations
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn vercel:env
|
yarn prisma:migrate
|
||||||
```
|
|
||||||
|
|
||||||
Push Prisma schema to vercel
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn db:push
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Generate Prisma client
|
Generate Prisma client
|
||||||
@@ -38,8 +32,24 @@ Reset Prisma database
|
|||||||
yarn db:reset
|
yarn db:reset
|
||||||
```
|
```
|
||||||
|
|
||||||
Run on Docker
|
## Auth0 Webhook
|
||||||
|
|
||||||
|
Auth0 Flow to register new users
|
||||||
|
|
||||||
```bash
|
```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,9 +7,9 @@ services:
|
|||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
POSTGRES_DB: postgres
|
POSTGRES_DB: postgres
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- '5432:5432'
|
||||||
volumes:
|
volumes:
|
||||||
- postgres-data:/var/lib/postgresql/data
|
- postgres-data:/var/lib/postgresql/data
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres-data:
|
postgres-data:
|
||||||
|
|||||||
@@ -10,10 +10,7 @@
|
|||||||
"format": "prettier --config .prettierrc 'app/' --write",
|
"format": "prettier --config .prettierrc 'app/' --write",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"vercel:link": "vercel link",
|
|
||||||
"vercel:env": "vercel env pull .env",
|
|
||||||
"prisma:migrate": "npx prisma migrate dev",
|
"prisma:migrate": "npx prisma migrate dev",
|
||||||
"prisma:push": "npx prisma db push",
|
|
||||||
"prisma:generate": "npx prisma generate",
|
"prisma:generate": "npx prisma generate",
|
||||||
"prisma:reset": "npx prisma db push --force-reset"
|
"prisma:reset": "npx prisma db push --force-reset"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user