add admin user

This commit is contained in:
root
2026-05-17 17:10:29 -04:00
parent 8be98062b2
commit 0b73504455
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -196,6 +196,21 @@ npm run docker:prod:up
docker compose -p rentaldrivego-prod --env-file .env.docker.production -f docker-compose.production.yml run --rm api npm run db:deploy
```
#### Create the first production admin
The repo includes a seed that creates the first `SUPER_ADMIN` if that email does not already exist.
```bash
docker compose -p rentaldrivego-prod --env-file .env.docker.production -f docker-compose.production.yml run --rm \
-e ADMIN_SEED_EMAIL=rentaldrivego@gmail.com \
-e ADMIN_SEED_PASSWORD='Qwerty00!@#$%' \
-e ADMIN_SEED_FIRST_NAME=Super \
-e ADMIN_SEED_LAST_NAME=Admin \
api npm run db:seed:admin
```
Then sign in at `https://rentaldrivego.ma/admin/login` and create any additional admin users from the admin panel.
#### View logs
```bash
+1
View File
@@ -21,6 +21,7 @@
"db:push": "turbo db:push",
"db:migrate": "turbo db:migrate",
"db:seed": "turbo db:seed",
"db:seed:admin": "npm run db:seed --workspace @rentaldrivego/database",
"db:studio": "cd packages/database && npx prisma studio"
},
"devDependencies": {