# akram48616/library-api architecture

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

- Interactive diagram: https://gitdiagram.com/akram48616/library-api
- Repository: https://github.com/akram48616/library-api

## Overview

This is a Spring-based library management application. Its apparent user workflow covers authentication, catalog and member management, and borrowing/returning books, with persistence behind service/controller layers. The tree also shows token security, file uploads, daily reports/email, and health/operational support. No README text or source excerpts were provided, so relationships are shown only as unverified dashed links; implementation details and exact call ownership cannot be confirmed.

Main entry points: [`src/main/java/org/example/librarymanagementsystem/Controller`](https://github.com/akram48616/library-api/tree/main/src/main/java/org/example/librarymanagementsystem/Controller) (REST controllers), [`src/main/java/org/example/librarymanagementsystem/Repository`](https://github.com/akram48616/library-api/tree/main/src/main/java/org/example/librarymanagementsystem/Repository) (Domain repositories), [`src/main/java/org/example/librarymanagementsystem/Service/RefreshTokenService.java`](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/RefreshTokenService.java) (Refresh token service), [`src/main/java/org/example/librarymanagementsystem/Service/BookService.java`](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/BookService.java) (Catalog services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_controllers["REST controllers"]
  node_dto["Request and response DTOs"]
end

subgraph group_domain["Library domain"]
  node_catalog["Catalog services<br/>[BookService.java]"]
  node_authors["Author services<br/>[AuthorService.java]"]
  node_categories["Category services"]
  node_publishers["Publisher services"]
  node_members["Member services<br/>[MemberService.java]"]
  node_borrowing["Borrowing services<br/>[BorrowService.java]"]
  node_repositories["Domain repositories"]
  node_database[("Relational database")]
end

subgraph group_identity["Identity and security"]
  node_auth["Authentication service<br/>[AuthService.java]"]
  node_refresh["Refresh token service"]
  node_jwt["JWT security<br/>[JwtFilter.java]"]
end

subgraph group_support["Supporting features"]
  node_files["File storage"]
  node_reports["Daily reports"]
  node_email["Email delivery<br/>[EmailService.java]"]
end

subgraph group_ops["Operations"]
  node_scheduler["Token cleanup"]
  node_health["Health indicator"]
  node_app["Application bootstrap"]
end

node_user(("Library user"))

node_user -.->|"sends requests"| node_controllers
node_controllers -.->|"uses DTOs"| node_dto
node_controllers -.->|"delegates to"| node_catalog
node_controllers -.->|"delegates to"| node_authors
node_controllers -.->|"delegates to"| node_categories
node_controllers -.->|"delegates to"| node_publishers
node_controllers -.->|"delegates to"| node_members
node_controllers -.->|"delegates to"| node_borrowing
node_controllers -.->|"delegates to"| node_auth
node_catalog -.->|"uses repositories"| node_repositories
node_authors -.->|"uses repositories"| node_repositories
node_categories -.->|"uses repositories"| node_repositories
node_publishers -.->|"uses repositories"| node_repositories
node_members -.->|"uses repositories"| node_repositories
node_borrowing -.->|"uses repositories"| node_repositories
node_repositories -.->|"persists data"| node_database
node_auth -.->|"uses tokens"| node_refresh
node_jwt -.->|"checks tokens"| node_refresh
node_controllers -.->|"delegates file actions"| node_files
node_reports -.->|"may send reports"| node_email
node_scheduler -.->|"cleans tokens"| node_refresh
node_app -.->|"enables monitoring"| node_health

click node_controllers "https://github.com/akram48616/library-api/tree/main/src/main/java/org/example/librarymanagementsystem/Controller"
click node_dto "https://github.com/akram48616/library-api/tree/main/src/main/java/org/example/librarymanagementsystem/DTO"
click node_catalog "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/BookService.java"
click node_authors "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/AuthorService.java"
click node_categories "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/CategoryService.java"
click node_publishers "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/PublisherService.java"
click node_members "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/MemberService.java"
click node_borrowing "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/BorrowService.java"
click node_repositories "https://github.com/akram48616/library-api/tree/main/src/main/java/org/example/librarymanagementsystem/Repository"
click node_auth "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/AuthService.java"
click node_refresh "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/RefreshTokenService.java"
click node_jwt "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/security/JwtFilter.java"
click node_files "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/FileStorageService.java"
click node_reports "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/DailyReportService.java"
click node_email "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/EmailService.java"
click node_scheduler "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Scheduler/TokenCleanupScheduler.java"
click node_health "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/actuator/LibraryHealthIndicator.java"
click node_app "https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/LibraryManagementSystemApplication.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_controllers,node_dto,node_user toneBlue
class node_catalog,node_authors,node_categories,node_publishers,node_members,node_borrowing,node_repositories,node_database toneAmber
class node_auth,node_refresh,node_jwt toneMint
class node_files,node_reports,node_email toneRose
class node_scheduler,node_health,node_app toneIndigo
```

## Components

### API

- [REST controllers](https://github.com/akram48616/library-api/tree/main/src/main/java/org/example/librarymanagementsystem/Controller): `src/main/java/org/example/librarymanagementsystem/Controller`
- [Request and response DTOs](https://github.com/akram48616/library-api/tree/main/src/main/java/org/example/librarymanagementsystem/DTO): `src/main/java/org/example/librarymanagementsystem/DTO`

### Library domain

- [Catalog services](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/BookService.java): `src/main/java/org/example/librarymanagementsystem/Service/BookService.java`
- [Author services](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/AuthorService.java): `src/main/java/org/example/librarymanagementsystem/Service/AuthorService.java`
- [Category services](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/CategoryService.java): `src/main/java/org/example/librarymanagementsystem/Service/CategoryService.java`
- [Publisher services](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/PublisherService.java): `src/main/java/org/example/librarymanagementsystem/Service/PublisherService.java`
- [Member services](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/MemberService.java): `src/main/java/org/example/librarymanagementsystem/Service/MemberService.java`
- [Borrowing services](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/BorrowService.java): `src/main/java/org/example/librarymanagementsystem/Service/BorrowService.java`
- [Domain repositories](https://github.com/akram48616/library-api/tree/main/src/main/java/org/example/librarymanagementsystem/Repository): `src/main/java/org/example/librarymanagementsystem/Repository`
- **Relational database**

### Identity and security

- [Authentication service](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/AuthService.java): `src/main/java/org/example/librarymanagementsystem/Service/AuthService.java`
- [Refresh token service](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/RefreshTokenService.java): `src/main/java/org/example/librarymanagementsystem/Service/RefreshTokenService.java`
- [JWT security](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/security/JwtFilter.java): `src/main/java/org/example/librarymanagementsystem/security/JwtFilter.java`

### Supporting features

- [File storage](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/FileStorageService.java): `src/main/java/org/example/librarymanagementsystem/Service/FileStorageService.java`
- [Daily reports](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/DailyReportService.java): `src/main/java/org/example/librarymanagementsystem/Service/DailyReportService.java`
- [Email delivery](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Service/EmailService.java): `src/main/java/org/example/librarymanagementsystem/Service/EmailService.java`

### Operations

- [Token cleanup](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/Scheduler/TokenCleanupScheduler.java): `src/main/java/org/example/librarymanagementsystem/Scheduler/TokenCleanupScheduler.java`
- [Health indicator](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/actuator/LibraryHealthIndicator.java): `src/main/java/org/example/librarymanagementsystem/actuator/LibraryHealthIndicator.java`
- [Application bootstrap](https://github.com/akram48616/library-api/blob/main/src/main/java/org/example/librarymanagementsystem/LibraryManagementSystemApplication.java): `src/main/java/org/example/librarymanagementsystem/LibraryManagementSystemApplication.java`

### Other components

- **Library user**

## Connections

- Library user → REST controllers: sends requests
- REST controllers → Request and response DTOs: uses DTOs
- REST controllers → Catalog services: delegates to
- REST controllers → Author services: delegates to
- REST controllers → Category services: delegates to
- REST controllers → Publisher services: delegates to
- REST controllers → Member services: delegates to
- REST controllers → Borrowing services: delegates to
- REST controllers → Authentication service: delegates to
- Catalog services → Domain repositories: uses repositories
- Author services → Domain repositories: uses repositories
- Category services → Domain repositories: uses repositories
- Publisher services → Domain repositories: uses repositories
- Member services → Domain repositories: uses repositories
- Borrowing services → Domain repositories: uses repositories
- Domain repositories → Relational database: persists data
- Authentication service → Refresh token service: uses tokens
- JWT security → Refresh token service: checks tokens
- REST controllers → File storage: delegates file actions
- Daily reports → Email delivery: may send reports
- Token cleanup → Refresh token service: cleans tokens
- Application bootstrap → Health indicator: enables monitoring
