# furkannnyzg/librarymanagementsystem architecture

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

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

## Overview

##### Main Components
- User Interface (UI) Layer: This includes multiple Windows Forms such as Form1, home, Books, Loan, Members, and kullaniciKayitEkrani. These forms serve as the primary interaction point for users.
- Application/Business Logic Layer: Although not clearly separated by distinct directories (aside from the Models folder), this layer contains the logic behind operations (for example, in the code-behind files and the Models for login and registration) that manages user operations, book management, and loan processing.
- Data Access Layer: The project is connected to a SQL database as highlighted in the README. The App.config file likely contains connection string settings, and the application issues SQL queries to store/retrieve data. This layer represents the communication between the business logic and the SQL database.
- Configuration Component: The App.config file in the project houses important configuration details like database connection strings, which are essential for setting up the data access mechanism.

##### Relationships and Interactions
- The UI layer (forms) triggers events which send user inputs to associated event handlers.
- Business logic within the code-behind files and Models (login.cs, register.cs) processes the inputs, performs validations, and issues SQL queries.
- The Data Access Layer handles interaction with the SQL database, where data about books, loans, and members is stored or updated.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Although the division is not strictly layered through multiple projects, there is a natural separation between the presentation (Windows Forms), business (event handlers, Models), and data access (SQL queries via App.config setup) components.
- Event-driven Programming: The Windows Forms are event-driven, communicating user actions that trigger underlying logic.
- Coupling via Configuration: The use of App.config for database connection emphasizes the principle of separating configuration from code logic.

##### Relevant Technologies
- C# as the core programming language.
- Windows Forms for the UI.
- SQL (likely accessed via ADO.NET or similar data access libraries) for data operations.
- Visual Studio (indicated by the .sln file) which serves as the IDE and project management tool.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        UI1["Form1 (Windows Form)"] 
        UI2["Books (Windows Form)"]
        UI3["Loan (Windows Form)"]
        UI4["Members (Windows Form)"]
        UI5["Home (Windows Form)"]
        UI6["kullaniciKayitEkrani (User Registration)"]
    end

    %% Business Logic/Application Layer
    subgraph "Business Logic/Application Layer"
        BL1["Event Handlers"]
        BL2["Login Logic (Model)"]
        BL3["Registration Logic (Model)"]
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        DB["SQL Database"]
    end

    %% Configuration Component
    subgraph "Configuration"
        Config["App.config"]
    end

    %% Data Flow Connections from UI to Business Logic
    UI1 -->|"EventTrigger"| BL1
    UI2 -->|"EventTrigger"| BL1
    UI3 -->|"EventTrigger"| BL1
    UI4 -->|"EventTrigger"| BL1
    UI5 -->|"EventTrigger"| BL1
    UI6 -->|"EventTrigger"| BL1

    %% Business Logic uses Models for operations
    BL1 -->|"ProcessWith"| BL2
    BL1 -->|"ProcessWith"| BL3

    %% Business Logic interacts with SQL Database
    BL2 -->|"SQLQuery"| DB
    BL3 -->|"SQLQuery"| DB
    DB -->|"QueryResult"| BL2
    DB -->|"QueryResult"| BL3

    %% Business Logic updates UI
    BL2 -->|"UpdateUI"| UI1
    BL3 -->|"UpdateUI"| UI1

    %% Configuration connects to SQL Database
    Config ---|"Configures"| DB

    %% Click Events for UI Layer
    click UI1 "https://github.com/furkannnyzg/librarymanagementsystem/blob/master/libraryManagementSystem/Form1.cs"
    click UI2 "https://github.com/furkannnyzg/librarymanagementsystem/blob/master/libraryManagementSystem/Books.cs"
    click UI3 "https://github.com/furkannnyzg/librarymanagementsystem/blob/master/libraryManagementSystem/Loan.cs"
    click UI4 "https://github.com/furkannnyzg/librarymanagementsystem/blob/master/libraryManagementSystem/Members.cs"
    click UI5 "https://github.com/furkannnyzg/librarymanagementsystem/blob/master/libraryManagementSystem/home.cs"
    click UI6 "https://github.com/furkannnyzg/librarymanagementsystem/blob/master/libraryManagementSystem/kullaniciKayitEkrani.cs"

    %% Click Events for Business Logic / Application Layer
    click BL2 "https://github.com/furkannnyzg/librarymanagementsystem/blob/master/libraryManagementSystem/Models/login.cs"
    click BL3 "https://github.com/furkannnyzg/librarymanagementsystem/blob/master/libraryManagementSystem/Models/register.cs"

    %% Click Event for Configuration Component
    click Config "https://github.com/furkannnyzg/librarymanagementsystem/blob/master/libraryManagementSystem/App.config"

    %% Styles
    classDef ui fill:#add8e6,stroke:#000,stroke-width:2px;
    classDef business fill:#90ee90,stroke:#000,stroke-width:2px;
    classDef database fill:#ffcc99,stroke:#000,stroke-width:2px;
    classDef config fill:#ff9999,stroke:#000,stroke-width:2px;

    class UI1,UI2,UI3,UI4,UI5,UI6 ui;
    class BL1,BL2,BL3 business;
    class DB database;
    class Config config;
```
