# mallajyothiprakash/librarymanagementsystem architecture

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

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

## Overview

This is a browser-based library management system: users browse, search and paginate the catalog, manage book records, and issue or return books. The frontend calls a Spring REST API; its service layer applies catalog and loan rules before JPA persistence in MySQL. The README also documents dashboard statistics and backend status, represented by the frontend API module. Backend and frontend runtime wiring are based on the README; source excerpts confirm the controller, service, repository, model, and frontend API interactions. The Jenkins and container deployment setup is omitted as delivery infrastructure.

Main entry points: [`src/main/java/com/library/controller/BookController.java`](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/controller/BookController.java) (Book REST endpoints), [`src/main/java/com/library/repository/BookRepository.java`](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/repository/BookRepository.java) (Book repository), [`src/main/java/com/library/service/BookService.java`](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/service/BookService.java) (Catalog and loan rules), [`frontend/index.html`](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/frontend/index.html) (Library pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser experience"]
  node_pages["Library pages<br/>[index.html]"]
  node_frontend_api["Browser interactions<br/>[api.js]"]
  node_page_init["Page initialization<br/>[app.js]"]
end

subgraph group_backend["Book API and rules"]
  node_rest["Book REST endpoints"]
  node_rules["Catalog and loan rules<br/>[BookService.java]"]
  node_book_model["Book record<br/>[Book.java]"]
  node_error_handler["API error mapping"]
  node_not_found["Missing-book exception"]
end

subgraph group_storage["Book persistence"]
  node_repository["Book repository"]
  node_mysql[("MySQL database")]
end

subgraph group_runtime["Runtime configuration"]
  node_nginx["Nginx frontend<br/>[nginx.conf]"]
  node_seed["Sample book seeding<br/>[DataLoader.java]"]
  node_cors["CORS configuration<br/>[WebConfig.java]"]
  node_settings["Backend settings"]
end

node_reader(("Library user"))

node_reader -->|"opens pages"| node_nginx
node_nginx -->|"serves"| node_pages
node_pages -->|"loads scripts"| node_page_init
node_page_init -->|"starts page actions"| node_frontend_api
node_frontend_api -->|"sends HTTP requests"| node_rest
node_rest -->|"delegates operations"| node_rules
node_rules -->|"reads and writes"| node_repository
node_repository -->|"queries and persists"| node_mysql
node_seed -->|"checks and seeds"| node_repository
node_rest -->|"maps API errors"| node_error_handler
node_rules -->|"throws missing-book"| node_not_found
node_repository -->|"loads and saves"| node_book_model
node_settings -->|"configures connection"| node_mysql
node_cors -->|"allows browser requests"| node_rest

click node_nginx "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/frontend/nginx.conf"
click node_pages "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/frontend/index.html"
click node_frontend_api "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/frontend/js/api.js"
click node_page_init "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/frontend/js/app.js"
click node_rest "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/controller/BookController.java"
click node_rules "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/service/BookService.java"
click node_book_model "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/entity/Book.java"
click node_error_handler "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/exception/GlobalExceptionHandler.java"
click node_not_found "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/exception/BookNotFoundException.java"
click node_repository "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/repository/BookRepository.java"
click node_seed "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/config/DataLoader.java"
click node_cors "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/config/WebConfig.java"
click node_settings "https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/resources/application.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_pages,node_frontend_api,node_page_init,node_reader toneBlue
class node_rest,node_rules,node_book_model,node_error_handler,node_not_found toneAmber
class node_repository,node_mysql toneMint
class node_nginx,node_seed,node_cors,node_settings toneRose
```

## Components

### Browser experience

- [Library pages](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/frontend/index.html): `frontend/index.html`
- [Browser interactions](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/frontend/js/api.js): `frontend/js/api.js`
- [Page initialization](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/frontend/js/app.js): `frontend/js/app.js`

### Book API and rules

- [Book REST endpoints](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/controller/BookController.java): `src/main/java/com/library/controller/BookController.java`
- [Catalog and loan rules](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/service/BookService.java): `src/main/java/com/library/service/BookService.java`
- [Book record](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/entity/Book.java): `src/main/java/com/library/entity/Book.java`
- [API error mapping](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/exception/GlobalExceptionHandler.java): `src/main/java/com/library/exception/GlobalExceptionHandler.java`
- [Missing-book exception](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/exception/BookNotFoundException.java): `src/main/java/com/library/exception/BookNotFoundException.java`

### Book persistence

- [Book repository](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/repository/BookRepository.java): `src/main/java/com/library/repository/BookRepository.java`
- **MySQL database**

### Runtime configuration

- [Nginx frontend](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/frontend/nginx.conf): `frontend/nginx.conf`
- [Sample book seeding](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/config/DataLoader.java): `src/main/java/com/library/config/DataLoader.java`
- [CORS configuration](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/java/com/library/config/WebConfig.java): `src/main/java/com/library/config/WebConfig.java`
- [Backend settings](https://github.com/mallajyothiprakash/librarymanagementsystem/blob/main/src/main/resources/application.properties): `src/main/resources/application.properties`

### Other components

- **Library user**

## Connections

- Library user → Nginx frontend: opens pages
- Nginx frontend → Library pages: serves
- Library pages → Page initialization: loads scripts
- Page initialization → Browser interactions: starts page actions
- Browser interactions → Book REST endpoints: sends HTTP requests
- Book REST endpoints → Catalog and loan rules: delegates operations
- Catalog and loan rules → Book repository: reads and writes
- Book repository → MySQL database: queries and persists
- Sample book seeding → Book repository: checks and seeds
- Book REST endpoints → API error mapping: maps API errors
- Catalog and loan rules → Missing-book exception: throws missing-book
- Book repository → Book record: loads and saves
- Backend settings → MySQL database: configures connection
- CORS configuration → Book REST endpoints: allows browser requests
