# zenosoup/esemkalibrary architecture

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

- Interactive diagram: https://gitdiagram.com/zenosoup/esemkalibrary
- Repository: https://github.com/zenosoup/esemkalibrary

## Overview

EsemkaLibrary is a Windows Forms library-borrowing application. A member searches for their account to view active loans, can open a book search and borrow an in-stock title, then return it from the loan list; returns restore stock and may record an overdue fine. The sampled forms use a shared Entity Framework context for SQL Server persistence. The graph covers the documented product shape and sampled runtime behavior; its relationships are limited to calls and model mappings visible in excerpts.

Main entry points: [`EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs`](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs) (EF data context), [`EsemkaLibrary/EsemkaLibrary/MainForm.cs`](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/MainForm.cs) (Member and loans), [`EsemkaLibrary/EsemkaLibrary/Repo.cs`](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Repo.cs) (Shared repository), [`EsemkaLibrary/EsemkaLibrary/Program.cs`](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Program.cs) (App startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop workflow"]
  node_startup["App startup<br/>[Program.cs]"]
  node_member_loans["Member and loans<br/>[MainForm.cs]"]
  node_book_borrow["Book borrowing<br/>[BorrowingForm.cs]"]
end

subgraph group_data["Library data"]
  node_repo["Shared repository<br/>[Repo.cs]"]
  node_context["EF data context"]
  node_sqlserver[("SQL Server")]
  node_book["Book records<br/>[Book.cs]"]
  node_borrowing["Borrowing records<br/>[Borrowing.cs]"]
  node_member["Member records<br/>[Member.cs]"]
  node_bookgenre["Book genre links<br/>[BookGenre.cs]"]
  node_genre["Genre records<br/>[Genre.cs]"]
end

node_user(("Library user"))

node_user -->|"launches"| node_startup
node_startup -->|"opens"| node_member_loans
node_user -->|"searches and returns"| node_member_loans
node_member_loans -->|"opens borrowing"| node_book_borrow
node_member_loans -->|"queries and updates"| node_repo
node_book_borrow -->|"searches and saves"| node_repo
node_repo -->|"creates"| node_context
node_context -->|"configures provider"| node_sqlserver
node_context -->|"maps"| node_book
node_context -->|"maps"| node_borrowing
node_context -->|"maps"| node_member
node_context -->|"maps"| node_bookgenre
node_context -->|"maps"| node_genre

click node_startup "https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Program.cs"
click node_member_loans "https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/MainForm.cs"
click node_book_borrow "https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/BorrowingForm.cs"
click node_repo "https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Repo.cs"
click node_context "https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs"
click node_book "https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/Book.cs"
click node_borrowing "https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/Borrowing.cs"
click node_member "https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/Member.cs"
click node_bookgenre "https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/BookGenre.cs"
click node_genre "https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/Genre.cs"

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_startup,node_member_loans,node_book_borrow,node_user toneBlue
class node_repo,node_context,node_sqlserver,node_book,node_borrowing,node_member,node_bookgenre,node_genre toneAmber
```

## Components

### Desktop workflow

- [App startup](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Program.cs): `EsemkaLibrary/EsemkaLibrary/Program.cs`
- [Member and loans](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/MainForm.cs): `EsemkaLibrary/EsemkaLibrary/MainForm.cs`
- [Book borrowing](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/BorrowingForm.cs): `EsemkaLibrary/EsemkaLibrary/BorrowingForm.cs`

### Library data

- [Shared repository](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Repo.cs): `EsemkaLibrary/EsemkaLibrary/Repo.cs`
- [EF data context](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs): `EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs`
- **SQL Server**
- [Book records](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/Book.cs): `EsemkaLibrary/EsemkaLibrary/Model/Book.cs`
- [Borrowing records](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/Borrowing.cs): `EsemkaLibrary/EsemkaLibrary/Model/Borrowing.cs`
- [Member records](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/Member.cs): `EsemkaLibrary/EsemkaLibrary/Model/Member.cs`
- [Book genre links](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/BookGenre.cs): `EsemkaLibrary/EsemkaLibrary/Model/BookGenre.cs`
- [Genre records](https://github.com/zenosoup/esemkalibrary/blob/main/EsemkaLibrary/EsemkaLibrary/Model/Genre.cs): `EsemkaLibrary/EsemkaLibrary/Model/Genre.cs`

### Other components

- **Library user**

## Connections

- Library user → App startup: launches (evidence: `EsemkaLibrary/EsemkaLibrary/Program.cs`)
- App startup → Member and loans: opens (evidence: `EsemkaLibrary/EsemkaLibrary/Program.cs`)
- Library user → Member and loans: searches and returns (evidence: `EsemkaLibrary/EsemkaLibrary/MainForm.cs`)
- Member and loans → Book borrowing: opens borrowing (evidence: `EsemkaLibrary/EsemkaLibrary/MainForm.cs`)
- Member and loans → Shared repository: queries and updates (evidence: `EsemkaLibrary/EsemkaLibrary/MainForm.cs`)
- Book borrowing → Shared repository: searches and saves (evidence: `EsemkaLibrary/EsemkaLibrary/BorrowingForm.cs`)
- Shared repository → EF data context: creates (evidence: `EsemkaLibrary/EsemkaLibrary/Repo.cs`)
- EF data context → SQL Server: configures provider (evidence: `EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs`)
- EF data context → Book records: maps (evidence: `EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs`)
- EF data context → Borrowing records: maps (evidence: `EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs`)
- EF data context → Member records: maps (evidence: `EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs`)
- EF data context → Book genre links: maps (evidence: `EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs`)
- EF data context → Genre records: maps (evidence: `EsemkaLibrary/EsemkaLibrary/Model/EsemkaLibraryContext.cs`)
