manicanldes-backend/docs/local-admin.md

14 lines
1.1 KiB
Markdown

# Local admin account
The development-only seed uses the existing one-time owner bootstrap. It creates no committed default password. A local PostgreSQL server must be available using the `DATABASE_URL` in `.env`, and `NODE_ENV` must be `development`.
```sh
pnpm db:generate
pnpm db:deploy
pnpm build
pnpm admin:prepare-local
pnpm admin:seed-local
```
`admin:prepare-local` creates an ignored `.env.local-admin` file with `OWNER_EMAIL=admin@manicandles.local`, organization/name settings and a random password. The command refuses to overwrite it. Read the password from that local file; do not commit or share it. `admin:seed-local` passes those values to the existing bootstrap command and prints only the resulting organization and user IDs. The seed accepts only a development environment with a loopback PostgreSQL URL. A second seed fails if an owner already exists; it does not reset the existing password. Use the normal identity workflow to change credentials. Create production administrators separately using fresh credentials and a controlled deployment procedure.