How dawar-shafaque/library-management-system works
Project type and purpose
• This is a microservices-based library management system implemented in Java/Spring Boot.
• The goal is to manage users, books, and library operations via a set of independently deployable services behind an API gateway and a service registry.
File structure
• Top-level modules:
• user-service
• book-service
• library-service
• library-api-gateway
• library-server
• Each service is a Spring Boot application (has Application.java, controller/, service/, model/, repository/ or dto/).
• library-service uses Feign clients (feign/BookInterface, feign/UserInterface) to call other services.
• library-api-gateway likely uses Spring Cloud Gateway or Zuul for routing.
• library-server is the service registry (Eureka or similar).
• Common files: application.properties in each, Maven wrapper, POMs.
README
• Project title: “library-management-system.”
Main components and interactions
a. Components:
• Client (e.g., Web or Mobile)
• API Gateway (library-api-gateway)
• Service Registry (library-server)
• User Service (user-service)
• Book Service (book-service)
• Library Service (library-service)
• Databases (one per service or shared, depending on config)
• (Optional) Message broker or config server if present later
b. Relationships / Data flows:
• Client → API Gateway for all external calls
• API Gateway → Registers with Service Registry to discover downstream services
• API Gateway routes calls to User, Book or Library Service
• Library Service uses Feign clients to call User Service (to fetch user details) and Book Service (to fetch book info)
c. Architectural patterns / principles:
• Microservices with single responsibility (user, book, library)
• API Gateway pattern for ingress routing and cross-cutting concerns (auth, logging)
• Service Registry for dynamic discovery
• Declarative REST clients (Feign) for inter-service communication
• Each service has its own data store (database per service)
d. Key technologies:
• Java 11+ / Spring Boot
• Spring Cloud Netflix (Eureka, Zuul/Gateway, Feign)
• Maven build system
• REST controllers, DTOs, Repositories (Spring Data JPA)
• H2 or MySQL/PostgreSQL as persistent store (configured in application.properties)
Elements
• Clear labels: service names, database labels (e.g., User-DB, Book-DB, Library-DB), “API Gateway,” “Service Registry.”
• Client → API Gateway
• API Gateway → User Service, Book Service, Library Service
• Library Service → User Service, Library Service → Book Service
• Each service → its own database
• Rectangles for microservices
• Diamond or server rack for Service Registry
Step-by-step approach for the principal software engineer
1. Client at the left.