{"id":15091174,"url":"https://github.com/atulsingh11-0/book-store-app","last_synced_at":"2026-03-14T04:07:27.855Z","repository":{"id":245736475,"uuid":"819082980","full_name":"AtulSingh11-0/Book-Store-App","owner":"AtulSingh11-0","description":"A Spring Boot application for managing a bookstore. ","archived":false,"fork":false,"pushed_at":"2024-08-26T18:12:03.000Z","size":131,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-14T05:01:47.291Z","etag":null,"topics":["cloudinary","cloudinary-sdk","docker","hosting","image-handling","java","mongodb","mongodb-atlas","open-api","pagination","render","restful-api","spring-boot","swagger-ui"],"latest_commit_sha":null,"homepage":"https://book-store-app-8ngn.onrender.com/swagger-ui/index.html","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AtulSingh11-0.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-23T18:17:59.000Z","updated_at":"2024-08-26T18:12:06.000Z","dependencies_parsed_at":"2024-10-14T05:01:49.261Z","dependency_job_id":null,"html_url":"https://github.com/AtulSingh11-0/Book-Store-App","commit_stats":{"total_commits":73,"total_committers":2,"mean_commits":36.5,"dds":0.1095890410958904,"last_synced_commit":"669c71fe780e6b936b3ace36daee0416be16e39e"},"previous_names":["atulsingh11-0/book-store-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtulSingh11-0%2FBook-Store-App","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtulSingh11-0%2FBook-Store-App/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtulSingh11-0%2FBook-Store-App/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtulSingh11-0%2FBook-Store-App/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AtulSingh11-0","download_url":"https://codeload.github.com/AtulSingh11-0/Book-Store-App/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219848629,"owners_count":16556333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudinary","cloudinary-sdk","docker","hosting","image-handling","java","mongodb","mongodb-atlas","open-api","pagination","render","restful-api","spring-boot","swagger-ui"],"created_at":"2024-09-25T10:36:12.424Z","updated_at":"2025-12-16T03:57:59.236Z","avatar_url":"https://github.com/AtulSingh11-0.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bookstore Application\n\nA Spring Boot application for managing a bookstore. The application allows for the creation, retrieval, updating, and deletion of book records. It also supports searching books by title or ISBN with pagination and sorting.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Technologies](#technologies)\n- [Setup and Installation](#setup-and-installation)\n- [Usage](#usage)\n- [API Endpoints](#api-endpoints)\n- [Example Responses](#example-responses)\n- [Exception Handling](#exception-handling)\n- [Swagger Documentation](#swagger-documentation)\n\n## Overview\n\nThis application is built using Spring Boot and MongoDB. It provides a RESTful API for managing books in a bookstore.\n\n## Features\n\n- Create, retrieve, update, and delete book records\n- Search books by title or ISBN\n- Pagination and sorting of book records\n- Validation for book data\n- Custom exception handling\n\n## Technologies\n\n- Java 17\n- Spring Boot\n- MongoDB\n- Lombok\n- JPA\n- Maven\n\n## Setup and Installation\n\n### Prerequisites\n\n- Java 17\n- Maven\n- MongoDB\n\n### Installation Steps\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/AtulSingh11-0/Book-Store-App.git\n    cd bookstore-app\n    ```\n\n2. Install the dependencies:\n    ```sh\n    mvn install\n    ```\n\n3. Configure MongoDB in `application.properties`:\n    ```properties\n    spring.data.mongodb.uri=mongodb://localhost:27017/bookstore\n    ```\n\n4. Run the application:\n    ```sh\n    mvn spring-boot:run\n    ```\n\n5. Access the API documentation: [Swagger UI](http://localhost:6969/swagger-ui.html)\n\n## Usage\n\nOnce the application is running, you can interact with the API using tools like Postman or Curl.\n\n## API Endpoints\n\n### Book Endpoints\n\n- **Create a new book**\n    ```http\n    POST /api/v1/books/\n    ```\n    **Request Body (form-data):**\n    ```form-data\n      Content-Type: multipart/form-data\n\n      title: Example Title\n      author: Example Author\n      summary: Example Summary\n      publishYear: 2023\n      isbn: 1234567890123\n      image: [Upload your image file here]\n    ```\n\n- **Update a book**\n    ```http\n    PUT /api/v1/books/{id}\n    ```\n    **Request Body (form-data):**\n    ```form-data\n      Content-Type: multipart/form-data\n\n      title: Example Title\n      author: Example Author\n      summary: Example Summary\n      publishYear: 2023\n      isbn: 1234567890123\n      image: [Upload your image file here]\n    ```\n\n- **Delete a book**\n    ```http\n    DELETE /api/v1/books/{id}\n    ```\n\n- **Get a book by ID**\n    ```http\n    GET /api/v1/books/{id}\n    ```\n\n- **Get all books**\n    ```http\n    GET /api/v1/books?pageNo=0\u0026pageSize=10\u0026sortBy=id\u0026order=asc\n    ```\n\n- **Search books by title**\n    ```http\n    GET /api/v1/books/search-by-title?title=example\u0026pageNo=0\u0026pageSize=10\u0026sortBy=id\u0026order=asc\n    ```\n\n- **Search books by ISBN**\n    ```http\n    GET /api/v1/books/search-by-isbn?isbn=1234567890123\u0026pageNo=0\u0026pageSize=10\u0026sortBy=id\u0026order=asc\n    ```\n\n## Example Responses\n\n**Request:**\n\n- **Create a new book**\n    ```http\n    POST /api/v1/books/\n    ```\n    **Response Body:**\n    ```json\n    {\n      \"status\": \"created\",\n      \"statusCode\": 201,\n      \"message\": \"Book created successfully\",\n      \"data\": {\n        \"id\": \"667beadd7c1711725f248a0a\",\n        \"title\": \"The Martian\",\n        \"author\": \"Andy Weir\",\n        \"summary\": \"A science fiction novel about an astronaut stranded on Mars and his struggle to survive.\",\n        \"publishYear\": 2011,\n        \"isbn\": \"978055341800\",\n        \"image\": {\n            \"id\": \"667beadd7c1711725f248a09\",\n            \"publicId\": \"bookstoreapp/\u003cfilename\u003e_\u003cdate::yyyy-MM-dd\u003e::\u003ctime::HH:mm:ss\u003e\",\n            \"url\": \"\u003cimage_url\u003e/bookstoreapp/\u003cfilename\u003e_\u003cdate::yyyy-MM-dd\u003e::\u003ctime::HH:mm:ss\u003e.png\",\n            \"createdDate\": \"2024-06-26T10:18:05.733+00:00\",\n            \"lastModifiedDate\": \"2024-06-26T10:18:05.733+00:00\"\n        },\n        \"createdDate\": \"2024-06-26T10:18:05.751+00:00\",\n        \"lastModifiedDate\": \"2024-06-26T10:18:05.751+00:00\"\n      }\n    }\n    ```\n\n- **Get a book by ID**\n    ```http\n    GET /api/v1/books/667bdf28d608bd246873c834\n    ```\n    **Response Body:**\n    ```json\n    {\n      \"status\": \"success\",\n      \"statusCode\": 200,\n      \"message\": \"Book retrieved successfully\",\n      \"data\": {\n        \"id\": \"667bdf28d608bd246873c834\",\n        \"title\": \"The Martian\",\n        \"author\": \"Andy Weir\",\n        \"summary\": \"A science fiction novel about an astronaut stranded on Mars and his struggle to survive.\",\n        \"publishYear\": 2011,\n        \"isbn\": \"978055341800\",\n        \"image\": {\n            \"id\": \"667bdf28d608bd246873c833\",\n            \"publicId\": \"bookstoreapp/\u003cfilename\u003e_\u003cdate::yyyy-MM-dd\u003e::\u003ctime::HH:mm:ss\u003e\",\n            \"url\": \"\u003cimage_url\u003e/bookstoreapp/\u003cfilename\u003e_\u003cdate::yyyy-MM-dd\u003e::\u003ctime::HH:mm:ss\u003e.png\",\n            \"createdDate\": \"2024-06-26T09:28:08.030+00:00\",\n            \"lastModifiedDate\": \"2024-06-26T09:28:08.030+00:00\"\n        },\n        \"createdDate\": \"2024-06-26T09:28:08.075+00:00\",\n        \"lastModifiedDate\": \"2024-06-26T09:28:08.075+00:00\"\n      }\n    }\n    ```\n\n- **Delete a book by ID**\n    ```http\n    DELETE /api/v1/books/667bdf28d608bd246873c834\n    ```\n    **Response Body:**\n    ```json\n    {\n      \"status\": \"deleted\",\n      \"statusCode\": 200,\n      \"message\": \"Book deleted successfully\",\n      \"data\": true\n    }\n    ```\n\n## Exception Handling\n\nCustom exception handling is implemented to manage errors gracefully. The following exceptions are handled:\n\n- `BookWithIdNotFoundException`: Thrown when a book with a specific ID is not found.\n- `BookWithIsbnAlreadyExistsException`: Thrown when trying to create a book with an ISBN that already exists.\n- Generic exceptions for other unhandled errors.\n\nExample of an error response:\n```json\n{\n    \"status\": \"error\",\n    \"statusCode\": 404,\n    \"message\": [\n        \"Book not found with id 66794326337c184a7988b0\"\n    ]\n}\n```\n\n## Swagger Documentation\n\nExplore the API using Swagger UI:\n\n- **Swagger UI URL:** [http://localhost:6969/swagger-ui.html](http://localhost:6969/swagger-ui.html)\n\nSwagger UI provides a graphical interface for exploring the endpoints, making it easier to understand and interact with the API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatulsingh11-0%2Fbook-store-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatulsingh11-0%2Fbook-store-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatulsingh11-0%2Fbook-store-app/lists"}