# shubh-bhikadiya/library-management-system architecture

> Architecture diagram of the GitHub repository shubh-bhikadiya/library-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shubh-bhikadiya/library-management-system
- Repository: https://github.com/shubh-bhikadiya/library-management-system

## Overview

This is a command-line library management system: users submit pipe-delimited commands to add catalog items and members, borrow and return items, advance the library day, and request search, inventory, loan, and overdue reports. CommandProcessor dispatches these operations to Library, which owns catalog, member, and active-loan state; Loan calculates lateness and fines. Item and member subtypes supply their domain-specific behavior. The excerpts support the main dispatch and circulation flow; Main’s wiring is not excerpted, and there is no README describing additional capabilities.

Main entry points: [`Library.java`](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Library.java) (Library operations), [`CommandProcessor.java`](https://github.com/shubh-bhikadiya/library-management-system/blob/main/CommandProcessor.java) (Command processor), [`LibraryItem.java`](https://github.com/shubh-bhikadiya/library-management-system/blob/main/LibraryItem.java) (Catalog item model), [`LibraryException.java`](https://github.com/shubh-bhikadiya/library-management-system/blob/main/LibraryException.java) (Library exception base)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Command runtime"]
  node_main["Application entry<br/>[Main.java]"]
  node_commands["Command processor"]
end

subgraph group_catalog["Catalog"]
  node_item["Catalog item model<br/>[LibraryItem.java]"]
  node_book["Book<br/>[Book.java]"]
  node_magazine["Magazine<br/>[Magazine.java]"]
  node_reference["Reference book<br/>[ReferenceBook.java]"]
  node_itemtype["Item types<br/>[ItemType.java]"]
  node_borrowable["Borrowing rules<br/>[Borrowable.java]"]
end

subgraph group_circulation["Circulation"]
  node_library["Library operations<br/>[Library.java]"]
  node_loan["Loan and fines<br/>[Loan.java]"]
end

subgraph group_membership["Membership and errors"]
  node_member["Member model<br/>[Member.java]"]
  node_student["Student member<br/>[Student.java]"]
  node_staff["Staff member<br/>[Staff.java]"]
  node_faculty["Faculty member<br/>[Faculty.java]"]
  node_libraryexception["Library exception base"]
  node_borrowlimit["Borrow limit error"]
  node_itemunavailable["Unavailable item error"]
  node_itemnotfound["Missing item error"]
  node_itemnotloan["Not-on-loan error"]
  node_membernotfound["Missing member error"]
end

node_user(("Library user"))

node_user -->|"enters commands"| node_commands
node_main -.->|"starts processor"| node_commands
node_commands -->|"dispatches operations"| node_library
node_commands -->|"creates"| node_book
node_commands -->|"creates"| node_magazine
node_commands -->|"creates"| node_reference
node_commands -->|"creates"| node_student
node_commands -->|"creates"| node_staff
node_commands -->|"creates"| node_faculty
node_library -->|"stores and searches"| node_item
node_library -->|"stores and checks"| node_member
node_library -->|"creates and evaluates"| node_loan
node_library -->|"checks borrowing"| node_borrowable
node_library -->|"throws"| node_itemnotfound
node_library -->|"throws"| node_membernotfound
node_library -->|"throws"| node_itemunavailable
node_library -->|"throws"| node_borrowlimit
node_library -->|"throws"| node_itemnotloan
node_book -->|"extends"| node_item
node_magazine -->|"extends"| node_item
node_reference -->|"extends"| node_item
node_book -->|"implements"| node_borrowable
node_magazine -->|"implements"| node_borrowable
node_book -->|"returns type"| node_itemtype
node_magazine -->|"returns type"| node_itemtype
node_reference -->|"returns type"| node_itemtype
node_student -.->|"extends"| node_member
node_staff -->|"extends"| node_member
node_faculty -->|"extends"| node_member
node_item -->|"declares type"| node_itemtype
node_borrowlimit -->|"extends"| node_libraryexception
node_itemunavailable -->|"extends"| node_libraryexception
node_itemnotfound -->|"extends"| node_libraryexception
node_itemnotloan -->|"extends"| node_libraryexception
node_membernotfound -->|"extends"| node_libraryexception
node_commands -->|"handles"| node_membernotfound

click node_main "https://github.com/shubh-bhikadiya/library-management-system/blob/main/Main.java"
click node_commands "https://github.com/shubh-bhikadiya/library-management-system/blob/main/CommandProcessor.java"
click node_library "https://github.com/shubh-bhikadiya/library-management-system/blob/main/Library.java"
click node_item "https://github.com/shubh-bhikadiya/library-management-system/blob/main/LibraryItem.java"
click node_book "https://github.com/shubh-bhikadiya/library-management-system/blob/main/Book.java"
click node_magazine "https://github.com/shubh-bhikadiya/library-management-system/blob/main/Magazine.java"
click node_reference "https://github.com/shubh-bhikadiya/library-management-system/blob/main/ReferenceBook.java"
click node_itemtype "https://github.com/shubh-bhikadiya/library-management-system/blob/main/ItemType.java"
click node_borrowable "https://github.com/shubh-bhikadiya/library-management-system/blob/main/Borrowable.java"
click node_member "https://github.com/shubh-bhikadiya/library-management-system/blob/main/Member.java"
click node_student "https://github.com/shubh-bhikadiya/library-management-system/blob/main/Student.java"
click node_staff "https://github.com/shubh-bhikadiya/library-management-system/blob/main/Staff.java"
click node_faculty "https://github.com/shubh-bhikadiya/library-management-system/blob/main/Faculty.java"
click node_loan "https://github.com/shubh-bhikadiya/library-management-system/blob/main/Loan.java"
click node_libraryexception "https://github.com/shubh-bhikadiya/library-management-system/blob/main/LibraryException.java"
click node_borrowlimit "https://github.com/shubh-bhikadiya/library-management-system/blob/main/BorrowLimitExceededException.java"
click node_itemunavailable "https://github.com/shubh-bhikadiya/library-management-system/blob/main/ItemNotAvailableException.java"
click node_itemnotfound "https://github.com/shubh-bhikadiya/library-management-system/blob/main/ItemNotFoundException.java"
click node_itemnotloan "https://github.com/shubh-bhikadiya/library-management-system/blob/main/ItemNotOnLoanException.java"
click node_membernotfound "https://github.com/shubh-bhikadiya/library-management-system/blob/main/MemberNotFoundException.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_commands,node_user toneBlue
class node_item,node_book,node_magazine,node_reference,node_itemtype,node_borrowable toneAmber
class node_library,node_loan toneMint
class node_member,node_student,node_staff,node_faculty,node_libraryexception,node_borrowlimit,node_itemunavailable,node_itemnotfound,node_itemnotloan,node_membernotfound toneRose
```

## Components

### Command runtime

- [Application entry](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Main.java): `Main.java`
- [Command processor](https://github.com/shubh-bhikadiya/library-management-system/blob/main/CommandProcessor.java): `CommandProcessor.java`

### Catalog

- [Catalog item model](https://github.com/shubh-bhikadiya/library-management-system/blob/main/LibraryItem.java): `LibraryItem.java`
- [Book](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Book.java): `Book.java`
- [Magazine](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Magazine.java): `Magazine.java`
- [Reference book](https://github.com/shubh-bhikadiya/library-management-system/blob/main/ReferenceBook.java): `ReferenceBook.java`
- [Item types](https://github.com/shubh-bhikadiya/library-management-system/blob/main/ItemType.java): `ItemType.java`
- [Borrowing rules](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Borrowable.java): `Borrowable.java`

### Circulation

- [Library operations](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Library.java): `Library.java`
- [Loan and fines](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Loan.java): `Loan.java`

### Membership and errors

- [Member model](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Member.java): `Member.java`
- [Student member](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Student.java): `Student.java`
- [Staff member](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Staff.java): `Staff.java`
- [Faculty member](https://github.com/shubh-bhikadiya/library-management-system/blob/main/Faculty.java): `Faculty.java`
- [Library exception base](https://github.com/shubh-bhikadiya/library-management-system/blob/main/LibraryException.java): `LibraryException.java`
- [Borrow limit error](https://github.com/shubh-bhikadiya/library-management-system/blob/main/BorrowLimitExceededException.java): `BorrowLimitExceededException.java`
- [Unavailable item error](https://github.com/shubh-bhikadiya/library-management-system/blob/main/ItemNotAvailableException.java): `ItemNotAvailableException.java`
- [Missing item error](https://github.com/shubh-bhikadiya/library-management-system/blob/main/ItemNotFoundException.java): `ItemNotFoundException.java`
- [Not-on-loan error](https://github.com/shubh-bhikadiya/library-management-system/blob/main/ItemNotOnLoanException.java): `ItemNotOnLoanException.java`
- [Missing member error](https://github.com/shubh-bhikadiya/library-management-system/blob/main/MemberNotFoundException.java): `MemberNotFoundException.java`

### Other components

- **Library user**

## Connections

- Library user → Command processor: enters commands (evidence: `CommandProcessor.java`)
- Application entry → Command processor: starts processor (evidence: `Main.java`)
- Command processor → Library operations: dispatches operations (evidence: `CommandProcessor.java`)
- Command processor → Book: creates (evidence: `CommandProcessor.java`)
- Command processor → Magazine: creates (evidence: `CommandProcessor.java`)
- Command processor → Reference book: creates (evidence: `CommandProcessor.java`)
- Command processor → Student member: creates (evidence: `CommandProcessor.java`)
- Command processor → Staff member: creates (evidence: `CommandProcessor.java`)
- Command processor → Faculty member: creates (evidence: `CommandProcessor.java`)
- Library operations → Catalog item model: stores and searches (evidence: `Library.java`)
- Library operations → Member model: stores and checks (evidence: `Library.java`)
- Library operations → Loan and fines: creates and evaluates (evidence: `Library.java`)
- Library operations → Borrowing rules: checks borrowing (evidence: `Library.java`)
- Library operations → Missing item error: throws (evidence: `Library.java`)
- Library operations → Missing member error: throws (evidence: `Library.java`)
- Library operations → Unavailable item error: throws (evidence: `Library.java`)
- Library operations → Borrow limit error: throws (evidence: `Library.java`)
- Library operations → Not-on-loan error: throws (evidence: `Library.java`)
- Book → Catalog item model: extends (evidence: `Book.java`)
- Magazine → Catalog item model: extends (evidence: `Magazine.java`)
- Reference book → Catalog item model: extends (evidence: `ReferenceBook.java`)
- Book → Borrowing rules: implements (evidence: `Book.java`)
- Magazine → Borrowing rules: implements (evidence: `Magazine.java`)
- Book → Item types: returns type (evidence: `Book.java`)
- Magazine → Item types: returns type (evidence: `Magazine.java`)
- Reference book → Item types: returns type (evidence: `ReferenceBook.java`)
- Student member → Member model: extends (evidence: `Student.java`)
- Staff member → Member model: extends (evidence: `Staff.java`)
- Faculty member → Member model: extends (evidence: `Faculty.java`)
- Catalog item model → Item types: declares type (evidence: `LibraryItem.java`)
- Borrow limit error → Library exception base: extends (evidence: `BorrowLimitExceededException.java`)
- Unavailable item error → Library exception base: extends (evidence: `ItemNotAvailableException.java`)
- Missing item error → Library exception base: extends (evidence: `ItemNotFoundException.java`)
- Not-on-loan error → Library exception base: extends (evidence: `ItemNotOnLoanException.java`)
- Missing member error → Library exception base: extends (evidence: `MemberNotFoundException.java`)
- Command processor → Missing member error: handles (evidence: `CommandProcessor.java`)
