BookBridge is an API for managing book clubs, supporting endpoints for CRUD operations and managing clubs, users, books, reviews, readlist and etc..
book bridge depends on node.js, mysql and bash.
![Description](https://github.com/gabriel-ferreira-da-silva/gabriel-ferreira-da-silva/raw/main/bash.png?raw=true)
give execution permission to build.sh and all files inside scripts folder
chmod +x build.sh
Then setup the database and build the API with
./build.sh --database --restart
./build.sh --run
to run the test simply type
./build.sh --tests
or manually restart database, rebuild the API and run:
npx jest
In request.sh file you may find examples of curl request such as
TOKEN="$(curl --header "Content-Type: application/json"
--request POST
--data '{"username":"user","password":"user"}'
http://localhost:4000/api/user/login
| jq -r '.token')"
curl --header "Content-Type: application/json" \
--request POST \
--data '{"title":"o vermelho e o negro","isbn":"00033", "token":"'$TOKEN'" }' \
http://localhost:4000/api/book
you can execute it and other endpoints with build:
./build.sh --request --user-create
./build.sh --request --user-login