# astha-gupta9/library-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/astha-gupta9/library-management-system
- Repository: https://github.com/astha-gupta9/library-management-system

## Overview

This is a small, in-memory Java console library manager. A user selects menu actions; Library coordinates validated input, book and student records, catalog search, and checkout/check-in, then prints results. BookRepository and StudentRepository hold records in static maps, while Book and Student carry inventory and loan state. The README documents these capabilities and the in-memory design. The graph reflects the shown Java excerpts; it does not imply persistent storage or detail beyond the sampled implementation.

Main entry points: [`Library.java`](https://github.com/astha-gupta9/library-management-system/blob/main/Library.java) (Library workflow), [`BookRepository.java`](https://github.com/astha-gupta9/library-management-system/blob/main/BookRepository.java) (Book repository), [`StudentRepository.java`](https://github.com/astha-gupta9/library-management-system/blob/main/StudentRepository.java) (Student repository), [`Student.java`](https://github.com/astha-gupta9/library-management-system/blob/main/Student.java) (Student record)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console interaction"]
  node_validation["Input validation<br/>[ErrorHandling.java]"]
end

subgraph group_coordination["Application coordination"]
  node_library["Library workflow<br/>[Library.java]"]
end

subgraph group_catalog["Book catalog"]
  node_book_repo["Book repository"]
  node_book["Book record<br/>[Book.java]"]
end

subgraph group_membership["Student loans"]
  node_student_repo["Student repository"]
  node_student["Student record<br/>[Student.java]"]
end

node_user(("Library user"))

node_user -->|"selects actions"| node_library
node_library -->|"prints results"| node_user
node_library -->|"validates input"| node_validation
node_library -->|"manages catalog"| node_book_repo
node_library -->|"manages students"| node_student_repo
node_library -->|"checks loan limits"| node_student
node_book_repo -->|"stores and updates"| node_book
node_student_repo -->|"stores and retrieves"| node_student

click node_library "https://github.com/astha-gupta9/library-management-system/blob/main/Library.java"
click node_validation "https://github.com/astha-gupta9/library-management-system/blob/main/ErrorHandling.java"
click node_book_repo "https://github.com/astha-gupta9/library-management-system/blob/main/BookRepository.java"
click node_book "https://github.com/astha-gupta9/library-management-system/blob/main/Book.java"
click node_student_repo "https://github.com/astha-gupta9/library-management-system/blob/main/StudentRepository.java"
click node_student "https://github.com/astha-gupta9/library-management-system/blob/main/Student.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_validation,node_user toneBlue
class node_library toneAmber
class node_book_repo,node_book toneMint
class node_student_repo,node_student toneRose
```

## Components

### Console interaction

- [Input validation](https://github.com/astha-gupta9/library-management-system/blob/main/ErrorHandling.java): `ErrorHandling.java`

### Application coordination

- [Library workflow](https://github.com/astha-gupta9/library-management-system/blob/main/Library.java): `Library.java`

### Book catalog

- [Book repository](https://github.com/astha-gupta9/library-management-system/blob/main/BookRepository.java): `BookRepository.java`
- [Book record](https://github.com/astha-gupta9/library-management-system/blob/main/Book.java): `Book.java`

### Student loans

- [Student repository](https://github.com/astha-gupta9/library-management-system/blob/main/StudentRepository.java): `StudentRepository.java`
- [Student record](https://github.com/astha-gupta9/library-management-system/blob/main/Student.java): `Student.java`

### Other components

- **Library user**

## Connections

- Library user → Library workflow: selects actions (evidence: `README.md`)
- Library workflow → Library user: prints results (evidence: `Library.java`)
- Library workflow → Input validation: validates input (evidence: `Library.java`)
- Library workflow → Book repository: manages catalog (evidence: `Library.java`)
- Library workflow → Student repository: manages students (evidence: `Library.java`)
- Library workflow → Student record: checks loan limits (evidence: `Library.java`)
- Book repository → Book record: stores and updates (evidence: `BookRepository.java`)
- Student repository → Student record: stores and retrieves (evidence: `StudentRepository.java`)
