The small application provides API for creating and opening decks as well as drawing cards.
- Typescript
- NestJS
- PostgreSQL
- Clone the project:
$ git clone https://github.com/nlevchuk/decks-and-cards.git
- Go to cloned directory and build the application image:
$ make build
$ make up
$ make down
## Create full not suffled deck
curl -X "POST" "http://localhost:3000/decks/create" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"type": "FULL",
"shuffled": false
}'
## Create short not suffled deck
curl -X "POST" "http://localhost:3000/decks/create" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"type": "SHORT",
"shuffled": false
}'
## Create full suffled deck
curl -X "POST" "http://localhost:3000/decks/create" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"type": "FULL",
"shuffled": true
}'
## Create short suffled deck
curl -X "POST" "http://localhost:3000/decks/create" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"type": "SHORT",
"shuffled": true
}'
curl "http://localhost:3000/decks/open?deckId=<DECK ID>"
curl -X "PUT" "http://localhost:3000/decks/draw-cards" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"deckId": "<DECK ID>",
"count": "3"
}'
$ make test
$ make test-e2e