- open terminal
- enter:
cd Backend/db - enter:
docker-compose up - enter:
psql -h localhost -p 5432 -U admin -d wws -f schema_init.sql - enter:
psql -h localhost -p 5432 -U admin -d wws -f example_data.sql
create admin user (if you don't know password for one added to db as me if you know you can omit this step)
curl -X POST http://localhost:8080/api/internal/user \
-u internal-admin:internal-passwd \
-H "Content-Type: application/json" \
-d '{
"username": "admin123",
"email": "admin123@example.com",
"password": "admin123",
"streetAddress": "Szkolna 2",
"postalCode": "32-020",
"city": "Wieliczka",
"nip":"456789073838",
"phoneNumber":"432-323-211",
"role": "administrator"
}'
use postman and call POST on http://localhost:8080/api/users/login in body (Authorization leave with No)
{
"username": "admin123",
"password": "admin123"
}
use postman and call POST on http://localhost:8080/api/users in body (Authorization leave with No)
{
"username": "client123",
"email": "client123@example.com",
"password": "client123",
"streetAddress": "Szkolna 2",
"postalCode": "32-020",
"city": "Wieliczka",
"nip":"456789073838",
"phoneNumber":"432-323-211",
"role": "klient"
}Now you have admin and client to login