# vasireddy-web/library-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/vasireddy-web/library-management-system
- Repository: https://github.com/vasireddy-web/library-management-system

## Overview

This is a full-stack library circulation system. Readers register, sign in, browse the catalog, request books, and submit return requests; administrators approve registrations and circulation requests, manage inventory, and monitor reports. React routes lead to Express APIs, whose controllers implement the domain operations against PostgreSQL or the documented in-memory fallback. The README documents additional catalog, member, and reporting capabilities. Some client-to-API wiring is not shown in the excerpts, so those links are omitted rather than inferred.

Main entry points: [`client/src/App.jsx`](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/App.jsx) (App Routes), [`server/server.js`](https://github.com/vasireddy-web/library-management-system/blob/master/server/server.js) (Express Server), [`server/config/db.js`](https://github.com/vasireddy-web/library-management-system/blob/master/server/config/db.js) (Database Adapter), [`server/controllers/authController.js`](https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/authController.js) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Reader and Admin UI"]
  node_app["App Routes<br/>[App.jsx]"]
  node_authstate["Auth State<br/>[AuthContext.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_registration["Registration<br/>[Register.jsx]"]
  node_readerhome["Reader Dashboard<br/>[UserDashboard.jsx]"]
  node_adminhome["Admin Dashboard<br/>[Dashboard.jsx]"]
  node_catalogui["Catalog Management<br/>[Books.jsx]"]
  node_membersui["Member Directory<br/>[Members.jsx]"]
  node_borrowui["Borrow Desk<br/>[Borrow.jsx]"]
  node_returnui["Return Desk<br/>[Return.jsx]"]
  node_registrationui["Registration Review<br/>[Registrations.jsx]"]
  node_reportsui["Reports<br/>[Reports.jsx]"]
end

subgraph group_api["API and Identity"]
  node_server["Express Server<br/>[server.js]"]
  node_authapi["Authentication<br/>[authController.js]"]
end

subgraph group_circulation["Catalog and Circulation"]
  node_bookapi["Catalog Operations<br/>[bookController.js]"]
  node_borrowapi["Borrow and Return"]
  node_messageapi["Request Approvals"]
  node_memberapi["Member Operations"]
end

subgraph group_data["Persistence and Metrics"]
  node_metricsapi["Dashboard Metrics"]
  node_database[("Database Adapter<br/>[db.js]")]
  node_schema["Relational Schema<br/>[schema.sql]"]
end

node_reader(("Reader"))
node_administrator(("Administrator"))

node_reader -->|"uses"| node_app
node_administrator -->|"uses"| node_app
node_app -->|"checks access"| node_authstate
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_registration
node_app -->|"routes to"| node_readerhome
node_app -->|"routes to"| node_adminhome
node_app -->|"routes to"| node_catalogui
node_app -->|"routes to"| node_membersui
node_app -->|"routes to"| node_borrowui
node_app -->|"routes to"| node_returnui
node_app -->|"routes to"| node_registrationui
node_app -->|"routes to"| node_reportsui
node_server -->|"mounts auth routes"| node_authapi
node_server -->|"mounts catalog routes"| node_bookapi
node_server -->|"mounts borrow routes"| node_borrowapi
node_server -->|"mounts message routes"| node_messageapi
node_server -->|"mounts member routes"| node_memberapi
node_server -->|"mounts dashboard routes"| node_metricsapi
node_authapi -->|"queries"| node_database
node_bookapi -->|"queries"| node_database
node_borrowapi -->|"reads and updates"| node_database
node_messageapi -->|"reads and updates"| node_database
node_memberapi -->|"queries"| node_database
node_metricsapi -->|"queries"| node_database
node_database -.->|"implements tables"| node_schema
node_readerhome -.->|"requests circulation"| node_messageapi
node_adminhome -.->|"loads metrics"| node_metricsapi
node_catalogui -.->|"manages catalog"| node_bookapi
node_borrowui -.->|"issues books"| node_borrowapi
node_returnui -.->|"processes returns"| node_borrowapi
node_returnui -.->|"reviews requests"| node_messageapi
node_registrationui -.->|"reviews accounts"| node_authapi
node_membersui -.->|"views members"| node_memberapi
node_reportsui -.->|"views statistics"| node_metricsapi
node_login -.->|"authenticates"| node_authapi
node_registration -.->|"registers account"| node_authapi

click node_app "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/App.jsx"
click node_authstate "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/context/AuthContext.jsx"
click node_login "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Login.jsx"
click node_registration "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Register.jsx"
click node_readerhome "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/UserDashboard.jsx"
click node_adminhome "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Dashboard.jsx"
click node_catalogui "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Books/Books.jsx"
click node_membersui "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Members.jsx"
click node_borrowui "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Borrow.jsx"
click node_returnui "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Return.jsx"
click node_registrationui "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Registrations.jsx"
click node_reportsui "https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Reports.jsx"
click node_server "https://github.com/vasireddy-web/library-management-system/blob/master/server/server.js"
click node_authapi "https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/authController.js"
click node_bookapi "https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/bookController.js"
click node_borrowapi "https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/borrowController.js"
click node_messageapi "https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/messageController.js"
click node_memberapi "https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/memberController.js"
click node_metricsapi "https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/dashboardController.js"
click node_database "https://github.com/vasireddy-web/library-management-system/blob/master/server/config/db.js"
click node_schema "https://github.com/vasireddy-web/library-management-system/blob/master/server/config/schema.sql"

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_authstate,node_login,node_registration,node_readerhome,node_adminhome,node_catalogui,node_membersui,node_borrowui,node_returnui,node_registrationui,node_reportsui toneBlue
class node_server,node_authapi toneAmber
class node_bookapi,node_borrowapi,node_messageapi,node_memberapi toneMint
class node_metricsapi,node_database,node_schema toneRose
class node_reader,node_administrator toneIndigo
```

## Components

### Reader and Admin UI

- [App Routes](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/App.jsx): `client/src/App.jsx`
- [Auth State](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Login](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Login.jsx): `client/src/pages/Login.jsx`
- [Registration](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Register.jsx): `client/src/pages/Register.jsx`
- [Reader Dashboard](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/UserDashboard.jsx): `client/src/pages/UserDashboard.jsx`
- [Admin Dashboard](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Catalog Management](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Books/Books.jsx): `client/src/pages/Books/Books.jsx`
- [Member Directory](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Members.jsx): `client/src/pages/Members.jsx`
- [Borrow Desk](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Borrow.jsx): `client/src/pages/Borrow.jsx`
- [Return Desk](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Return.jsx): `client/src/pages/Return.jsx`
- [Registration Review](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Registrations.jsx): `client/src/pages/Registrations.jsx`
- [Reports](https://github.com/vasireddy-web/library-management-system/blob/master/client/src/pages/Reports.jsx): `client/src/pages/Reports.jsx`

### API and Identity

- [Express Server](https://github.com/vasireddy-web/library-management-system/blob/master/server/server.js): `server/server.js`
- [Authentication](https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/authController.js): `server/controllers/authController.js`

### Catalog and Circulation

- [Catalog Operations](https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/bookController.js): `server/controllers/bookController.js`
- [Borrow and Return](https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/borrowController.js): `server/controllers/borrowController.js`
- [Request Approvals](https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/messageController.js): `server/controllers/messageController.js`
- [Member Operations](https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/memberController.js): `server/controllers/memberController.js`

### Persistence and Metrics

- [Dashboard Metrics](https://github.com/vasireddy-web/library-management-system/blob/master/server/controllers/dashboardController.js): `server/controllers/dashboardController.js`
- [Database Adapter](https://github.com/vasireddy-web/library-management-system/blob/master/server/config/db.js): `server/config/db.js`
- [Relational Schema](https://github.com/vasireddy-web/library-management-system/blob/master/server/config/schema.sql): `server/config/schema.sql`

### Other components

- **Reader**
- **Administrator**

## Connections

- Reader → App Routes: uses (evidence: `README.md`)
- Administrator → App Routes: uses (evidence: `README.md`)
- App Routes → Auth State: checks access (evidence: `client/src/App.jsx`)
- App Routes → Login: routes to (evidence: `client/src/App.jsx`)
- App Routes → Registration: routes to (evidence: `client/src/App.jsx`)
- App Routes → Reader Dashboard: routes to (evidence: `client/src/App.jsx`)
- App Routes → Admin Dashboard: routes to (evidence: `client/src/App.jsx`)
- App Routes → Catalog Management: routes to (evidence: `client/src/App.jsx`)
- App Routes → Member Directory: routes to (evidence: `client/src/App.jsx`)
- App Routes → Borrow Desk: routes to (evidence: `client/src/App.jsx`)
- App Routes → Return Desk: routes to (evidence: `client/src/App.jsx`)
- App Routes → Registration Review: routes to (evidence: `client/src/App.jsx`)
- App Routes → Reports: routes to (evidence: `client/src/App.jsx`)
- Express Server → Authentication: mounts auth routes (evidence: `server/server.js`)
- Express Server → Catalog Operations: mounts catalog routes (evidence: `server/server.js`)
- Express Server → Borrow and Return: mounts borrow routes (evidence: `server/server.js`)
- Express Server → Request Approvals: mounts message routes (evidence: `server/server.js`)
- Express Server → Member Operations: mounts member routes (evidence: `server/server.js`)
- Express Server → Dashboard Metrics: mounts dashboard routes (evidence: `server/server.js`)
- Authentication → Database Adapter: queries (evidence: `server/controllers/authController.js`)
- Catalog Operations → Database Adapter: queries (evidence: `server/controllers/bookController.js`)
- Borrow and Return → Database Adapter: reads and updates (evidence: `server/controllers/borrowController.js`)
- Request Approvals → Database Adapter: reads and updates (evidence: `server/controllers/messageController.js`)
- Member Operations → Database Adapter: queries (evidence: `server/controllers/memberController.js`)
- Dashboard Metrics → Database Adapter: queries (evidence: `server/controllers/dashboardController.js`)
- Database Adapter → Relational Schema: implements tables (evidence: `README.md`)
- Reader Dashboard → Request Approvals: requests circulation
- Admin Dashboard → Dashboard Metrics: loads metrics
- Catalog Management → Catalog Operations: manages catalog
- Borrow Desk → Borrow and Return: issues books
- Return Desk → Borrow and Return: processes returns
- Return Desk → Request Approvals: reviews requests
- Registration Review → Authentication: reviews accounts
- Member Directory → Member Operations: views members
- Reports → Dashboard Metrics: views statistics
- Login → Authentication: authenticates
- Registration → Authentication: registers account
