# ibraheem-siddiqui/library-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/ibraheem-siddiqui/library-management-system
- Repository: https://github.com/ibraheem-siddiqui/library-management-system

## Overview

This is a menu-driven Java library manager. A user enters through the console menus; Main loads the Library state and routes book, patron, borrowing, return, and hold operations to the library logic. Library maintains sorted catalog and patron lists, performs searches and circulation updates, and reads or saves CSV-backed records. Book and Patron provide the domain models and validation, with Fiction and NonFiction specializing Book. The README documents the major capabilities; unsampled menu and persistence details are represented only where documented.

Main entry points: [`lib_mng_sys/Library.java`](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Library.java) (Library operations), [`lib_mng_sys/Main.java`](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Main.java) (Console menus), [`lib_mng_sys/Book.java`](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Book.java) (Book model), [`lib_mng_sys/Patron.java`](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Patron.java) (Patron model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Console interface"]
  node_main["Console menus<br/>[Main.java]"]
end

subgraph group_catalog["Catalog and models"]
  node_library["Library operations<br/>[Library.java]"]
  node_book["Book model<br/>[Book.java]"]
  node_fiction["Fiction books<br/>[Fiction.java]"]
  node_nonfiction["Nonfiction books<br/>[NonFiction.java]"]
end

subgraph group_circulation["Patron and circulation"]
  node_patron["Patron model<br/>[Patron.java]"]
end

subgraph group_storage["File storage"]
  node_catalogfile[("Book catalog<br/>[library.csv]")]
  node_patronfile[("Patron records<br/>[patrons.csv]")]
  node_runfile["Run counter<br/>[write.txt]"]
end

node_user(("Library user"))

node_user -->|"selects actions"| node_main
node_main -->|"loads and operates"| node_library
node_main -->|"routes menus"| node_library
node_library -->|"creates and compares"| node_book
node_fiction -->|"extends"| node_book
node_nonfiction -->|"extends"| node_book
node_library -->|"loads and manages"| node_patron
node_main -->|"routes patron menus"| node_patron
node_main -->|"requests circulation"| node_library
node_library -->|"loads and saves"| node_catalogfile
node_library -->|"loads and saves"| node_patronfile
node_library -->|"tracks runs"| node_runfile

click node_main "https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Main.java"
click node_library "https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Library.java"
click node_book "https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Book.java"
click node_fiction "https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Fiction.java"
click node_nonfiction "https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/NonFiction.java"
click node_patron "https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Patron.java"
click node_catalogfile "https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/library.csv"
click node_patronfile "https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/patrons.csv"
click node_runfile "https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/write.txt"

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_user toneBlue
class node_library,node_book,node_fiction,node_nonfiction toneAmber
class node_patron toneMint
class node_catalogfile,node_patronfile,node_runfile toneRose
```

## Components

### Console interface

- [Console menus](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Main.java): `lib_mng_sys/Main.java`

### Catalog and models

- [Library operations](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Library.java): `lib_mng_sys/Library.java`
- [Book model](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Book.java): `lib_mng_sys/Book.java`
- [Fiction books](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Fiction.java): `lib_mng_sys/Fiction.java`
- [Nonfiction books](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/NonFiction.java): `lib_mng_sys/NonFiction.java`

### Patron and circulation

- [Patron model](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/Patron.java): `lib_mng_sys/Patron.java`

### File storage

- [Book catalog](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/library.csv): `lib_mng_sys/library.csv`
- [Patron records](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/patrons.csv): `lib_mng_sys/patrons.csv`
- [Run counter](https://github.com/ibraheem-siddiqui/library-management-system/blob/main/lib_mng_sys/write.txt): `lib_mng_sys/write.txt`

### Other components

- **Library user**

## Connections

- Library user → Console menus: selects actions (evidence: `README.md`)
- Console menus → Library operations: loads and operates (evidence: `lib_mng_sys/Main.java`)
- Console menus → Library operations: routes menus (evidence: `README.md`)
- Library operations → Book model: creates and compares (evidence: `lib_mng_sys/Library.java`)
- Fiction books → Book model: extends (evidence: `lib_mng_sys/Fiction.java`)
- Nonfiction books → Book model: extends (evidence: `lib_mng_sys/NonFiction.java`)
- Library operations → Patron model: loads and manages (evidence: `lib_mng_sys/Library.java`)
- Console menus → Patron model: routes patron menus (evidence: `README.md`)
- Console menus → Library operations: requests circulation (evidence: `README.md`)
- Library operations → Book catalog: loads and saves (evidence: `README.md`)
- Library operations → Patron records: loads and saves (evidence: `README.md`)
- Library operations → Run counter: tracks runs (evidence: `README.md`)
