# athukorala99/smartlibrary architecture

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

- Interactive diagram: https://gitdiagram.com/athukorala99/smartlibrary
- Repository: https://github.com/athukorala99/smartlibrary

## Overview

Smart Library combines a librarian-facing Windows application with a student website, backed by MySQL. The librarian workflow is to log in, use the dashboard to manage books, categories and students, and record borrowing or returns; overdue-loan monitoring supports fines and alerts. Students log in to browse available books by category and manage their profiles. The graph reflects README-described capabilities where implementation excerpts were unavailable; those relationships are cited to the README rather than treated as inspected code.

Main entry points: [`smartlibrary/view/Dashboaed.cs`](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/Dashboaed.cs) (Dashboard), [`smartlibrary/view/BorrowView.cs`](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/BorrowView.cs) (Borrowing), [`lwn/login.php`](https://github.com/athukorala99/smartlibrary/blob/master/lwn/login.php) (Student login), [`lwn/components/db-connect.php`](https://github.com/athukorala99/smartlibrary/blob/master/lwn/components/db-connect.php) (Website database access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_staff["Librarian desktop"]
  node_desktop_login["Staff login"]
  node_dashboard["Dashboard<br/>[Dashboaed.cs]"]
end

subgraph group_operations["Library operations"]
  node_book_admin["Book management<br/>[BookView.cs]"]
  node_book_entry["Book entry<br/>[BookInsert.cs]"]
  node_category_admin["Category management<br/>[Rackview.cs]"]
  node_category_entry["Category entry<br/>[RackInsert.cs]"]
  node_student_admin["Student management<br/>[Studentview.cs]"]
  node_student_entry["Student entry<br/>[StudentInsert.cs]"]
  node_loan_admin["Borrowing<br/>[BorrowView.cs]"]
  node_loan_entry["Borrow entry<br/>[BorrowInsert.cs]"]
  node_return_details["Return details<br/>[ReturndDetails.cs]"]
  node_overdue["Overdue monitoring<br/>[warningview.cs]"]
  node_fines_alerts["Fines and alerts"]
end

subgraph group_student["Student website"]
  node_web_login["Student login<br/>[login.php]"]
  node_catalog["Available-book catalog<br/>[index.php]"]
  node_profile["Profile management<br/>[u-profile.php]"]
  node_web_sessions["Session handling<br/>[logout.php]"]
end

subgraph group_persistence["Data access"]
  node_desktop_access["Desktop database access<br/>[MainClass.cs]"]
  node_web_access["Website database access<br/>[db-connect.php]"]
  node_library_db[("Library database<br/>[librarysystem.sql]")]
end

node_librarian(("Librarian"))
node_student(("Student"))
node_email["Email service"]

node_librarian -->|"logs in"| node_desktop_login
node_desktop_login -->|"opens"| node_dashboard
node_dashboard -->|"opens"| node_book_admin
node_dashboard -->|"opens"| node_category_admin
node_dashboard -->|"opens"| node_student_admin
node_dashboard -->|"opens"| node_loan_admin
node_book_admin -->|"opens"| node_book_entry
node_category_admin -->|"opens"| node_category_entry
node_student_admin -->|"opens"| node_student_entry
node_loan_admin -->|"opens"| node_loan_entry
node_loan_admin -->|"opens"| node_return_details
node_loan_admin -->|"opens"| node_overdue
node_overdue -->|"supports"| node_fines_alerts
node_student -->|"logs in"| node_web_login
node_web_login -->|"enables browsing"| node_catalog
node_student -->|"manages profile"| node_profile
node_web_login -->|"uses session"| node_web_sessions
node_catalog -->|"queries"| node_web_access
node_web_access -->|"connects"| node_library_db
node_desktop_access -->|"connects"| node_library_db
node_dashboard -.->|"uses data access"| node_desktop_access
node_profile -.->|"uses"| node_web_access
node_fines_alerts -.->|"sends alerts"| node_email

click node_desktop_login "https://github.com/athukorala99/smartlibrary/tree/master/smartlibrary"
click node_dashboard "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/Dashboaed.cs"
click node_book_admin "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/BookView.cs"
click node_book_entry "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/Insert/BookInsert.cs"
click node_category_admin "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/Rackview.cs"
click node_category_entry "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/Insert/RackInsert.cs"
click node_student_admin "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/Studentview.cs"
click node_student_entry "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/Insert/StudentInsert.cs"
click node_loan_admin "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/BorrowView.cs"
click node_loan_entry "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/Insert/BorrowInsert.cs"
click node_return_details "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/Insert/ReturndDetails.cs"
click node_overdue "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/warningview.cs"
click node_fines_alerts "https://github.com/athukorala99/smartlibrary/tree/master/smartlibrary"
click node_web_login "https://github.com/athukorala99/smartlibrary/blob/master/lwn/login.php"
click node_catalog "https://github.com/athukorala99/smartlibrary/blob/master/lwn/index.php"
click node_profile "https://github.com/athukorala99/smartlibrary/blob/master/lwn/u-profile.php"
click node_web_sessions "https://github.com/athukorala99/smartlibrary/blob/master/lwn/logout.php"
click node_desktop_access "https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/MainClass.cs"
click node_web_access "https://github.com/athukorala99/smartlibrary/blob/master/lwn/components/db-connect.php"
click node_library_db "https://github.com/athukorala99/smartlibrary/blob/master/Database/librarysystem.sql"

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_desktop_login,node_dashboard toneBlue
class node_book_admin,node_book_entry,node_category_admin,node_category_entry,node_student_admin,node_student_entry,node_loan_admin,node_loan_entry,node_return_details,node_overdue,node_fines_alerts toneAmber
class node_web_login,node_catalog,node_profile,node_web_sessions toneMint
class node_desktop_access,node_web_access,node_library_db toneRose
class node_librarian,node_student,node_email toneIndigo
```

## Components

### Librarian desktop

- [Staff login](https://github.com/athukorala99/smartlibrary/tree/master/smartlibrary): `smartlibrary`
- [Dashboard](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/Dashboaed.cs): `smartlibrary/view/Dashboaed.cs`

### Library operations

- [Book management](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/BookView.cs): `smartlibrary/view/BookView.cs`
- [Book entry](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/Insert/BookInsert.cs): `smartlibrary/Insert/BookInsert.cs`
- [Category management](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/Rackview.cs): `smartlibrary/view/Rackview.cs`
- [Category entry](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/Insert/RackInsert.cs): `smartlibrary/Insert/RackInsert.cs`
- [Student management](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/Studentview.cs): `smartlibrary/view/Studentview.cs`
- [Student entry](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/Insert/StudentInsert.cs): `smartlibrary/Insert/StudentInsert.cs`
- [Borrowing](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/BorrowView.cs): `smartlibrary/view/BorrowView.cs`
- [Borrow entry](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/Insert/BorrowInsert.cs): `smartlibrary/Insert/BorrowInsert.cs`
- [Return details](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/Insert/ReturndDetails.cs): `smartlibrary/Insert/ReturndDetails.cs`
- [Overdue monitoring](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/view/warningview.cs): `smartlibrary/view/warningview.cs`
- [Fines and alerts](https://github.com/athukorala99/smartlibrary/tree/master/smartlibrary): `smartlibrary`

### Student website

- [Student login](https://github.com/athukorala99/smartlibrary/blob/master/lwn/login.php): `lwn/login.php`
- [Available-book catalog](https://github.com/athukorala99/smartlibrary/blob/master/lwn/index.php): `lwn/index.php`
- [Profile management](https://github.com/athukorala99/smartlibrary/blob/master/lwn/u-profile.php): `lwn/u-profile.php`
- [Session handling](https://github.com/athukorala99/smartlibrary/blob/master/lwn/logout.php): `lwn/logout.php`

### Data access

- [Desktop database access](https://github.com/athukorala99/smartlibrary/blob/master/smartlibrary/MainClass.cs): `smartlibrary/MainClass.cs`
- [Website database access](https://github.com/athukorala99/smartlibrary/blob/master/lwn/components/db-connect.php): `lwn/components/db-connect.php`
- [Library database](https://github.com/athukorala99/smartlibrary/blob/master/Database/librarysystem.sql): `Database/librarysystem.sql`

### Other components

- **Librarian**
- **Student**
- **Email service**

## Connections

- Librarian → Staff login: logs in (evidence: `README.md`)
- Staff login → Dashboard: opens (evidence: `README.md`)
- Dashboard → Book management: opens (evidence: `smartlibrary/Main.cs`)
- Dashboard → Category management: opens (evidence: `smartlibrary/Main.cs`)
- Dashboard → Student management: opens (evidence: `smartlibrary/Main.cs`)
- Dashboard → Borrowing: opens (evidence: `smartlibrary/Main.cs`)
- Book management → Book entry: opens (evidence: `smartlibrary/view/BookView.cs`)
- Category management → Category entry: opens (evidence: `smartlibrary/view/Rackview.cs`)
- Student management → Student entry: opens (evidence: `smartlibrary/view/Studentview.cs`)
- Borrowing → Borrow entry: opens (evidence: `smartlibrary/view/BorrowView.cs`)
- Borrowing → Return details: opens (evidence: `smartlibrary/view/BorrowView.cs`)
- Borrowing → Overdue monitoring: opens (evidence: `smartlibrary/view/BorrowView.cs`)
- Overdue monitoring → Fines and alerts: supports (evidence: `README.md`)
- Student → Student login: logs in (evidence: `README.md`)
- Student login → Available-book catalog: enables browsing (evidence: `README.md`)
- Student → Profile management: manages profile (evidence: `README.md`)
- Student login → Session handling: uses session
- Available-book catalog → Website database access: queries (evidence: `lwn/index.php`)
- Website database access → Library database: connects (evidence: `lwn/components/db-connect.php`)
- Desktop database access → Library database: connects (evidence: `smartlibrary/MainClass.cs`)
- Dashboard → Desktop database access: uses data access (evidence: `smartlibrary/view/Dashboaed.cs`)
- Profile management → Website database access: uses (evidence: `lwn/u-profile.php`)
- Fines and alerts → Email service: sends alerts
