LAST UPDATE: 10/2019
Follow me: https://www.linkedin.com/in/vitor-cordeiro-921a5697/
This project main objective is provide a CRUD API service that integrates with Google Books API to generate search data for study purposes.
The application works as a rest-api, which stores data from a book in a DynamoDB. The integration with Google takes place at the moment of persistence, in which the application searches for additional information on Google to popularize the Book entity.
Additional technical information:
- The API architeture is base on MVC design pattern;
- All the requests are mapped on BookController class;
- All the errors are handled at CustomGlobalExceptionHandler class;
- The CronConfig class is responsable to schedule calls to Google API;
- SpringBoot;
- Swagger;
- Java 8;
- MongoDB;
- Install SDKMAN
$ curl -s "https://get.sdkman.io" | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk version
- Install Java and Gradle:
$ sdk use java 8
$ sdk use gradle 3.5
-
[OPTIONAL] Install Intellij and Lombok plugin
3.1 Instalar de IDE;
3.2 With the Intellij open, navegate to: File > Settings... > Plugins.
3.3 Install Lombok plugin and restart the IDE.
3.4 Enable the anotation processor by checking "Enable Annotation Processing" at: File > Settings... > Build, Execution, Deployment > Compiler > Annotation Processors
$ gradle buildRun
6.1 Google books:
https://developers.google.com/books/docs/v1/using (Last Visit: 02/12/2020)
6.2 Postman requests (Import and use in Postman):
6.3 API Documentation:
NOTE: If you are running the API, you can access the documentation using the path: ${APPLICATION_DOMAIN}/swagger-ui.html
[GET] /v1/book?q=
[POST] /v1/book
Body: { "title":"String", "libraryCode":"String", "catalogingDate":"String"}
Restrictions:
- Title must be unique;
- Code must be unique and can only contains letters and numbers;
- Cataloging date must be a string with the following format: dd/mm/yyyy
[DELETE] /v1/book/{id}
[PUT] /v1/book/{id}
Body: { "title":"String", "libraryCode":"String", "catalogingDate":"String"}
Restrictions:
- Title must be unique;
- Code must be unique and can only contains letters and numbers;
- Cataloging date must be a string with the following format: dd/mm/yyyy
- Create TESTs;