# yahyasystementor/the-library architecture

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

- Interactive diagram: https://gitdiagram.com/yahyasystementor/the-library
- Repository: https://github.com/yahyasystementor/the-library

## Overview

This repository contains two independent Java console examples: a library catalog with book borrowing, and a pizza-order demonstration with payment and totals. The library workflow is driven by menu input in its Main class; the pizza example constructs orders and exercises payment directly. The excerpts show in-memory state only, with no persistent store or external service.

Main entry points: [`src/Main.java`](https://github.com/yahyasystementor/the-library/blob/master/src/Main.java) (Library CLI), [`src/pizzaorder/Order.java`](https://github.com/yahyasystementor/the-library/blob/master/src/pizzaorder/Order.java) (Order), [`src/pizzaorder/Main.java`](https://github.com/yahyasystementor/the-library/blob/master/src/pizzaorder/Main.java) (Order demo), [`src/Library.java`](https://github.com/yahyasystementor/the-library/blob/master/src/Library.java) (Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Library example"]
  node_library_main["Library CLI<br/>[Main.java]"]
  node_library_catalog["Catalog<br/>[Library.java]"]
  node_book["Book<br/>[Book.java]"]
end

subgraph group_pizza["Pizza example"]
  node_pizza_main["Order demo<br/>[Main.java]"]
  node_pizza["Pizza<br/>[Pizza.java]"]
  node_order["Order<br/>[Order.java]"]
  node_order_status["Order status<br/>[OrderStatus.java]"]
end

node_library_user(("Console user"))

node_library_user -->|"enters choices"| node_library_main
node_library_main -->|"manages catalog"| node_library_catalog
node_library_main -->|"creates and borrows"| node_book
node_library_catalog -->|"stores and queries"| node_book
node_pizza_main -->|"creates"| node_pizza
node_pizza_main -->|"creates and pays"| node_order
node_order -->|"reads price"| node_pizza
node_order -->|"sets status"| node_order_status

click node_library_main "https://github.com/yahyasystementor/the-library/blob/master/src/Main.java"
click node_library_catalog "https://github.com/yahyasystementor/the-library/blob/master/src/Library.java"
click node_book "https://github.com/yahyasystementor/the-library/blob/master/src/Book.java"
click node_pizza_main "https://github.com/yahyasystementor/the-library/blob/master/src/pizzaorder/Main.java"
click node_pizza "https://github.com/yahyasystementor/the-library/blob/master/src/pizzaorder/Pizza.java"
click node_order "https://github.com/yahyasystementor/the-library/blob/master/src/pizzaorder/Order.java"
click node_order_status "https://github.com/yahyasystementor/the-library/blob/master/src/pizzaorder/OrderStatus.java"

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_library_main,node_library_catalog,node_book,node_library_user toneBlue
class node_pizza_main,node_pizza,node_order,node_order_status toneAmber
```

## Components

### Library example

- [Library CLI](https://github.com/yahyasystementor/the-library/blob/master/src/Main.java): `src/Main.java`
- [Catalog](https://github.com/yahyasystementor/the-library/blob/master/src/Library.java): `src/Library.java`
- [Book](https://github.com/yahyasystementor/the-library/blob/master/src/Book.java): `src/Book.java`

### Pizza example

- [Order demo](https://github.com/yahyasystementor/the-library/blob/master/src/pizzaorder/Main.java): `src/pizzaorder/Main.java`
- [Pizza](https://github.com/yahyasystementor/the-library/blob/master/src/pizzaorder/Pizza.java): `src/pizzaorder/Pizza.java`
- [Order](https://github.com/yahyasystementor/the-library/blob/master/src/pizzaorder/Order.java): `src/pizzaorder/Order.java`
- [Order status](https://github.com/yahyasystementor/the-library/blob/master/src/pizzaorder/OrderStatus.java): `src/pizzaorder/OrderStatus.java`

### Other components

- **Console user**

## Connections

- Console user → Library CLI: enters choices (evidence: `src/Main.java`)
- Library CLI → Catalog: manages catalog (evidence: `src/Main.java`)
- Library CLI → Book: creates and borrows (evidence: `src/Main.java`)
- Catalog → Book: stores and queries (evidence: `src/Library.java`)
- Order demo → Pizza: creates (evidence: `src/pizzaorder/Main.java`)
- Order demo → Order: creates and pays (evidence: `src/pizzaorder/Main.java`)
- Order → Pizza: reads price (evidence: `src/pizzaorder/Order.java`)
- Order → Order status: sets status (evidence: `src/pizzaorder/Order.java`)
