Bootstrap the login identity

Availability: preview

Run these commands from backend/ against dedicated evaluation PostgreSQL and Redis instances.

Terminal window
cp .env.example .env
export MENDRY_ENCRYPTION_KEY="$(openssl rand -base64 32)"

Set MENDRY_POSTGRES_URL and MENDRY_REDIS_URL in the environment or private .env. Keep the encryption key stable for this database.

Terminal window
make run-migrate

Only the migration command changes schema. The API never migrates automatically.

Terminal window
MENDRY_BOOTSTRAP_ADMIN_PASSWORD='replace-with-a-long-random-password' \
make bootstrap-admin USERNAME=admin

The password must contain 12 to 72 bytes. Repeating the command for the same enabled login identity is idempotent and does not replace its password hash. The database permits at most one account; using a different username cannot create a second login identity.

Terminal window
make run-api
curl http://127.0.0.1:8080/livez
curl http://127.0.0.1:8080/readyz
curl http://127.0.0.1:8080/api/v1/system/status

/livez proves the process is alive. /readyz includes PostgreSQL and Redis readiness.

Continue to your first project.

  • backend/README.md
  • backend/cmd/bootstrap-admin/main.go