Skip to content

sst-product-team/zolo-booky-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

literature

ZOLO-BOOKY-BACKEND

Book Sharing API for zolo-booky made using Java SpringBoot.

license last-commit repo-top-language repo-language-count

Developed with the software and tools below.

Firebase Apache YAML Org Google
Docker GitHub%20Actions Gradle Spring java


πŸ”— Quick Links


πŸ“ Overview

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.


πŸ“¦ Features

  • 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.

πŸ“‚ Repository Structure

└── 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

🧩 Modules

.
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.

πŸš€ Getting Started

Requirements

Ensure you have the following dependencies installed on your system:

  • Java: version 17

βš™οΈ Installation

  1. Clone the zolo-booky-backend repository:
git clone [email protected]:sst-product-team/zolo-booky-backend.git
  1. Change to the project directory:
cd zolo-booky-backend
  1. Install the dependencies:
./gradlew clean build

πŸ€– Running zolo-booky-backend

Use the following command to run zolo-booky-backend:

java -jar build/libs/booky-0.0.1-SNAPSHOT.jar

πŸ§ͺ Tests

To execute tests, run:

./gradlew test

🀝 Contributing

Contributions are welcome! Here are several ways you can contribute:

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your GitHub account.
  2. 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
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to GitHub: Push the changes to your forked repository.
    git push origin new-feature-x
  7. 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.


πŸ‘ Acknowledgments

Return


About

Backend for Zolo Book Sharing Application

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published