# wivario/ipg.library architecture

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

- Interactive diagram: https://gitdiagram.com/wivario/ipg.library
- Repository: https://github.com/wivario/ipg.library

## Overview

This is a console-based C# library management system. The user interacts through Program’s menu, which delegates catalog and circulation operations to LibraryManager and notification actions to NotificationService; it also offers late-fee calculation and summary reporting. LibraryManager maintains in-memory item and user collections, while item and user classes hold domain behavior. The README documents add, borrow, return, reserve, notifications, popular-item events, and reporting. Some feature details and call paths are unsampled, so those links are omitted where evidence is insufficient.

Main entry points: [`ItemBase.cs`](https://github.com/wivario/ipg.library/blob/master/ItemBase.cs) (Item base), [`LibraryManager.cs`](https://github.com/wivario/ipg.library/blob/master/LibraryManager.cs) (Library manager), [`Program.cs`](https://github.com/wivario/ipg.library/blob/master/Program.cs) (Console menu), [`Customer.cs`](https://github.com/wivario/ipg.library/blob/master/Customer.cs) (Customers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console workflow"]
  node_program["Console menu<br/>[Program.cs]"]
  node_latefee["Late fee<br/>[LateFee.cs]"]
end

subgraph group_library["Catalog and circulation"]
  node_manager["Library manager<br/>[LibraryManager.cs]"]
  node_book["Books<br/>[Book.cs]"]
  node_magazine["Magazines<br/>[Magazine.cs]"]
  node_dvd["DVDs<br/>[DVD.cs]"]
end

subgraph group_people["Members and notifications"]
  node_customer["Customers<br/>[Customer.cs]"]
  node_employee["Employees<br/>[Employee.cs]"]
  node_notifier["Notification service"]
end

subgraph group_domain["Domain foundations"]
  node_itembase["Item base<br/>[ItemBase.cs]"]
  node_users["User base<br/>[Users.cs]"]
  node_validator["Input validation<br/>[Validator.cs]"]
  node_iteminterface["Item contract<br/>[IItem.cs]"]
  node_displayinterface["Display contract<br/>[IDisplayInfo.cs]"]
  node_notificationinterface["Notification contract<br/>[INotification.cs]"]
  node_eventargs["Item event data<br/>[ItemEventArgs.cs]"]
end

node_user(("Library user"))

node_user -->|"uses menu"| node_program
node_program -->|"delegates operations"| node_manager
node_program -->|"sends notifications"| node_notifier
node_program -->|"calculates fees"| node_latefee
node_manager -->|"manages items"| node_itembase
node_manager -->|"updates borrowing"| node_customer
node_manager -->|"changes book status"| node_book
node_manager -->|"handles status event"| node_eventargs
node_book -->|"inherits from"| node_itembase
node_magazine -->|"inherits from"| node_itembase
node_dvd -->|"inherits from"| node_itembase
node_customer -->|"inherits from"| node_users
node_employee -->|"inherits from"| node_users
node_notifier -->|"broadcasts to"| node_customer
node_notifier -->|"broadcasts to"| node_employee
node_customer -->|"implements"| node_notificationinterface
node_employee -->|"implements"| node_notificationinterface
node_itembase -->|"implements"| node_iteminterface
node_itembase -->|"implements"| node_displayinterface
node_book -->|"validates fields"| node_validator
node_itembase -->|"validates title"| node_validator
node_users -->|"validates user data"| node_validator
node_itembase -->|"emits event data"| node_eventargs
node_eventargs -->|"references item"| node_iteminterface

click node_program "https://github.com/wivario/ipg.library/blob/master/Program.cs"
click node_manager "https://github.com/wivario/ipg.library/blob/master/LibraryManager.cs"
click node_book "https://github.com/wivario/ipg.library/blob/master/Book.cs"
click node_magazine "https://github.com/wivario/ipg.library/blob/master/Magazine.cs"
click node_dvd "https://github.com/wivario/ipg.library/blob/master/DVD.cs"
click node_customer "https://github.com/wivario/ipg.library/blob/master/Customer.cs"
click node_employee "https://github.com/wivario/ipg.library/blob/master/Employee.cs"
click node_notifier "https://github.com/wivario/ipg.library/blob/master/NotificationService.cs"
click node_latefee "https://github.com/wivario/ipg.library/blob/master/LateFee.cs"
click node_itembase "https://github.com/wivario/ipg.library/blob/master/ItemBase.cs"
click node_users "https://github.com/wivario/ipg.library/blob/master/Users.cs"
click node_validator "https://github.com/wivario/ipg.library/blob/master/Validator.cs"
click node_iteminterface "https://github.com/wivario/ipg.library/blob/master/IItem.cs"
click node_displayinterface "https://github.com/wivario/ipg.library/blob/master/IDisplayInfo.cs"
click node_notificationinterface "https://github.com/wivario/ipg.library/blob/master/INotification.cs"
click node_eventargs "https://github.com/wivario/ipg.library/blob/master/ItemEventArgs.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_program,node_latefee,node_user toneBlue
class node_manager,node_book,node_magazine,node_dvd toneAmber
class node_customer,node_employee,node_notifier toneMint
class node_itembase,node_users,node_validator,node_iteminterface,node_displayinterface,node_notificationinterface,node_eventargs toneRose
```

## Components

### Console workflow

- [Console menu](https://github.com/wivario/ipg.library/blob/master/Program.cs): `Program.cs`
- [Late fee](https://github.com/wivario/ipg.library/blob/master/LateFee.cs): `LateFee.cs`

### Catalog and circulation

- [Library manager](https://github.com/wivario/ipg.library/blob/master/LibraryManager.cs): `LibraryManager.cs`
- [Books](https://github.com/wivario/ipg.library/blob/master/Book.cs): `Book.cs`
- [Magazines](https://github.com/wivario/ipg.library/blob/master/Magazine.cs): `Magazine.cs`
- [DVDs](https://github.com/wivario/ipg.library/blob/master/DVD.cs): `DVD.cs`

### Members and notifications

- [Customers](https://github.com/wivario/ipg.library/blob/master/Customer.cs): `Customer.cs`
- [Employees](https://github.com/wivario/ipg.library/blob/master/Employee.cs): `Employee.cs`
- [Notification service](https://github.com/wivario/ipg.library/blob/master/NotificationService.cs): `NotificationService.cs`

### Domain foundations

- [Item base](https://github.com/wivario/ipg.library/blob/master/ItemBase.cs): `ItemBase.cs`
- [User base](https://github.com/wivario/ipg.library/blob/master/Users.cs): `Users.cs`
- [Input validation](https://github.com/wivario/ipg.library/blob/master/Validator.cs): `Validator.cs`
- [Item contract](https://github.com/wivario/ipg.library/blob/master/IItem.cs): `IItem.cs`
- [Display contract](https://github.com/wivario/ipg.library/blob/master/IDisplayInfo.cs): `IDisplayInfo.cs`
- [Notification contract](https://github.com/wivario/ipg.library/blob/master/INotification.cs): `INotification.cs`
- [Item event data](https://github.com/wivario/ipg.library/blob/master/ItemEventArgs.cs): `ItemEventArgs.cs`

### Other components

- **Library user**

## Connections

- Library user → Console menu: uses menu (evidence: `README.md`)
- Console menu → Library manager: delegates operations (evidence: `Program.cs`)
- Console menu → Notification service: sends notifications (evidence: `Program.cs`)
- Console menu → Late fee: calculates fees (evidence: `Program.cs`)
- Library manager → Item base: manages items (evidence: `LibraryManager.cs`)
- Library manager → Customers: updates borrowing (evidence: `LibraryManager.cs`)
- Library manager → Books: changes book status (evidence: `LibraryManager.cs`)
- Library manager → Item event data: handles status event (evidence: `LibraryManager.cs`)
- Books → Item base: inherits from (evidence: `Book.cs`)
- Magazines → Item base: inherits from (evidence: `Magazine.cs`)
- DVDs → Item base: inherits from (evidence: `DVD.cs`)
- Customers → User base: inherits from (evidence: `Customer.cs`)
- Employees → User base: inherits from (evidence: `Employee.cs`)
- Notification service → Customers: broadcasts to (evidence: `NotificationService.cs`)
- Notification service → Employees: broadcasts to (evidence: `NotificationService.cs`)
- Customers → Notification contract: implements (evidence: `Customer.cs`)
- Employees → Notification contract: implements (evidence: `Employee.cs`)
- Item base → Item contract: implements (evidence: `ItemBase.cs`)
- Item base → Display contract: implements (evidence: `ItemBase.cs`)
- Books → Input validation: validates fields (evidence: `Book.cs`)
- Item base → Input validation: validates title (evidence: `ItemBase.cs`)
- User base → Input validation: validates user data (evidence: `Users.cs`)
- Item base → Item event data: emits event data (evidence: `ItemBase.cs`)
- Item event data → Item contract: references item (evidence: `ItemEventArgs.cs`)
