# sai-oggu/librarymanagementsystem architecture

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

- Interactive diagram: https://gitdiagram.com/sai-oggu/librarymanagementsystem
- Repository: https://github.com/sai-oggu/librarymanagementsystem

## Overview

This is a console-based library catalog: users choose add, view, or delete, and LibraryApp delegates those operations to the library service. LibraryOperations creates the books table, persists book records, and maps query results to Book objects; DatabaseConnection loads connection settings and opens MySQL connections. The main workflow is documented and visible in the excerpts. DB.properties is present in the tree, but its contents and database schema beyond the SQL shown were not inspected.

Main entry points: [`src/LibraryOperations.java`](https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/LibraryOperations.java) (Library operations), [`src/LibraryApp.java`](https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/LibraryApp.java) (Menu application), [`src/DatabaseConnection.java`](https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/DatabaseConnection.java) (Connection provider), [`src/Book.java`](https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/Book.java) (Book record)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console interface"]
  node_app["Menu application<br/>[LibraryApp.java]"]
end

subgraph group_catalog["Catalog operations"]
  node_operations["Library operations"]
  node_book["Book record<br/>[Book.java]"]
end

subgraph group_persistence["Database access"]
  node_connection["Connection provider"]
  node_config["DB settings<br/>[DB.properties]"]
end

node_user(("Library user"))
node_mysql[("MySQL database")]

node_user -->|"chooses menu"| node_app
node_app -->|"dispatches CRUD"| node_operations
node_app -->|"creates records"| node_book
node_operations -->|"maps records"| node_book
node_operations -->|"opens connections"| node_connection
node_operations -->|"creates table, queries"| node_mysql
node_connection -->|"loads settings"| node_config
node_connection -->|"connects via JDBC"| node_mysql

click node_app "https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/LibraryApp.java"
click node_operations "https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/LibraryOperations.java"
click node_book "https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/Book.java"
click node_connection "https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/DatabaseConnection.java"
click node_config "https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/DB.properties"

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_user toneBlue
class node_operations,node_book,node_mysql toneAmber
class node_connection,node_config toneMint
```

## Components

### Console interface

- [Menu application](https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/LibraryApp.java): `src/LibraryApp.java`

### Catalog operations

- [Library operations](https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/LibraryOperations.java): `src/LibraryOperations.java`
- [Book record](https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/Book.java): `src/Book.java`

### Database access

- [Connection provider](https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/DatabaseConnection.java): `src/DatabaseConnection.java`
- [DB settings](https://github.com/sai-oggu/librarymanagementsystem/blob/main/src/DB.properties): `src/DB.properties`

### Other components

- **Library user**
- **MySQL database**

## Connections

- Library user → Menu application: chooses menu (evidence: `README.md`)
- Menu application → Library operations: dispatches CRUD (evidence: `src/LibraryApp.java`)
- Menu application → Book record: creates records (evidence: `src/LibraryApp.java`)
- Library operations → Book record: maps records (evidence: `src/LibraryOperations.java`)
- Library operations → Connection provider: opens connections (evidence: `src/LibraryOperations.java`)
- Library operations → MySQL database: creates table, queries (evidence: `src/LibraryOperations.java`)
- Connection provider → DB settings: loads settings (evidence: `src/DatabaseConnection.java`)
- Connection provider → MySQL database: connects via JDBC (evidence: `src/DatabaseConnection.java`)
