Book Sharing API for zolo-booky made using Java SpringBoot.
Developed with the software and tools below.
Zolo's Booky application is an app for the Zolo residents to share books with each other. The backend of the application is developed using Java SpringBoot. The backend allows to manage books, appeals, users, images, and notifications. Books refer to the books that are available for sharing or have been shared by the users. Appeals refer to the requests made by the users to borrow a book from another user. Users refer to the residents of Zolo who are using the application. The images are (expected to be) for the book covers. The backend allows searching for books based on the title or author. The backend also allows sending notifications to the users using Firebase.
- The application provides endpoints for creating, updating, deleting, and fetching books, appeals, and users.
- The application also provides endpoints for uploading, fetching, and deleting images.
- Booky also provides endpoints for sending notifications to the users using Firebase.
- The application also provides endpoints for searching books based on the title or author.
βββ zolo-booky-backend/
βββ .github
β βββ workflows
β βββ gradle.yml
β βββ greetings.yml
βββ Dockerfile
βββ README.md
βββ SECURITY.md
βββ Taskfile.yml
βββ build.gradle
βββ compose.yaml
βββ gradle
β βββ wrapper
β βββ gradle-wrapper.jar
β βββ gradle-wrapper.properties
βββ gradlew
βββ gradlew.bat
βββ settings.gradle
βββ src
βββ main
β βββ java
β β βββ com
β β βββ zolobooky
β βββ resources
β βββ application.yaml
β βββ static
β βββ banner.txt
β βββ fire-config.json
βββ test
βββ java
βββ com
βββ zolobooky
.
File | Summary |
---|---|
Dockerfile | Dockerfile for the application. |
Taskfile.yml | Taskfile for the application. |
settings.gradle | Settings for the application. |
compose.yaml | Docker Compose file for the application. |
build.gradle | Gradle build file for the application. |
gradlew.bat | Gradle wrapper for Windows. |
.github.workflows
File | Summary |
---|---|
gradle.yml | GitHub Actions for Gradle. |
greetings.yml | GitHub Actions for Greetings. |
src.main.resources
File | Summary |
---|---|
application.yaml | Configuration file for the application. |
src.main.java.com.zolobooky.booky
File | Summary |
---|---|
OpenApiConfig.java | OpenAPI Configuration file for the application. |
BookyApplication.java | It is the main file that is run to start the project. |
src.main.java.com.zolobooky.booky.helpers
File | Summary |
---|---|
HelperMethods.java | Contains helper methods that are used in the application. |
src.main.java.com.zolobooky.booky.notifications
File | Summary |
---|---|
FireInit.java | Initializes the Firebase App. |
FireController.java | Fire Controller(/v0/fire ), contains endpoints for sending notifications. |
FireService.java | Services for the fire controller. |
src.main.java.com.zolobooky.booky.notifications.FireExceptions
File | Summary |
---|---|
FireSendingError.java | Exception for fire when error occurs while sending notification. |
src.main.java.com.zolobooky.booky.notifications.dto
File | Summary |
---|---|
SendFireDTO.java | Data Transfer Object for Fire Model that will be shown when sending a notification. |
CreateFireDTO.java | Data Transfer Object for Fire Model that is required to create a new notification. |
src.main.java.com.zolobooky.booky.dashboard
File | Summary |
---|---|
DashboardController.java | Root Endpoint(/ ). Returns current time. |
src.main.java.com.zolobooky.booky.users
File | Summary |
---|---|
UserEntity.java | Model of a user being used in the application. |
UserService.java | Services for the users controller. |
UserRepository.java | Helper for getting the data from the database. |
UserController.java | User Controller(/v0/users ), contains endpoints related directly to the user. |
src.main.java.com.zolobooky.booky.users.dto
File | Summary |
---|---|
ListUserDTO.java | Data Transfer Object for User Model that will be shown when list of users is being accessed. |
CreateUserDTO.java | Data Transfer Object for User Model that is required to create a new user. |
src.main.java.com.zolobooky.booky.appeals
File | Summary |
---|---|
AppealController.java | Appeals Controller(/v0/appeals ), contains endpoints related directly to the user. |
AppealEntity.java | Model of an appeal being used in the application. |
AppealRepository.java | Helper for getting the data from the database. |
AppealService.java | Services for the appeals controller. |
src.main.java.com.zolobooky.booky.appeals.dto
File | Summary |
---|---|
CreateAppealDTO.java | Data Transfer Object for Appeal Model that is required to create a new appeal. |
UpdateAppealDTO.java | Data Transfer Object for Appeal Model that is required to update an appeal. |
StatusAppealDTO.java | Data Transfer Object for Appeal Model that is required to change status of an appeal. |
ShortAppealDTO.java | TODO src/main/java/com/zolobooky/booky/appeals/dto/ShortAppealDTO.java |
AppealDTO.java | Data Transfer Object for Appeal Model that all attributes appeal. |
src.main.java.com.zolobooky.booky.appeals.AppealExceptions
File | Summary |
---|---|
AppealAlreadyExistsException.java | Exception for appeal when it already exists. |
AppealNotFoundException.java | Exception for appeal when it doest not exist. |
src.main.java.com.zolobooky.booky.commons
File | Summary |
---|---|
ExceptionResponse.java | Response class that is returned when an exception occurs. |
GlobalExceptionHandler.java | Global exception handlers, handles all the exceptions that occur in the application. |
CustomStatus.java | Statuses for the book and appeals. |
src.main.java.com.zolobooky.booky.books
File | Summary |
---|---|
BookEntity.java | Model of a book being used in the application. |
BookController.java | Books Controller(/v0/books ), contains endpoints related directly to the book. |
BookRepository.java | Helper for getting the data from the database. |
BookService.java | Services for the books controller. |
src.main.java.com.zolobooky.booky.books.BookExceptions
File | Summary |
---|---|
BookAlreadyExistsException.java | Exception for book when it already exists. |
BookNotFoundException.java | Exception for book when it doest not exist. |
BadRequestException.java | Exception for book when invalid request is made. |
src.main.java.com.zolobooky.booky.books.dto
File | Summary |
---|---|
ListBookDTO.java | Data Transfer Object for Book Model that will be shown when list of books is being accessed. |
BookDTO.java | Data Transfer Object for Book Model that all attributes book. |
UpdateBookDTO.java | Data Transfer Object for Book Model that is required to update a book. |
CreateBookDTO.java | Data Transfer Object for Book Model that is required to create a new book. |
src.main.java.com.zolobooky.booky.search
File | Summary |
---|---|
SearchService.java | Services for the search controller. |
SearchController.java | Search Controller(/v0/search ), contains endpoints related directly to the search. |
src.main.java.com.zolobooky.booky.images
File | Summary |
---|---|
BlobService.java | Services for the images controller. |
BlobConfig.java | Configuration for the images controller. |
BlobController.java | Images Controller(/v0/images ), contains endpoints to upload, get and delete images. |
src.main.java.com.zolobooky.booky.images.ImageExceptions
File | Summary |
---|---|
ImageNotFoundExceptions.java | Exception for image when it doest not exist. |
src.test.java.com.zolobooky.booky
File | Summary |
---|---|
BookyApplicationTests.java | Test for the main application. |
BookServiceTest.java | Test for the book service. |
BookAPITestAssets.java | Assets(helper methods, constants) for the book API tests. |
Requirements
Ensure you have the following dependencies installed on your system:
- Java:
version 17
- Clone the zolo-booky-backend repository:
git clone [email protected]:sst-product-team/zolo-booky-backend.git
- Change to the project directory:
cd zolo-booky-backend
- Install the dependencies:
./gradlew clean build
Use the following command to run zolo-booky-backend:
java -jar build/libs/booky-0.0.1-SNAPSHOT.jar
To execute tests, run:
./gradlew test
Contributions are welcome! Here are several ways you can contribute:
- Submit Pull Requests: Review open PRs, and submit your own PRs.
- Report Issues: Submit bugs found or log feature requests for Zolo-booky-backend.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your GitHub account.
- Clone Locally: Clone the forked repository to your local machine using a Git client.
git clone [email protected]:sst-product-team/zolo-booky-backend.git
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to GitHub: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
Once your PR is reviewed and approved, it will be merged into the main branch.
- Team: