Giter VIP home page Giter VIP logo

bookfindar's Introduction

Online Bookstore RESTful API

This document provides an overview of the implementation details for each requirement outlined in the take-home test for the online bookstore RESTful API.

This project implements a simple RESTful API for an online bookstore using Java with the Spring Boot framework. The API allows users to perform CRUD (Create, Read, Update, Delete) operations on books in the store and manage their availability status.

REQUIREMENT

API Implementation

  • Java with Spring Boot Framework: The API is developed using Java with the Spring Boot framework. Spring Boot offers a simplified development experience, providing auto-configuration and dependency management out of the box.

  • Functionality:

    • View Books: Implemented GET /api/v1/books endpoint to retrieve a list of available books.
    • Add Books: Added POST /api/v1/books endpoint to allow users to add new books to the store.
    • Update Book Details: Implemented PUT /api/v1/books/{id} endpoint for updating book details.
    • Delete Books: Added DELETE /api/v1/books/{id} endpoint to delete books from the store.

Each endpoint supports JSON request and response formats.

Database Integration

  • Relational Database: Utilized MySQL as the relational database for storing book data. MySQL provides a robust and scalable solution for managing relational data

  • JPA for Database Interactions : Used SpringDataJPA an implementation of the Java Persistence API for database interactions, providing an object-relational mapping solution for managing entities.

Error Handling

Implemented error handling mechanisms to return appropriate HTTP status codes and error messages in case of invalid requests or errors. This ensures clarity and ease of troubleshooting for clients consuming the API.

Testing

Developed a suite of unit tests to validate the functionality of the API endpoints logic and ensure correctness under various scenarios. Unit tests had a coverage of over 70%.

Security

Authentication: Authentication can be added to API endpoints for enhanced security. This was implemented with Spring Security module, using JWT tokens as the means of authorisation while username/password for authentication.

Setup Instructions

  1. Clone the repository to your local machine:
    git clone [email protected]:masterscode/BookFindar.git              
  1. Navigate to project directory
    cd BookFindar              
  1. Build and run the project using Docker:
    docker-compose up --build              
  1. The API will be accessible at http://localhost:8080/api/v1/book

Default User

Please note that a default user is seeded during application first run. The user log-in credentials are

{
  "username": "[email protected]",
  "password": "password"
}

Documentation

Thank you for reviewing the implementation of the online bookstore RESTful API. If you have any further questions or require additional information, please feel free to reach out.

bookfindar's People

Contributors

masterscode avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.