A simple full-stack Library Management System built using React.js, Spring Boot Microservices, REST APIs, JPA/Hibernate, and PostgreSQL.
The application is designed using a microservices architecture with two independent backend services:
- Book Microservice β manages books
- Member Microservice β manages library members
The React frontend communicates with both microservices using REST APIs and Axios.
The Library Management System provides a simple interface to manage books and library members.
- π Book Management
- π€ Member Management
- β Add books and members
- π View books and members
- βοΈ Update books and members
- ποΈ Delete books and members
- π Get records by ID
- π REST API communication
- ποΈ PostgreSQL database
- π§© Microservices architecture
- βοΈ React.js frontend
React.js Frontend
β
βββββββββββ΄ββββββββββ
β β
βΌ βΌ
Book REST API Member REST API
Port 8081 Port 8082
β β
βΌ βΌ
Book Microservice Member Microservice
β β
Controller Controller
β β
Service Service
β β
Repository Repository
β β
βΌ βΌ
PostgreSQL PostgreSQL
book database member database
- React.js
- Vite
- JavaScript
- React Router DOM
- Axios
- HTML5
- CSS3
- Java 21
- Spring Boot
- Spring Web
- Spring Data JPA
- Hibernate
- Maven
- REST APIs
- PostgreSQL 17
- Visual Studio Code
- Postman
- Git
- GitHub
library-management-system/
β
βββ frontend/
β βββ library-frontend/
β βββ public/
β βββ src/
β β βββ components/
β β βββ pages/
β β β βββ Home.jsx
β β β βββ Books.jsx
β β β βββ Members.jsx
β β βββ services/
β β β βββ bookService.js
β β β βββ memberService.js
β β βββ App.jsx
β β βββ main.jsx
β β βββ index.css
β βββ package.json
β βββ vite.config.js
β
βββ book-service/
β βββ src/
β β βββ main/
β β β βββ java/com/library/book/
β β β β βββ controller/
β β β β βββ service/
β β β β βββ repository/
β β β β βββ entity/
β β β β βββ exception/
β β β βββ resources/
β β β βββ application.properties
β β βββ test/
β βββ pom.xml
β
βββ member-service/
β βββ src/
β β βββ main/
β β β βββ java/com/library/member/
β β β β βββ controller/
β β β β βββ service/
β β β β βββ repository/
β β β β βββ entity/
β β β β βββ exception/
β β β βββ resources/
β β β βββ application.properties
β β βββ test/
β βββ pom.xml
β
βββ README.md
βββ .gitignore
The Book Microservice is responsible for managing library books.
id
title
author
isbn
available
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/books |
Create a book |
| GET | /api/books |
Get all books |
| GET | /api/books/{id} |
Get book by ID |
| PUT | /api/books/{id} |
Update a book |
| DELETE | /api/books/{id} |
Delete a book |
Port: 8081
Base URL: http://localhost:8081/api/books
Database: library_book_db
The Member Microservice is responsible for managing library members.
id
name
email
phone
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/members |
Create a member |
| GET | /api/members |
Get all members |
| GET | /api/members/{id} |
Get member by ID |
| PUT | /api/members/{id} |
Update a member |
| DELETE | /api/members/{id} |
Delete a member |
Port: 8082
Base URL: http://localhost:8082/api/members
Database: library_member_db
React.js
β
Axios
β
Book REST API
β
BookController
β
BookService
β
BookRepository
β
PostgreSQL
React.js
β
Axios
β
Member REST API
β
MemberController
β
MemberService
β
MemberRepository
β
PostgreSQL
Two PostgreSQL databases are used.
Database Name: library_book_db
Port: 5432
Database Name: library_member_db
Port: 5432
The database tables are automatically created/updated by JPA/Hibernate during application startup.
Make sure the following are installed:
Java 21
Node.js
npm
Maven
PostgreSQL 17
Git
You can verify the installations:
java -version
node -v
npm -v
mvn -version
psql --version
git --versiongit clone https://github.com/YOUR_USERNAME/library-management-system.gitMove into the project:
cd library-management-systemOpen PostgreSQL:
psql -U postgresCreate the Book database:
CREATE DATABASE library_book_db;Create the Member database:
CREATE DATABASE library_member_db;Exit PostgreSQL:
\qOpen:
book-service/src/main/resources/application.properties
Configure your PostgreSQL connection.
Example:
spring.application.name=book-service
server.port=8081
spring.datasource.url=jdbc:postgresql://localhost:5432/library_book_db
spring.datasource.username=postgres
spring.datasource.password=${DB_PASSWORD}
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=trueOpen:
member-service/src/main/resources/application.properties
Example:
spring.application.name=member-service
server.port=8082
spring.datasource.url=jdbc:postgresql://localhost:5432/library_member_db
spring.datasource.username=postgres
spring.datasource.password=${DB_PASSWORD}
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=trueNever commit your real PostgreSQL password to GitHub.
The project contains three applications.
cd book-service
mvn spring-boot:runRuns on:
http://localhost:8081
cd member-service
mvn spring-boot:runRuns on:
http://localhost:8082
cd frontend/library-frontend
npm install
npm run devThe frontend normally runs on:
http://localhost:5173
The REST APIs were tested using Postman.
POST http://localhost:8081/api/books
GET http://localhost:8081/api/books
GET http://localhost:8081/api/books/{id}
PUT http://localhost:8081/api/books/{id}
DELETE http://localhost:8081/api/books/{id}
POST http://localhost:8082/api/members
GET http://localhost:8082/api/members
GET http://localhost:8082/api/members/{id}
PUT http://localhost:8082/api/members/{id}
DELETE http://localhost:8082/api/members/{id}
Provides navigation to:
- Books
- Members
Provides:
- View books
- Add books
- Edit books
- Delete books
Provides:
- View members
- Add members
- Edit members
- Delete members
This project is currently designed as a simple learning and portfolio project.
Authentication and authorization are not included.
Future enhancements can include:
- Spring Security
- JWT Authentication
- Role-based authorization
Possible future improvements:
- Spring Cloud API Gateway
- Service Discovery with Eureka
- Docker
- Docker Compose
- Kafka
- Redis
- JWT Authentication
- Role-based access control
- Book borrowing and returning
- Due-date management
- Search and filtering
- Pagination
- Unit testing with JUnit and Mockito
- Integration testing
- CI/CD with GitHub Actions
- AWS deployment
This project demonstrates practical understanding of:
- Java 21
- Spring Boot
- REST API development
- Spring Data JPA
- Hibernate
- PostgreSQL
- Microservices architecture
- React.js
- Axios
- React Router
- CRUD operations
- Frontend-backend integration
- Maven
- Git and GitHub
- API testing with Postman
Manikandan S
Java Full Stack Developer | Spring Boot | Microservices | React.js
This project is created for learning, portfolio, and demonstration purposes.