Skip to content

ecmsp-project/WoodworkingShop-Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

138 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorial how to set up database follow these instructions:

(password = "admin")

  1. open terminal
  2. enter: cd Backend/db
  3. enter: docker-compose up
  4. enter: psql -h localhost -p 5432 -U admin -d wws -f schema_init.sql
  5. enter: psql -h localhost -p 5432 -U admin -d wws -f example_data.sql

Login functionality

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"
}'

Login as admin

use postman and call POST on http://localhost:8080/api/users/login in body (Authorization leave with No)

{
    "username": "admin123",
    "password": "admin123"
}

Add user with role "CLIENT"

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5