The Library Management System API provides functionality for managing books, borrowers, transactions, and librarians in a library.
- Introduction
- Frontend Repository
- Setup
- Features
- Endpoints
- Dependencies
- Getting Started
- Building and Running
- License
This API serves as the backend for a library management system, facilitating various operations such as book management, borrower management, transaction handling, and librarian administration.
The frontend for this application is implemented using React.js, providing an intuitive and user-friendly interface for managing the library system.
You can find the frontend repository here: Library Management System - Frontend
- Java 17
- Maven
- MySQL
- JWT Key: A secret key used for JWT token generation and validation is stored in the
application.properties
file. - Default Admin Credentials: Default administrator credentials are set in the
application.properties
file. Default admin email:[email protected]
, password:Admin2721
. - Database Configuration: Configuration for the local database is set in the
application.properties
file (librarydb
on MySQL).
- Book Management: Add, update, delete, and retrieve books. Track book details, availability, and borrowing history.
- Borrower Management: Register borrowers, manage their details and track their borrowing activity.
- Transaction Handling: Record borrowing and return transactions, manage late fees and handle damage fines.
- Librarian Administration: Administer librarian accounts, roles, and permissions.
The API exposes the following endpoints:
/api/v1/books
: Endpoints related to book management./api/v1/borrowers
: Endpoints for borrower management./api/v1/transactions
: Endpoints for handling transactions./api/v1/librarians
: Endpoints for librarian administration./api/v1/auth/login
: Authentication endpoint to obtain a JWT token./api/v1/test
: Endpoint for testing authentication.
The API uses JWT (JSON Web Tokens) for authentication. To authenticate, make a POST request to /api/v1/auth/login
with valid credentials (username and password) to obtain a JWT token. Include this token in the Authorization header for subsequent requests to access secured endpoints.
/api/v1/test
: This endpoint requres valid authentication to access. Upon making a GET request with a valid JWT token in the authorization header, it responds with a 200 OK
status to indicate successful authentication.
- Spring Boot Starter Data JPA
- Spring Boot Starter Web
- Spring Boot Starter security
- JJWT for JWT token handling
- MySQL Connector
- Spring Boot Starter Test for testing purposes
To run this project locally, follow these steps:
- Clone the repository:
git clone <repository_url>
- Set up a MySQL database and configure the application properties accordingly.
- Build the project using Maven or your preferred build tool.
- Run the application.
- Clone this repository.
- Configure your MySQL database and update the
application.properties
file accordingly. - Build the project using Maven:
mvn clean install
. - Run the application using Spring Boot:
mvn spring-boot:run
.
This project is licensed under the MIT License.