Giter Club home page Giter Club logo

wizler's Introduction

Introduction

This is a Java Spring Boot REST API for a library application with two tables: books and category. The API allows users to perform CRUD (Create, Read, Update, Delete) operations on these tables.

The API utilizes PostgreSQL for data storage.

Installation

To use this API, you'll need to have Java and PostgreSQL installed on your machine.

Clone the repository to your local machine Open the project in your preferred IDE Update the application.properties file with your PostgreSQL database credentials Build the project using mvn clean install Run the application using mvn spring-boot:run

Usage

Once the application is running, you can use an HTTP client like Postman to interact with the API.

The following endpoints are available:

Books

GET /books Retrieves all books in the database.

POST /books - Adds a new book to the database.

DELETE /books/ - Deletes a book by ID.

PUT /books/ - Updates a book by ID.

Category

GET /category - Retrieves all categories in the database.

POST /category - Adds a new category to the database.

PUT /category/ - Updates a category by ID.

DELETE /category/ - Deletes a category by ID.

Request and Response Formats GET Requests For GET requests, the API will return a JSON array of objects.

POST and PUT Requests For POST and PUT requests, the API expects JSON data in the request body.

Here's an example of a POST request body for adding a new book:

{ "title": "The Great Gatsby", "author": "F. Scott Fitzgerald", "category_id": "uufi-458-9595" }

DELETE Requests

For DELETE requests, the API will return a success message if the record was deleted successfully.

Conclusion

That's a simple documentation for your library app. Implementation of the favourite books aspect was not included in this and the reason was that it would involve creating a user table which is outside the scope of this implementation.

wizler's People

Contributors

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