# sinahileon/librarydatabase_team56 architecture

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

- Interactive diagram: https://gitdiagram.com/sinahileon/librarydatabase_team56
- Repository: https://github.com/sinahileon/librarydatabase_team56

## Overview

This is a small ASP.NET MVC library web app with login, catalog, and patron-book pages, plus controller endpoints documented for catalog lookup and checkout/return. The sampled controller leaves login verification and all catalog/loan operations as TODOs, and does not use the EF context; the graph therefore shows no controller-to-database workflow. The context is configured for MariaDB, but its runtime wiring is not established by the sampled sources.

Main entry points: [`LibraryWebServer/Models/Team56LibraryContext.cs`](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Team56LibraryContext.cs) (EF context), [`LibraryWebServer/Controllers/HomeController.cs`](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Controllers/HomeController.cs) (Home controller), [`LibraryWebServer/Models/CheckedOut.cs`](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/CheckedOut.cs) (Checkout records), [`LibraryWebServer/Models/Inventory.cs`](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Inventory.cs) (Inventory copies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["ASP.NET host<br/>[Program.cs]"]
  node_home["Home controller<br/>[HomeController.cs]"]
  node_loginpage["Login page<br/>[Login.cshtml]"]
  node_catalogpage["Catalog page<br/>[Index.cshtml]"]
  node_mybookspage["My books page<br/>[MyBooks.cshtml]"]
  node_layout["Shared layout<br/>[_Layout.cshtml]"]
  node_errorview["Error page<br/>[Error.cshtml]"]
end

subgraph group_library["Library data model"]
  node_titles["Title records<br/>[Titles.cs]"]
  node_inventory["Inventory copies<br/>[Inventory.cs]"]
  node_patrons["Patron records<br/>[Patrons.cs]"]
  node_loans["Checkout records<br/>[CheckedOut.cs]"]
  node_phones["Patron phones<br/>[Phones.cs]"]
end

subgraph group_storage["Persistence"]
  node_context["EF context"]
  node_db[("MariaDB library")]
end

node_patron(("Library patron"))

node_patron -->|"sends requests"| node_webapp
node_webapp -->|"routes requests"| node_home
node_home -->|"renders login"| node_loginpage
node_home -->|"renders catalog"| node_catalogpage
node_home -->|"renders books"| node_mybookspage
node_home -->|"renders error"| node_errorview
node_loginpage -->|"uses layout"| node_layout
node_catalogpage -->|"uses layout"| node_layout
node_mybookspage -->|"uses layout"| node_layout
node_context -->|"configures MySQL"| node_db
node_context -->|"maps entity"| node_titles
node_context -->|"maps entity"| node_inventory
node_context -->|"maps entity"| node_patrons
node_context -->|"maps entity"| node_loans
node_context -->|"maps entity"| node_phones
node_inventory -->|"references title"| node_titles
node_loans -->|"references patron"| node_patrons
node_loans -->|"references copy"| node_inventory
node_phones -->|"references patron"| node_patrons

click node_webapp "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Program.cs"
click node_home "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Controllers/HomeController.cs"
click node_loginpage "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Views/Home/Login.cshtml"
click node_catalogpage "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Views/Home/Index.cshtml"
click node_mybookspage "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Views/Home/MyBooks.cshtml"
click node_layout "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Views/Shared/_Layout.cshtml"
click node_context "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Team56LibraryContext.cs"
click node_titles "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Titles.cs"
click node_inventory "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Inventory.cs"
click node_patrons "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Patrons.cs"
click node_loans "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/CheckedOut.cs"
click node_phones "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Phones.cs"
click node_errorview "https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Views/Shared/Error.cshtml"

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_webapp,node_home,node_loginpage,node_catalogpage,node_mybookspage,node_layout,node_errorview toneBlue
class node_titles,node_inventory,node_patrons,node_loans,node_phones toneAmber
class node_context,node_db toneMint
class node_patron toneIndigo
```

## Components

### Web application

- [ASP.NET host](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Program.cs): `LibraryWebServer/Program.cs`
- [Home controller](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Controllers/HomeController.cs): `LibraryWebServer/Controllers/HomeController.cs`
- [Login page](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Views/Home/Login.cshtml): `LibraryWebServer/Views/Home/Login.cshtml`
- [Catalog page](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Views/Home/Index.cshtml): `LibraryWebServer/Views/Home/Index.cshtml`
- [My books page](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Views/Home/MyBooks.cshtml): `LibraryWebServer/Views/Home/MyBooks.cshtml`
- [Shared layout](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Views/Shared/_Layout.cshtml): `LibraryWebServer/Views/Shared/_Layout.cshtml`
- [Error page](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Views/Shared/Error.cshtml): `LibraryWebServer/Views/Shared/Error.cshtml`

### Library data model

- [Title records](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Titles.cs): `LibraryWebServer/Models/Titles.cs`
- [Inventory copies](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Inventory.cs): `LibraryWebServer/Models/Inventory.cs`
- [Patron records](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Patrons.cs): `LibraryWebServer/Models/Patrons.cs`
- [Checkout records](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/CheckedOut.cs): `LibraryWebServer/Models/CheckedOut.cs`
- [Patron phones](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Phones.cs): `LibraryWebServer/Models/Phones.cs`

### Persistence

- [EF context](https://github.com/sinahileon/librarydatabase_team56/blob/master/LibraryWebServer/Models/Team56LibraryContext.cs): `LibraryWebServer/Models/Team56LibraryContext.cs`
- **MariaDB library**

### Other components

- **Library patron**

## Connections

- Library patron → ASP.NET host: sends requests
- ASP.NET host → Home controller: routes requests
- Home controller → Login page: renders login
- Home controller → Catalog page: renders catalog
- Home controller → My books page: renders books
- Home controller → Error page: renders error
- Login page → Shared layout: uses layout
- Catalog page → Shared layout: uses layout
- My books page → Shared layout: uses layout
- EF context → MariaDB library: configures MySQL
- EF context → Title records: maps entity
- EF context → Inventory copies: maps entity
- EF context → Patron records: maps entity
- EF context → Checkout records: maps entity
- EF context → Patron phones: maps entity
- Inventory copies → Title records: references title
- Checkout records → Patron records: references patron
- Checkout records → Inventory copies: references copy
- Patron phones → Patron records: references patron
