Skip to content

regis-mugisha/book-review-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Book Review API

A RESTful API for managing book reviews, allowing users to create, read, update, and delete books and their associated reviews.

Table of Contents

Features

  • Create, read, update, and delete books
  • Add, update, and delete reviews for specific books
  • H2 in-memory database for quick setup and testing
  • Swagger documentation for easy API exploration

Technologies Used

  • Java - Programming language
  • Spring Boot - Framework for building the API
  • Spring Data JPA - Simplifies database access
  • H2 Database - In-memory database for development and testing
  • Lombok - Reduces boilerplate code
  • Swagger - API documentation and testing interface

Installation

  1. Clone the repository:
    git clone https://github.com/regis-mugisha/book-review-api.git
  2. Navigate to the project directory:
    cd book-review-api
  3. Build the project using Maven:
    mvn clean install
  4. Run the application:
    mvn spring-boot:run

Usage

  1. Once the application is running, you can access the API documentation at: http://localhost:8080/api-docs

  2. You can also explore the API using Swagger UI at: http://localhost:8080/swagger-ui.html

API Endpoints

Books

  • Get all books
  • GET /api/v1/books
  • Get book by ID
  • GET /api/v1/books/{bookId}
  • Create a new book
  • POST /api/v1/books
  • Update a book
  • PUT /api/v1/books/{bookId}
  • Delete a book
  • DELETE /api/v1/books/{bookId}

Reviews

  • Get all reviews for a book
  • GET /api/v1/books/{bookId}/reviews
  • Add a review to a book
  • POST /api/v1/books/{bookId}/reviews
  • Update a review
  • PUT /api/v1/books/{bookId}/reviews/{reviewId}
  • Delete a review
  • DELETE /api/v1/books/{bookId}/reviews/{reviewId}

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add new feature').
  5. Push to the branch (git push origin feature-branch).
  6. Open a Pull Request.

About

Book Review API using Spring Boot 3

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages