# kerpackie/librarymanager architecture

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

- Interactive diagram: https://gitdiagram.com/kerpackie/librarymanager
- Repository: https://github.com/kerpackie/librarymanager

## Overview

LibraryManager is a desktop application for managing a personal book collection, with a supporting core service layer, database, and development API. The visible workflow starts in the Windows Forms app; users can manage books and related collection data, and the book service can retrieve book metadata from Open Library before persisting it. The tree also identifies import, recommendations, statistics, loans, and wishlist features, but their internal wiring is not shown. Dashed, uncited links mark those evidence limits; the README provides no further product detail.

Main entry points: [`LibraryManager.Core/Services/BookService/BookService.cs`](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/BookService/BookService.cs) (Book service), [`LibraryManager/Views/MainForm.cs`](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/MainForm.cs) (Main window), [`LibraryManager.Core/Data/LibraryContext.cs`](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Data/LibraryContext.cs) (EF library context), [`LibraryManager.Data/Services`](https://github.com/kerpackie/librarymanager/tree/master/LibraryManager.Data/Services) (Data service layer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_app["Windows Forms app<br/>[Program.cs]"]
  node_main["Main window<br/>[MainForm.cs]"]
  node_bookui["Book workflows"]
  node_collectionsui["Collections and wishlist"]
  node_loansui["Loan tracking<br/>[LoanTracking.cs]"]
  node_importui["Import books<br/>[ImportBookForm.cs]"]
  node_recommendui["Recommendations"]
  node_statsui["Book statistics"]
  node_formservice["Form service<br/>[FormService.cs]"]
end

subgraph group_core["Library services"]
  node_bookservice["Book service<br/>[BookService.cs]"]
  node_authors["Author service<br/>[AuthorService.cs]"]
  node_publishers["Publisher service"]
  node_subjects["Subject service<br/>[SubjectService.cs]"]
  node_collections["Collection service"]
  node_loans["Loan service<br/>[LoanService.cs]"]
  node_notes["Notes service<br/>[NoteService.cs]"]
  node_covers["Cover service<br/>[CoverService.cs]"]
  node_validators["Entity validators<br/>[Validators]"]
  node_dapper["Dapper book service"]
end

subgraph group_storage["Persistence"]
  node_context[("EF library context<br/>[LibraryContext.cs]")]
  node_mapping["Book entity mapping<br/>[BookMapping.cs]"]
  node_dbconfig["Database configuration"]
  node_dataauthor["Author repository"]
  node_dataservices["Data service layer<br/>[Services]"]
  node_datacontext[("Data context<br/>[DbContext.cs]")]
end

subgraph group_integrations["External and API"]
  node_openlibrary["Open Library"]
  node_bookapi["Open Library client"]
  node_devapi["Development API"]
end

node_user(("Library user"))

node_user -.->|"uses"| node_app
node_app -->|"launches"| node_main
node_main -.->|"opens"| node_bookui
node_main -.->|"uses"| node_formservice
node_bookui -.->|"requests books"| node_bookservice
node_collectionsui -.->|"manages collections"| node_collections
node_loansui -.->|"tracks loans"| node_loans
node_importui -.->|"imports books"| node_bookservice
node_recommendui -.->|"requests books"| node_bookservice
node_statsui -.->|"queries books"| node_bookservice
node_devapi -->|"calls"| node_bookservice
node_bookservice -->|"fetches metadata"| node_bookapi
node_bookapi -.->|"requests metadata"| node_openlibrary
node_bookservice -->|"reads and writes"| node_context
node_bookservice -->|"uses"| node_publishers
node_bookservice -->|"uses"| node_subjects
node_bookservice -->|"uses"| node_authors
node_authors -->|"validates"| node_validators
node_publishers -->|"validates"| node_validators
node_context -->|"configures provider"| node_dbconfig
node_context -->|"applies mapping"| node_mapping
node_dapper -->|"uses configuration"| node_dbconfig
node_dataservices -->|"uses repository"| node_dataauthor
node_dataservices -.->|"uses context"| node_datacontext

click node_app "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Program.cs"
click node_main "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/MainForm.cs"
click node_bookui "https://github.com/kerpackie/librarymanager/tree/master/LibraryManager/Views/BookForms"
click node_collectionsui "https://github.com/kerpackie/librarymanager/tree/master/LibraryManager/Views/Collections"
click node_loansui "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/LoanTracking/LoanTracking.cs"
click node_importui "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/BookForms/ImportBookForms/ImportBookForm.cs"
click node_recommendui "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/BookForms/RecommendedBook/RecommendedBookForm.cs"
click node_statsui "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/BookForms/Statistics/BookStatisticsForm.cs"
click node_formservice "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Services/FormService/FormService.cs"
click node_bookservice "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/BookService/BookService.cs"
click node_authors "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/AuthorService/AuthorService.cs"
click node_publishers "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/PublisherService/PublisherService.cs"
click node_subjects "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/SubjectService/SubjectService.cs"
click node_collections "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/CollectionService/CollectionService.cs"
click node_loans "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/LoanService/LoanService.cs"
click node_notes "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/NotesService/NoteService.cs"
click node_covers "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/CoverService/CoverService.cs"
click node_validators "https://github.com/kerpackie/librarymanager/tree/master/LibraryManager.Core/Validators"
click node_bookapi "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/BookAPIService/OpenLibraryBookApiService.cs"
click node_devapi "https://github.com/kerpackie/librarymanager/blob/master/LibraryManagerDevAPI/Controllers/BookServiceController.cs"
click node_context "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Data/LibraryContext.cs"
click node_mapping "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Data/EntityMapping/BookMapping.cs"
click node_dbconfig "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Data/DbConnectionConfig.cs"
click node_dapper "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/BookService/DapperBookService.cs"
click node_dataauthor "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Data/Repositories/AuthorRepositories/AuthorRepository.cs"
click node_dataservices "https://github.com/kerpackie/librarymanager/tree/master/LibraryManager.Data/Services"
click node_datacontext "https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Data/DbContext.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_app,node_main,node_bookui,node_collectionsui,node_loansui,node_importui,node_recommendui,node_statsui,node_formservice,node_user toneBlue
class node_bookservice,node_authors,node_publishers,node_subjects,node_collections,node_loans,node_notes,node_covers,node_validators,node_dapper toneAmber
class node_context,node_mapping,node_dbconfig,node_dataauthor,node_dataservices,node_datacontext toneMint
class node_openlibrary,node_bookapi,node_devapi toneRose
```

## Components

### Desktop app

- [Windows Forms app](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Program.cs): `LibraryManager/Program.cs`
- [Main window](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/MainForm.cs): `LibraryManager/Views/MainForm.cs`
- [Book workflows](https://github.com/kerpackie/librarymanager/tree/master/LibraryManager/Views/BookForms): `LibraryManager/Views/BookForms`
- [Collections and wishlist](https://github.com/kerpackie/librarymanager/tree/master/LibraryManager/Views/Collections): `LibraryManager/Views/Collections`
- [Loan tracking](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/LoanTracking/LoanTracking.cs): `LibraryManager/Views/LoanTracking/LoanTracking.cs`
- [Import books](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/BookForms/ImportBookForms/ImportBookForm.cs): `LibraryManager/Views/BookForms/ImportBookForms/ImportBookForm.cs`
- [Recommendations](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/BookForms/RecommendedBook/RecommendedBookForm.cs): `LibraryManager/Views/BookForms/RecommendedBook/RecommendedBookForm.cs`
- [Book statistics](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Views/BookForms/Statistics/BookStatisticsForm.cs): `LibraryManager/Views/BookForms/Statistics/BookStatisticsForm.cs`
- [Form service](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager/Services/FormService/FormService.cs): `LibraryManager/Services/FormService/FormService.cs`

### Library services

- [Book service](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/BookService/BookService.cs): `LibraryManager.Core/Services/BookService/BookService.cs`
- [Author service](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/AuthorService/AuthorService.cs): `LibraryManager.Core/Services/AuthorService/AuthorService.cs`
- [Publisher service](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/PublisherService/PublisherService.cs): `LibraryManager.Core/Services/PublisherService/PublisherService.cs`
- [Subject service](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/SubjectService/SubjectService.cs): `LibraryManager.Core/Services/SubjectService/SubjectService.cs`
- [Collection service](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/CollectionService/CollectionService.cs): `LibraryManager.Core/Services/CollectionService/CollectionService.cs`
- [Loan service](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/LoanService/LoanService.cs): `LibraryManager.Core/Services/LoanService/LoanService.cs`
- [Notes service](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/NotesService/NoteService.cs): `LibraryManager.Core/Services/NotesService/NoteService.cs`
- [Cover service](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/CoverService/CoverService.cs): `LibraryManager.Core/Services/CoverService/CoverService.cs`
- [Entity validators](https://github.com/kerpackie/librarymanager/tree/master/LibraryManager.Core/Validators): `LibraryManager.Core/Validators`
- [Dapper book service](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/BookService/DapperBookService.cs): `LibraryManager.Core/Services/BookService/DapperBookService.cs`

### Persistence

- [EF library context](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Data/LibraryContext.cs): `LibraryManager.Core/Data/LibraryContext.cs`
- [Book entity mapping](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Data/EntityMapping/BookMapping.cs): `LibraryManager.Core/Data/EntityMapping/BookMapping.cs`
- [Database configuration](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Data/DbConnectionConfig.cs): `LibraryManager.Core/Data/DbConnectionConfig.cs`
- [Author repository](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Data/Repositories/AuthorRepositories/AuthorRepository.cs): `LibraryManager.Data/Repositories/AuthorRepositories/AuthorRepository.cs`
- [Data service layer](https://github.com/kerpackie/librarymanager/tree/master/LibraryManager.Data/Services): `LibraryManager.Data/Services`
- [Data context](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Data/DbContext.cs): `LibraryManager.Data/DbContext.cs`

### External and API

- **Open Library**
- [Open Library client](https://github.com/kerpackie/librarymanager/blob/master/LibraryManager.Core/Services/BookAPIService/OpenLibraryBookApiService.cs): `LibraryManager.Core/Services/BookAPIService/OpenLibraryBookApiService.cs`
- [Development API](https://github.com/kerpackie/librarymanager/blob/master/LibraryManagerDevAPI/Controllers/BookServiceController.cs): `LibraryManagerDevAPI/Controllers/BookServiceController.cs`

### Other components

- **Library user**

## Connections

- Library user → Windows Forms app: uses
- Windows Forms app → Main window: launches (evidence: `LibraryManager/Program.cs`)
- Main window → Book workflows: opens
- Main window → Form service: uses
- Book workflows → Book service: requests books
- Collections and wishlist → Collection service: manages collections
- Loan tracking → Loan service: tracks loans
- Import books → Book service: imports books
- Recommendations → Book service: requests books
- Book statistics → Book service: queries books
- Development API → Book service: calls (evidence: `LibraryManagerDevAPI/Controllers/BookServiceController.cs`)
- Book service → Open Library client: fetches metadata (evidence: `LibraryManager.Core/Services/BookService/BookService.cs`)
- Open Library client → Open Library: requests metadata
- Book service → EF library context: reads and writes (evidence: `LibraryManager.Core/Services/BookService/BookService.cs`)
- Book service → Publisher service: uses (evidence: `LibraryManager.Core/Services/BookService/BookService.cs`)
- Book service → Subject service: uses (evidence: `LibraryManager.Core/Services/BookService/BookService.cs`)
- Book service → Author service: uses (evidence: `LibraryManager.Core/Services/BookService/BookService.cs`)
- Author service → Entity validators: validates (evidence: `LibraryManager.Core/Services/AuthorService/AuthorService.cs`)
- Publisher service → Entity validators: validates (evidence: `LibraryManager.Core/Services/PublisherService/PublisherService.cs`)
- EF library context → Database configuration: configures provider (evidence: `LibraryManager.Core/Data/LibraryContext.cs`)
- EF library context → Book entity mapping: applies mapping (evidence: `LibraryManager.Core/Data/LibraryContext.cs`)
- Dapper book service → Database configuration: uses configuration (evidence: `LibraryManager.Core/Services/BookService/DapperBookService.cs`)
- Data service layer → Author repository: uses repository (evidence: `LibraryManager.Data/Services/AuthorService/AuthorService.cs`)
- Data service layer → Data context: uses context
