# asmit159/library-management-system architecture

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

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

## Overview

##### Project type and purpose
- This is a standalone, console-based Java prototype (Library Management System v1.0) focused on practicing OOP, Java Collections (ArrayList, HashMap), and simple user authentication.
- It is not a web or distributed system yet—just a CLI tool with in-memory data storage.

##### File structure
- Top‐level:
- README.md, LICENSE, .gitignore, docs/ (project paperwork)
- src/ contains only two Java classes:
– Book.java (domain model for book attributes)
– LibraryManager.java (main program; handles console I/O, user authentication, and library operations)
- No DB or persistence layer yet; all data lives in memory via Collections.
- No external config, build scripts, or network services.

##### README for additional insights
- Features: user roles (admin, student), registration/login, add/show/search books, issue/return operations, availability tracking.
- Tech stack confirms use of Scanner for input, ArrayList/HashMap for storage.
- Future scope mentions file/DB persistence, GUI or web interfaces—points to possible architectural extensions.

a. Main components:
1. UI Layer (Console I/O)
2. Application/Orchestration Layer (LibraryManager.java)
3. Domain Model (Book.java; potential User model)
4. In-Memory Data Store (Collections: ArrayList<Book>, HashMap<User, List<Book>>)
b. Relationships & interactions:
- User (actor) → Console I/O → LibraryManager
- LibraryManager → Domain Services (e.g., authenticateUser(), addBook(), issueBook())
- Services → Data Store (persist into ArrayList/HashMap)
- LibraryManager → Domain Model (create Book instances)
c. Architectural patterns & principles:
- Layered (UI → Service → Domain → Storage)
- Single-Responsibility: Book.java holds only book data; LibraryManager.java orchestrates all workflows (could be refactored into more services later)
- Dependency on Java Collections and Scanner API
d. Key technologies/frameworks:
- Java SE (java.util.Scanner, java.util.ArrayList, java.util.HashMap)
- No external libraries or frameworks

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Actors and UI
    User["User/Console"]:::actor
    UI["Console UI"]:::ui
    %% Service Layer
    Manager["LibraryManager\n(Controller/Service)"]:::service
    %% Domain Models
    Domain["Domain Models\nBook, User"]:::domain
    %% Data Store
    Store["In-Memory Store\nArrayList<Book>\nHashMap<User,List<Book>>"]:::data
    %% Project Info
    subgraph "Project Documentation & Info"
        Docs["Project Docs (docs/README.md)"]:::docs
        RootReadme["README.md"]:::docs
        License["LICENSE"]:::docs
        Gitignore[".gitignore"]:::docs
    end

    %% Connections
    User -->|"Input commands"| UI
    UI -->|"calls methods"| Manager
    Manager -->|"create/use"| Domain
    Manager -->|"store/retrieve"| Store
    Store -->|"return data"| Manager
    Manager -->|"output results"| UI

    %% Click Events
    click UI "https://github.com/asmit159/library-management-system/blob/main/src/librarymanager.java"
    click Manager "https://github.com/asmit159/library-management-system/blob/main/src/librarymanager.java"
    click Domain "https://github.com/asmit159/library-management-system/blob/main/src/Book.java"
    click Store "https://github.com/asmit159/library-management-system/blob/main/src/librarymanager.java"
    click Docs "https://github.com/asmit159/library-management-system/blob/main/docs/README.md"
    click RootReadme "https://github.com/asmit159/library-management-system/blob/main/README.md"
    click License "https://github.com/asmit159/library-management-system/tree/main/LICENSE"
    click Gitignore "https://github.com/asmit159/library-management-system/blob/main/.gitignore"

    %% Styles
    classDef actor fill:#f9f,stroke:#333,stroke-width:1px;
    classDef ui fill:#bbdefb,stroke:#1e88e5,stroke-width:1px;
    classDef service fill:#c8e6c9,stroke:#388e3c,stroke-width:1px;
    classDef domain fill:#fff9c4,stroke:#fbc02d,stroke-width:1px;
    classDef data fill:#ffe0b2,stroke:#f57c00,stroke-width:1px;
    classDef docs fill:#e0e0e0,stroke:#616161,stroke-width:1px;
```
