This is a private app to solve the skill test
yarn install
yarn serve
yarn build
yarn lint
Linter is setup to fix automatically your files on save within your IDE so you don't usually have to worry about linter
Use the makefile to start docker actions. Help will show you the different options
make help
make prod
make dev
make stop
make dev will start dev server with hot reload on linux but hot reloading will not work on windows OS. An option for windows developers is to run this project inside wsl2. Another option for local development into windows is to not use docker but just yarn serve, which will perform better.
Api backend service has been mocked through miragejs.com This service only worries about auth login action. Books api endpoints are passed through in mirage router to allow external data fetching.
Theese users are available to login
user: mipass
admin: admin
user2: mipass2
Routing guards prevent to access app if no Bearer token is present. Bearer token is obtained and saved into store from mock api.
- App doesn't handle token expiration and renewal
- Post Content-Type should be x-www-form-urlencoded but mock api only supports application/json
- Password should be sent encrypted instead of plain text, but this is for another scope.
Books api documentation is available here
- Api doesn't handle filtering options with a single query parameter so filtering as is specified on section 5 has to be done on client side.
- Pagination on the other side is handled within api param "page" so this action is done server side.
- Post action is very confusing. I followed documentation and errors returned doesn't give any clue of what was wrong. I'm printing errors returned from api in an error field but can't solve them as i don't know what's wrong in many cases. In any case front input validation is applied and network inspection shows how the request is being sent. Reviews also cannot be added in this action. Even documentation test fails.