# xieshie/basa---library-website architecture

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

- Interactive diagram: https://gitdiagram.com/xieshie/basa---library-website
- Repository: https://github.com/xieshie/basa---library-website

## Overview

Basa is a PHP library and bookshop application. Its main user journey is signing in or registering, browsing the book catalog, managing a cart, and submitting a reservation or checkout; the README also describes account management and contacting administrators. Librarians have catalog, inventory, order, and staff-management screens. The tree and excerpts establish the login/database and contact-mail paths; checkout, account, and administrative persistence details are inferred from product descriptions and filenames, so uncertain wiring is omitted.

Main entry points: [`index.php`](https://github.com/xieshie/basa---library-website/blob/main/index.php) (Sign in), [`php/db_conn.php`](https://github.com/xieshie/basa---library-website/blob/main/php/db_conn.php) (Application database), [`process_checkout.php`](https://github.com/xieshie/basa---library-website/blob/main/process_checkout.php) (Checkout), [`php/sendmail.php`](https://github.com/xieshie/basa---library-website/blob/main/php/sendmail.php) (Contact form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Reader experience"]
  node_signin["Sign in<br/>[index.php]"]
  node_registration["Registration<br/>[signup.php]"]
  node_catalog["Book catalog<br/>[book_shop.php]"]
  node_cart["Book cart<br/>[book_cart.php]"]
  node_checkout["Checkout"]
  node_account["Reader account<br/>[account_page.php]"]
  node_contact["Contact form<br/>[sendmail.php]"]
  node_home["Reader home<br/>[home.php]"]
end

subgraph group_admin["Library operations"]
  node_catalog_admin["Catalog management<br/>[books.php]"]
  node_inventory_admin["Inventory management<br/>[inventory.php]"]
  node_people_admin["People management<br/>[authors.php]"]
  node_publisher_admin["Publisher management<br/>[publishers.php]"]
  node_orders_admin["Order management<br/>[orders.php]"]
  node_staff_admin["Librarian management<br/>[librarian.php]"]
end

subgraph group_backend["Application services"]
  node_db[("Application database<br/>[db_conn.php]")]
  node_session_check["Login checks<br/>[check-login.php]"]
  node_qr["QR generation<br/>[qr_code.php]"]
end

subgraph group_integrations["External services"]
  node_mysql[("MySQL")]
  node_mail["Mail service"]
end

node_reader(("Reader"))
node_librarian(("Librarian"))

node_reader -->|"signs in"| node_signin
node_reader -->|"registers"| node_registration
node_reader -->|"browses"| node_catalog
node_reader -->|"manages cart"| node_cart
node_reader -->|"manages account"| node_account
node_reader -->|"contacts"| node_contact
node_signin -->|"queries credentials"| node_db
node_signin -->|"redirects on success"| node_home
node_session_check -->|"checks access"| node_db
node_contact -->|"sends message"| node_mail
node_librarian -->|"manages books"| node_catalog_admin
node_librarian -->|"manages stock"| node_inventory_admin
node_librarian -->|"manages authors"| node_people_admin
node_librarian -->|"manages publishers"| node_publisher_admin
node_librarian -->|"reviews orders"| node_orders_admin
node_librarian -->|"manages staff"| node_staff_admin
node_db -->|"connects to"| node_mysql
node_reader -->|"submits checkout"| node_checkout
node_checkout -.->|"generates code"| node_qr

click node_signin "https://github.com/xieshie/basa---library-website/blob/main/index.php"
click node_registration "https://github.com/xieshie/basa---library-website/blob/main/signup.php"
click node_catalog "https://github.com/xieshie/basa---library-website/blob/main/book_shop.php"
click node_cart "https://github.com/xieshie/basa---library-website/blob/main/book_cart.php"
click node_checkout "https://github.com/xieshie/basa---library-website/blob/main/process_checkout.php"
click node_account "https://github.com/xieshie/basa---library-website/blob/main/account_page.php"
click node_contact "https://github.com/xieshie/basa---library-website/blob/main/php/sendmail.php"
click node_home "https://github.com/xieshie/basa---library-website/blob/main/home.php"
click node_catalog_admin "https://github.com/xieshie/basa---library-website/blob/main/books.php"
click node_inventory_admin "https://github.com/xieshie/basa---library-website/blob/main/inventory.php"
click node_people_admin "https://github.com/xieshie/basa---library-website/blob/main/authors.php"
click node_publisher_admin "https://github.com/xieshie/basa---library-website/blob/main/publishers.php"
click node_orders_admin "https://github.com/xieshie/basa---library-website/blob/main/orders.php"
click node_staff_admin "https://github.com/xieshie/basa---library-website/blob/main/librarian.php"
click node_db "https://github.com/xieshie/basa---library-website/blob/main/php/db_conn.php"
click node_session_check "https://github.com/xieshie/basa---library-website/blob/main/php/check-login.php"
click node_qr "https://github.com/xieshie/basa---library-website/blob/main/qr_code.php"

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_signin,node_registration,node_catalog,node_cart,node_checkout,node_account,node_contact,node_home toneBlue
class node_catalog_admin,node_inventory_admin,node_people_admin,node_publisher_admin,node_orders_admin,node_staff_admin toneAmber
class node_db,node_session_check,node_qr toneMint
class node_mysql,node_mail toneRose
class node_reader,node_librarian toneIndigo
```

## Components

### Reader experience

- [Sign in](https://github.com/xieshie/basa---library-website/blob/main/index.php): `index.php`
- [Registration](https://github.com/xieshie/basa---library-website/blob/main/signup.php): `signup.php`
- [Book catalog](https://github.com/xieshie/basa---library-website/blob/main/book_shop.php): `book_shop.php`
- [Book cart](https://github.com/xieshie/basa---library-website/blob/main/book_cart.php): `book_cart.php`
- [Checkout](https://github.com/xieshie/basa---library-website/blob/main/process_checkout.php): `process_checkout.php`
- [Reader account](https://github.com/xieshie/basa---library-website/blob/main/account_page.php): `account_page.php`
- [Contact form](https://github.com/xieshie/basa---library-website/blob/main/php/sendmail.php): `php/sendmail.php`
- [Reader home](https://github.com/xieshie/basa---library-website/blob/main/home.php): `home.php`

### Library operations

- [Catalog management](https://github.com/xieshie/basa---library-website/blob/main/books.php): `books.php`
- [Inventory management](https://github.com/xieshie/basa---library-website/blob/main/inventory.php): `inventory.php`
- [People management](https://github.com/xieshie/basa---library-website/blob/main/authors.php): `authors.php`
- [Publisher management](https://github.com/xieshie/basa---library-website/blob/main/publishers.php): `publishers.php`
- [Order management](https://github.com/xieshie/basa---library-website/blob/main/orders.php): `orders.php`
- [Librarian management](https://github.com/xieshie/basa---library-website/blob/main/librarian.php): `librarian.php`

### Application services

- [Application database](https://github.com/xieshie/basa---library-website/blob/main/php/db_conn.php): `php/db_conn.php`
- [Login checks](https://github.com/xieshie/basa---library-website/blob/main/php/check-login.php): `php/check-login.php`
- [QR generation](https://github.com/xieshie/basa---library-website/blob/main/qr_code.php): `qr_code.php`

### External services

- **MySQL**
- **Mail service**

### Other components

- **Reader**
- **Librarian**

## Connections

- Reader → Sign in: signs in
- Reader → Registration: registers
- Reader → Book catalog: browses
- Reader → Book cart: manages cart
- Reader → Reader account: manages account
- Reader → Contact form: contacts
- Sign in → Application database: queries credentials
- Sign in → Reader home: redirects on success
- Login checks → Application database: checks access
- Contact form → Mail service: sends message
- Librarian → Catalog management: manages books
- Librarian → Inventory management: manages stock
- Librarian → People management: manages authors
- Librarian → Publisher management: manages publishers
- Librarian → Order management: reviews orders
- Librarian → Librarian management: manages staff
- Application database → MySQL: connects to
- Reader → Checkout: submits checkout
- Checkout → QR generation: generates code
