# guptaanmol184/librarymanagementsystem architecture

> Architecture diagram of the GitHub repository guptaanmol184/librarymanagementsystem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/guptaanmol184/librarymanagementsystem
- Repository: https://github.com/guptaanmol184/librarymanagementsystem

## Overview

##### Project Type and Purpose
- This is a desktop “full-stack” application (2-tier architecture) built in C#/.NET using Windows Forms.
- It provides both user-side features (searching and viewing issued books) and admin-side features (adding, issuing, returning, and editing books/students) backed by a relational database.

##### File Structure Analysis
- Top‐level
- LibraryManagementSystem.sln – Visual Studio solution
- LibraryManagementSystem/ – C# project folder
- README.md – project overview
- screens/ – UI screenshots
- Inside LibraryManagementSystem/
- App.config – connection string to the SQL database
- Program.cs – application entry point
- *.cs (Login, changePassword, adm*, user*) – Windows Forms UI + code-behind (presentation + embedded business logic)
- Properties/ – resources, settings, assembly metadata
- bin/Debug & obj/Debug – build artifacts and compiled assemblies

##### README Insights
- Confirms Windows Forms, .NET usage and a database backend.
- Highlights the need to configure the connection string in App.config.
- Illustrates major UI flows via screenshots.

a. Main Components
1. Client Desktop App (Windows Forms)
– Presentation Layer: Login form, userBookSearch, usrIssuedBooks, admin forms (issue, return, edit DB, etc.)
2. Business Logic Layer
– Code-behind in each form enforcing validation and application rules
3. Data Access Layer
– ADO.NET calls reading/writing via the connection string in App.config
4. Database
– SQL Server (or compatible RDBMS) hosting Books, Students, Issues tables
5. Configuration
– App.config (connection string)
b. Relationships & Interactions
– UI Layer components invoke methods in the Business Logic Layer.
– Business Logic Layer uses Data Access Layer to execute SQL commands.
– Data Access Layer connects (via ADO.NET) to the Database.
– App.config supplies connection details to the Data Access Layer.
c. Architectural Patterns & Principles
– 2-Tier (Client/Server) architecture
– Layer separation: Presentation, Logic, Data
– Use of resource files (.resx) for UI text/images
d. Key Technologies/Frameworks
– .NET Framework (WindowsForms)
– ADO.NET for data access
– Visual Studio solution/project structure
– Configuration via App.config

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Desktop App
    subgraph "Client Desktop App"
        direction TB
        subgraph "UI Forms"
            direction TB
            LoginForm["LoginForm"]:::ui
            ChangePassword["ChangePasswordForm"]:::ui
            AdminStart["AdminStartPage"]:::ui
            AdminBookSearch["AdminBookSearch"]:::ui
            AdminEditBook["AdminEditBookDB"]:::ui
            AdminEditStudent["AdminEditStudentDB"]:::ui
            AdminIssue["AdminIssueBook"]:::ui
            AdminReturn["AdminReturnBook"]:::ui
            UserBookSearch["UserBookSearch"]:::ui
            UserIssued["UserIssuedBooks"]:::ui
        end
        subgraph "Business Logic"
            direction TB
            BizLogic["Validation & Rules"]:::logic
        end
        subgraph "Data Access Layer"
            direction TB
            DAL["ADO.NET Data Access"]:::data
        end
    end

    Config["App.config"]:::config
    Database["SQL Server DB<br/>(Books, Students, Issues)"]:::db

    %% Connections
    LoginForm -->|invokes| BizLogic
    ChangePassword -->|invokes| BizLogic
    AdminStart -->|invokes| BizLogic
    AdminBookSearch -->|invokes| BizLogic
    AdminEditBook -->|invokes| BizLogic
    AdminEditStudent -->|invokes| BizLogic
    AdminIssue -->|invokes| BizLogic
    AdminReturn -->|invokes| BizLogic
    UserBookSearch -->|invokes| BizLogic
    UserIssued -->|invokes| BizLogic
    BizLogic -->|uses| DAL
    DAL -->|SQL via ADO.NET| Database
    Config -->|connection string| DAL

    %% Click Events
    click LoginForm "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/Login.cs"
    click ChangePassword "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/changePassword.cs"
    click AdminStart "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/admStartPage.cs"
    click AdminBookSearch "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/admBookSearch.cs"
    click AdminEditBook "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/admEditBookDB.cs"
    click AdminEditStudent "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/admEditStudentDB.cs"
    click AdminIssue "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/admIssue.cs"
    click AdminReturn "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/admReturn.cs"
    click UserBookSearch "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/userBookSearch.cs"
    click UserIssued "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/usrIssuedBooks.cs"
    click Config "https://github.com/guptaanmol184/librarymanagementsystem/blob/master/LibraryManagementSystem/App.config"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#21618C,color:#1B2631
    classDef logic fill:#A9DFBF,stroke:#1D8348,color:#1B2631
    classDef data fill:#F5CBA7,stroke:#B9770E,color:#1B2631
    classDef db fill:#D5DBDB,stroke:#566573,color:#1B2631
    classDef config fill:#F9E79F,stroke:#B7950B,color:#1B2631
```
