# rxnceeee/dcsa-library-system architecture

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

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

## Overview

This is a library-management web application for students and library staff. Users access account and book workflows through an Express server, which serves HTML views and uses database operations for registration, catalog management, borrowing, returns, penalties, and reporting. The excerpts show several route-to-database calls, but not the frontend request wiring or complete route and database implementations; those connections are omitted where not evidenced.

Main entry points: [`server.js`](https://github.com/rxnceeee/dcsa-library-system/blob/main/server.js) (Express server), [`db.js`](https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js) (Accounts), [`public/views`](https://github.com/rxnceeee/dcsa-library-system/tree/main/public/views) (HTML views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_views["HTML views"]
end

subgraph group_api["Application routes"]
  node_server["Express server<br/>[server.js]"]
end

subgraph group_domain["Library operations"]
  node_accounts["Accounts<br/>[db.js]"]
  node_catalog["Book catalog<br/>[db.js]"]
  node_borrowing["Borrowing<br/>[db.js]"]
  node_returns["Returns<br/>[db.js]"]
  node_penalties["Penalties<br/>[db.js]"]
  node_reporting["History and reports<br/>[db.js]"]
end

subgraph group_storage["Persistence"]
  node_mysql[("MySQL database")]
end

node_student(("Student"))
node_staff(("Library staff"))

node_server -->|"serves pages"| node_views
node_server -->|"checks and updates"| node_accounts
node_server -->|"registers and lists"| node_catalog
node_server -->|"checks eligibility"| node_borrowing
node_server -->|"fetches reports"| node_reporting
node_server -->|"updates penalties"| node_penalties
node_accounts -.->|"queries"| node_mysql
node_catalog -.->|"queries"| node_mysql
node_borrowing -.->|"queries"| node_mysql
node_returns -.->|"queries"| node_mysql
node_penalties -.->|"queries"| node_mysql
node_reporting -.->|"queries"| node_mysql

click node_views "https://github.com/rxnceeee/dcsa-library-system/tree/main/public/views"
click node_server "https://github.com/rxnceeee/dcsa-library-system/blob/main/server.js"
click node_accounts "https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js"
click node_catalog "https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js"
click node_borrowing "https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js"
click node_returns "https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js"
click node_penalties "https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js"
click node_reporting "https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js"

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_views toneBlue
class node_server toneAmber
class node_accounts,node_catalog,node_borrowing,node_returns,node_penalties,node_reporting toneMint
class node_mysql toneRose
class node_student,node_staff toneIndigo
```

## Components

### Web interface

- [HTML views](https://github.com/rxnceeee/dcsa-library-system/tree/main/public/views): `public/views`

### Application routes

- [Express server](https://github.com/rxnceeee/dcsa-library-system/blob/main/server.js): `server.js`

### Library operations

- [Accounts](https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js): `db.js`
- [Book catalog](https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js): `db.js`
- [Borrowing](https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js): `db.js`
- [Returns](https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js): `db.js`
- [Penalties](https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js): `db.js`
- [History and reports](https://github.com/rxnceeee/dcsa-library-system/blob/main/db.js): `db.js`

### Persistence

- **MySQL database**

### Other components

- **Student**
- **Library staff**

## Connections

- Express server → HTML views: serves pages (evidence: `server.js`)
- Express server → Accounts: checks and updates (evidence: `server.js`)
- Express server → Book catalog: registers and lists (evidence: `server.js`)
- Express server → Borrowing: checks eligibility (evidence: `server.js`)
- Express server → History and reports: fetches reports (evidence: `server.js`)
- Express server → Penalties: updates penalties (evidence: `server.js`)
- Accounts → MySQL database: queries
- Book catalog → MySQL database: queries
- Borrowing → MySQL database: queries
- Returns → MySQL database: queries
- Penalties → MySQL database: queries
- History and reports → MySQL database: queries
