docs: updated documentation and scripts

This commit is contained in:
Riccardo
2024-07-08 12:16:05 +02:00
parent 19d00d5153
commit ef21fef477
3 changed files with 26 additions and 19 deletions

View File

@@ -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.

View File

@@ -7,7 +7,7 @@ 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

View File

@@ -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"
}, },