This document provides an overview of the API endpoints available in the Library Management System, using versioning with /v1
and the prefix /lib
.
- Description: Retrieves a list of all books.
- Response:
- 200 OK: Returns a list of books.
- Description: Retrieves a specific book by its ID.
- Parameters:
id
: The ID of the book.
- Response:
- 200 OK: Returns the book details.
- 404 Not Found: If the book does not exist.
- Description: Adds a new book to the library.
- Request Body: JSON object representing the book details.
- Response:
- 201 Created: The book was successfully added.
- Description: Updates an existing book's information.
- Parameters:
id
: The ID of the book.
- Request Body: JSON object with updated book details.
- Response:
- 200 OK: The book was successfully updated.
- 404 Not Found: If the book does not exist.
- Description: Deletes a book from the library.
- Parameters:
id
: The ID of the book.
- Response:
- 200 OK: The book was successfully deleted.
- 404 Not Found: If the book does not exist.
- Description: Retrieves a list of all users.
- Response:
- 200 OK: Returns a list of users.
- Description: Retrieves a specific user by their ID.
- Parameters:
id
: The ID of the user.
- Response:
- 200 OK: Returns the user details.
- 404 Not Found: If the user does not exist.
- Description: Registers a new user.
- Request Body: JSON object representing the user details.
- Response:
- 201 Created: The user was successfully registered.
- Description: Updates an existing user's information.
- Parameters:
id
: The ID of the user.
- Request Body: JSON object with updated user details.
- Response:
- 200 OK: The user was successfully updated.
- 404 Not Found: If the user does not exist.
- Description: Deletes a user from the system.
- Parameters:
id
: The ID of the user.
- Response:
- 200 OK: The user was successfully deleted.
- 404 Not Found: If the user does not exist.
- 404 Not Found: Returned when a requested resource does not exist.
- 400 Bad Request: Returned when the request body is invalid or missing required fields.
- 500 Internal Server Error: Returned when an unexpected error occurs on the server.
- The API currently doesn't implement authentication . Future versions may include user authentication using JWT and authorization.
- Java 17 or higher
- Maven
- Postgresql or another compatible database
- Clone the Repository
git clone https://github.com/ahmedrafat-SW/library-management-system.git