# bibcs29/-library-management architecture

> Architecture diagram of the GitHub repository bibcs29/-library-management, 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/bibcs29/-library-management
- Repository: https://github.com/bibcs29/-library-management

## Overview

This is a Flask library-management application. Users browse books and submit issue or return actions; administrators manage books and users, review requests, and handle messages and notifications. The application is concentrated in app.py, which also contains authentication, validation, security controls, and SQLite access. The graph separates those responsibilities for clarity, although they are not separate runtime modules. Feature branches beyond the excerpts are supported by the README and security-verification checklist; their internal call paths are not shown.

Main entry points: [`library.db`](https://github.com/bibcs29/-library-management/blob/main/library.db) (SQLite data), [`app.py`](https://github.com/bibcs29/-library-management/blob/main/app.py) (Admin operations), [`templates`](https://github.com/bibcs29/-library-management/tree/main/templates) (Web pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and accounts"]
  node_webapp["Flask routes<br/>[app.py]"]
  node_auth["Authentication and roles<br/>[app.py]"]
  node_profiles["Profiles and restrictions<br/>[app.py]"]
end

subgraph group_library["Library operations"]
  node_catalog["Book catalog<br/>[app.py]"]
  node_circulation["Issue and return<br/>[app.py]"]
  node_requests["Book requests<br/>[app.py]"]
end

subgraph group_admin["Administration and communication"]
  node_admin["Admin operations<br/>[app.py]"]
  node_messages["Messages and notices<br/>[app.py]"]
  node_audit["Audit logging<br/>[app.py]"]
end

subgraph group_persistence["Persistence and interface"]
  node_database[("SQLite data<br/>[library.db]")]
  node_templates["Web pages"]
end

node_browser(("Browser user"))

node_browser -->|"submits requests"| node_webapp
node_webapp -->|"renders pages"| node_templates
node_webapp -->|"routes login"| node_auth
node_auth -->|"reads account state"| node_database
node_profiles -->|"updates account data"| node_database
node_catalog -->|"reads and writes books"| node_database
node_circulation -->|"updates loan status"| node_database
node_requests -->|"stores request state"| node_database
node_admin -->|"manages records"| node_database
node_messages -->|"stores messages"| node_database
node_admin -->|"creates notifications"| node_messages
node_admin -->|"logs actions"| node_audit
node_messages -.->|"renders message pages"| node_templates

click node_webapp "https://github.com/bibcs29/-library-management/blob/main/app.py"
click node_auth "https://github.com/bibcs29/-library-management/blob/main/app.py"
click node_profiles "https://github.com/bibcs29/-library-management/blob/main/app.py"
click node_catalog "https://github.com/bibcs29/-library-management/blob/main/app.py"
click node_circulation "https://github.com/bibcs29/-library-management/blob/main/app.py"
click node_requests "https://github.com/bibcs29/-library-management/blob/main/app.py"
click node_admin "https://github.com/bibcs29/-library-management/blob/main/app.py"
click node_messages "https://github.com/bibcs29/-library-management/blob/main/app.py"
click node_audit "https://github.com/bibcs29/-library-management/blob/main/app.py"
click node_database "https://github.com/bibcs29/-library-management/blob/main/library.db"
click node_templates "https://github.com/bibcs29/-library-management/tree/main/templates"

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_webapp,node_auth,node_profiles,node_browser toneBlue
class node_catalog,node_circulation,node_requests toneAmber
class node_admin,node_messages,node_audit toneMint
class node_database,node_templates toneRose
```

## Components

### Access and accounts

- [Flask routes](https://github.com/bibcs29/-library-management/blob/main/app.py): `app.py`
- [Authentication and roles](https://github.com/bibcs29/-library-management/blob/main/app.py): `app.py`
- [Profiles and restrictions](https://github.com/bibcs29/-library-management/blob/main/app.py): `app.py`

### Library operations

- [Book catalog](https://github.com/bibcs29/-library-management/blob/main/app.py): `app.py`
- [Issue and return](https://github.com/bibcs29/-library-management/blob/main/app.py): `app.py`
- [Book requests](https://github.com/bibcs29/-library-management/blob/main/app.py): `app.py`

### Administration and communication

- [Admin operations](https://github.com/bibcs29/-library-management/blob/main/app.py): `app.py`
- [Messages and notices](https://github.com/bibcs29/-library-management/blob/main/app.py): `app.py`
- [Audit logging](https://github.com/bibcs29/-library-management/blob/main/app.py): `app.py`

### Persistence and interface

- [SQLite data](https://github.com/bibcs29/-library-management/blob/main/library.db): `library.db`
- [Web pages](https://github.com/bibcs29/-library-management/tree/main/templates): `templates`

### Other components

- **Browser user**

## Connections

- Browser user → Flask routes: submits requests (evidence: `README.md`)
- Flask routes → Web pages: renders pages (evidence: `app.py`)
- Flask routes → Authentication and roles: routes login (evidence: `app.py`)
- Authentication and roles → SQLite data: reads account state (evidence: `app.py`)
- Profiles and restrictions → SQLite data: updates account data (evidence: `app.py`)
- Book catalog → SQLite data: reads and writes books (evidence: `README.md`)
- Issue and return → SQLite data: updates loan status (evidence: `README.md`)
- Book requests → SQLite data: stores request state (evidence: `app.py`)
- Admin operations → SQLite data: manages records (evidence: `app.py`)
- Messages and notices → SQLite data: stores messages (evidence: `app.py`)
- Admin operations → Messages and notices: creates notifications (evidence: `app.py`)
- Admin operations → Audit logging: logs actions (evidence: `app.py`)
- Messages and notices → Web pages: renders message pages
