# christian001100/library-system architecture

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

- Interactive diagram: https://gitdiagram.com/christian001100/library-system
- Repository: https://github.com/christian001100/library-system

## Overview

This is a desktop library-management system backed by a Flask API and MySQL. The user workflow starts in the Tkinter interface: librarians log in and navigate dashboard, book, member, and lending screens. Those screens expose library operations; the sampled member and dashboard code calls API endpoints, while the backend routes handle requests and use model or database logic. The code shown also documents book search and barcode features, lending history and overdue records, and librarian signup. Books and lending screens are included as product areas, but their API calls are not evidenced in the excerpts.

Main entry points: [`frontend/Sidebar.py`](https://github.com/christian001100/library-system/blob/main/frontend/Sidebar.py) (Navigation), [`frontend/dashboard.py`](https://github.com/christian001100/library-system/blob/main/frontend/dashboard.py) (Dashboard), [`library-system/db_config.py`](https://github.com/christian001100/library-system/blob/main/library-system/db_config.py) (MySQL configuration), [`library-system/app.py`](https://github.com/christian001100/library-system/blob/main/library-system/app.py) (API application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_desktop_app["Desktop app<br/>[main.py]"]
  node_navigation["Navigation<br/>[Sidebar.py]"]
  node_login_ui["Login screen<br/>[login.py]"]
  node_dashboard_ui["Dashboard<br/>[dashboard.py]"]
  node_books_ui["Book screen<br/>[books.py]"]
  node_members_ui["Member screen<br/>[members.py]"]
  node_lending_ui["Lending screen<br/>[lendings.py]"]
end

subgraph group_api["Flask API"]
  node_api_app["API application<br/>[app.py]"]
  node_auth_routes["Authentication routes<br/>[auth_routes.py]"]
  node_book_routes["Book routes<br/>[book_routes.py]"]
  node_member_routes["Member routes<br/>[member_routes.py]"]
  node_lending_routes["Lending routes<br/>[lending_routes.py]"]
end

subgraph group_domain["Library operations"]
  node_book_logic["Book operations<br/>[books.py]"]
  node_member_logic["Member operations<br/>[members.py]"]
  node_lending_logic["Lending operations<br/>[lending.py]"]
  node_librarian_logic["Librarian accounts<br/>[librarians.py]"]
end

subgraph group_persistence["Persistence"]
  node_mysql_config["MySQL configuration<br/>[db_config.py]"]
  node_mysql_db[("Library database")]
end

node_librarian(("Librarian"))

node_librarian -->|"uses"| node_desktop_app
node_desktop_app -->|"creates"| node_navigation
node_desktop_app -->|"starts at"| node_login_ui
node_desktop_app -->|"opens"| node_dashboard_ui
node_navigation -->|"opens"| node_dashboard_ui
node_navigation -->|"opens"| node_members_ui
node_navigation -->|"opens"| node_books_ui
node_navigation -->|"opens"| node_lending_ui
node_api_app -->|"registers"| node_book_routes
node_api_app -->|"registers"| node_member_routes
node_api_app -->|"registers"| node_lending_routes
node_api_app -->|"registers"| node_auth_routes
node_book_routes -->|"calls"| node_book_logic
node_member_routes -->|"calls"| node_member_logic
node_lending_routes -->|"calls"| node_lending_logic
node_auth_routes -->|"calls"| node_librarian_logic
node_book_logic -->|"uses"| node_mysql_config
node_member_logic -->|"uses"| node_mysql_config
node_lending_logic -->|"uses"| node_mysql_config
node_librarian_logic -->|"uses"| node_mysql_config
node_mysql_config -.->|"configures"| node_mysql_db
node_dashboard_ui -->|"requests books"| node_book_routes
node_dashboard_ui -->|"requests members"| node_member_routes
node_dashboard_ui -->|"requests lending data"| node_lending_routes
node_members_ui -->|"requests members"| node_member_routes

click node_desktop_app "https://github.com/christian001100/library-system/blob/main/frontend/main.py"
click node_navigation "https://github.com/christian001100/library-system/blob/main/frontend/Sidebar.py"
click node_login_ui "https://github.com/christian001100/library-system/blob/main/frontend/login.py"
click node_dashboard_ui "https://github.com/christian001100/library-system/blob/main/frontend/dashboard.py"
click node_books_ui "https://github.com/christian001100/library-system/blob/main/frontend/books.py"
click node_members_ui "https://github.com/christian001100/library-system/blob/main/frontend/members.py"
click node_lending_ui "https://github.com/christian001100/library-system/blob/main/frontend/lendings.py"
click node_api_app "https://github.com/christian001100/library-system/blob/main/library-system/app.py"
click node_auth_routes "https://github.com/christian001100/library-system/blob/main/library-system/routes/auth_routes.py"
click node_book_routes "https://github.com/christian001100/library-system/blob/main/library-system/routes/book_routes.py"
click node_member_routes "https://github.com/christian001100/library-system/blob/main/library-system/routes/member_routes.py"
click node_lending_routes "https://github.com/christian001100/library-system/blob/main/library-system/routes/lending_routes.py"
click node_book_logic "https://github.com/christian001100/library-system/blob/main/library-system/models/books.py"
click node_member_logic "https://github.com/christian001100/library-system/blob/main/library-system/models/members.py"
click node_lending_logic "https://github.com/christian001100/library-system/blob/main/library-system/models/lending.py"
click node_librarian_logic "https://github.com/christian001100/library-system/blob/main/library-system/models/librarians.py"
click node_mysql_config "https://github.com/christian001100/library-system/blob/main/library-system/db_config.py"

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_desktop_app,node_navigation,node_login_ui,node_dashboard_ui,node_books_ui,node_members_ui,node_lending_ui toneBlue
class node_api_app,node_auth_routes,node_book_routes,node_member_routes,node_lending_routes toneAmber
class node_book_logic,node_member_logic,node_lending_logic,node_librarian_logic toneMint
class node_mysql_config,node_mysql_db toneRose
class node_librarian toneIndigo
```

## Components

### Desktop interface

- [Desktop app](https://github.com/christian001100/library-system/blob/main/frontend/main.py): `frontend/main.py`
- [Navigation](https://github.com/christian001100/library-system/blob/main/frontend/Sidebar.py): `frontend/Sidebar.py`
- [Login screen](https://github.com/christian001100/library-system/blob/main/frontend/login.py): `frontend/login.py`
- [Dashboard](https://github.com/christian001100/library-system/blob/main/frontend/dashboard.py): `frontend/dashboard.py`
- [Book screen](https://github.com/christian001100/library-system/blob/main/frontend/books.py): `frontend/books.py`
- [Member screen](https://github.com/christian001100/library-system/blob/main/frontend/members.py): `frontend/members.py`
- [Lending screen](https://github.com/christian001100/library-system/blob/main/frontend/lendings.py): `frontend/lendings.py`

### Flask API

- [API application](https://github.com/christian001100/library-system/blob/main/library-system/app.py): `library-system/app.py`
- [Authentication routes](https://github.com/christian001100/library-system/blob/main/library-system/routes/auth_routes.py): `library-system/routes/auth_routes.py`
- [Book routes](https://github.com/christian001100/library-system/blob/main/library-system/routes/book_routes.py): `library-system/routes/book_routes.py`
- [Member routes](https://github.com/christian001100/library-system/blob/main/library-system/routes/member_routes.py): `library-system/routes/member_routes.py`
- [Lending routes](https://github.com/christian001100/library-system/blob/main/library-system/routes/lending_routes.py): `library-system/routes/lending_routes.py`

### Library operations

- [Book operations](https://github.com/christian001100/library-system/blob/main/library-system/models/books.py): `library-system/models/books.py`
- [Member operations](https://github.com/christian001100/library-system/blob/main/library-system/models/members.py): `library-system/models/members.py`
- [Lending operations](https://github.com/christian001100/library-system/blob/main/library-system/models/lending.py): `library-system/models/lending.py`
- [Librarian accounts](https://github.com/christian001100/library-system/blob/main/library-system/models/librarians.py): `library-system/models/librarians.py`

### Persistence

- [MySQL configuration](https://github.com/christian001100/library-system/blob/main/library-system/db_config.py): `library-system/db_config.py`
- **Library database**

### Other components

- **Librarian**

## Connections

- Librarian → Desktop app: uses
- Desktop app → Navigation: creates (evidence: `frontend/main.py`)
- Desktop app → Login screen: starts at (evidence: `frontend/main.py`)
- Desktop app → Dashboard: opens (evidence: `frontend/main.py`)
- Navigation → Dashboard: opens (evidence: `frontend/Sidebar.py`)
- Navigation → Member screen: opens (evidence: `frontend/Sidebar.py`)
- Navigation → Book screen: opens (evidence: `frontend/Sidebar.py`)
- Navigation → Lending screen: opens (evidence: `frontend/Sidebar.py`)
- API application → Book routes: registers (evidence: `library-system/app.py`)
- API application → Member routes: registers (evidence: `library-system/app.py`)
- API application → Lending routes: registers (evidence: `library-system/app.py`)
- API application → Authentication routes: registers (evidence: `library-system/app.py`)
- Book routes → Book operations: calls (evidence: `library-system/routes/book_routes.py`)
- Member routes → Member operations: calls (evidence: `library-system/routes/member_routes.py`)
- Lending routes → Lending operations: calls (evidence: `library-system/routes/lending_routes.py`)
- Authentication routes → Librarian accounts: calls (evidence: `library-system/routes/auth_routes.py`)
- Book operations → MySQL configuration: uses (evidence: `library-system/models/books.py`)
- Member operations → MySQL configuration: uses (evidence: `library-system/models/members.py`)
- Lending operations → MySQL configuration: uses (evidence: `library-system/models/lending.py`)
- Librarian accounts → MySQL configuration: uses (evidence: `library-system/models/librarians.py`)
- MySQL configuration → Library database: configures
- Dashboard → Book routes: requests books (evidence: `frontend/dashboard.py`)
- Dashboard → Member routes: requests members (evidence: `frontend/dashboard.py`)
- Dashboard → Lending routes: requests lending data (evidence: `frontend/dashboard.py`)
- Member screen → Member routes: requests members (evidence: `frontend/members.py`)
