# httpsmauipogi/libratrack---book-inventory-and-catalog-system- architecture

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

- Interactive diagram: https://gitdiagram.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-
- Repository: https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-

## Overview

LibraTrack is a library circulation web application: patrons register or sign in, browse a book catalog, and borrow books; staff manage catalog entries and process returns. Express routes dispatch to controllers, which apply account and circulation rules through Sequelize models, with server-rendered pages and JSON API responses. The sampled code shows SQLite as the default store and configurable MySQL/PostgreSQL options. Some capabilities are visible only in route declarations; unsampled page and controller details are not inferred.

Main entry points: [`controllers/bookController.js`](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/controllers/bookController.js) (Catalog workflows), [`models/db.js`](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/models/db.js) (Database connection), [`routes/index.js`](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/routes/index.js) (HTTP routes), [`models/userModel.js`](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/models/userModel.js) (User records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_server["Express server<br/>[index.js]"]
  node_routes["HTTP routes<br/>[index.js]"]
  node_pages["Rendered pages"]
  node_home["Home page<br/>[homeController.js]"]
end

subgraph group_accounts["Accounts"]
  node_auth["Account workflows<br/>[authController.js]"]
end

subgraph group_circulation["Library circulation"]
  node_catalog["Catalog workflows<br/>[bookController.js]"]
end

subgraph group_persistence["Persistence"]
  node_users["User records<br/>[userModel.js]"]
  node_books["Book records<br/>[bookModel.js]"]
  node_loans["Loan records<br/>[loanModel.js]"]
  node_dbconfig["Database connection<br/>[db.js]"]
  node_sqlite[("SQLite database<br/>[libraTrack.db]")]
end

node_visitor(("Patron or staff"))
node_sqlservice[("MySQL or PostgreSQL")]

node_visitor -->|"sends requests"| node_server
node_server -->|"mounts routes"| node_routes
node_server -->|"configures views"| node_pages
node_routes -->|"dispatches home"| node_home
node_routes -->|"dispatches account"| node_auth
node_routes -->|"dispatches circulation"| node_catalog
node_home -->|"renders home"| node_pages
node_auth -->|"renders account pages"| node_pages
node_auth -->|"reads and updates"| node_users
node_catalog -->|"checks account"| node_users
node_catalog -->|"reads and updates"| node_books
node_catalog -->|"creates and processes"| node_loans
node_catalog -->|"starts transactions"| node_dbconfig
node_loans -->|"associates borrowers"| node_users
node_loans -->|"associates titles"| node_books
node_users -->|"uses connection"| node_dbconfig
node_books -->|"uses connection"| node_dbconfig
node_dbconfig -->|"stores records"| node_sqlite
node_dbconfig -.->|"can configure"| node_sqlservice

click node_server "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/index.js"
click node_routes "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/routes/index.js"
click node_pages "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/tree/main/views"
click node_home "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/controllers/homeController.js"
click node_auth "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/controllers/authController.js"
click node_users "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/models/userModel.js"
click node_catalog "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/controllers/bookController.js"
click node_books "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/models/bookModel.js"
click node_loans "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/models/loanModel.js"
click node_dbconfig "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/models/db.js"
click node_sqlite "https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/data/libraTrack.db"

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_server,node_routes,node_pages,node_home toneBlue
class node_auth,node_sqlservice toneAmber
class node_catalog toneMint
class node_users,node_books,node_loans,node_dbconfig,node_sqlite toneRose
class node_visitor toneIndigo
```

## Components

### Web interface

- [Express server](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/index.js): `index.js`
- [HTTP routes](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/routes/index.js): `routes/index.js`
- [Rendered pages](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/tree/main/views): `views`
- [Home page](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/controllers/homeController.js): `controllers/homeController.js`

### Accounts

- [Account workflows](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/controllers/authController.js): `controllers/authController.js`

### Library circulation

- [Catalog workflows](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/controllers/bookController.js): `controllers/bookController.js`

### Persistence

- [User records](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/models/userModel.js): `models/userModel.js`
- [Book records](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/models/bookModel.js): `models/bookModel.js`
- [Loan records](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/models/loanModel.js): `models/loanModel.js`
- [Database connection](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/models/db.js): `models/db.js`
- [SQLite database](https://github.com/httpsmauipogi/libratrack---book-inventory-and-catalog-system-/blob/main/data/libraTrack.db): `data/libraTrack.db`

### Other components

- **Patron or staff**
- **MySQL or PostgreSQL**

## Connections

- Patron or staff → Express server: sends requests
- Express server → HTTP routes: mounts routes (evidence: `index.js`)
- Express server → Rendered pages: configures views (evidence: `index.js`)
- HTTP routes → Home page: dispatches home (evidence: `routes/index.js`)
- HTTP routes → Account workflows: dispatches account (evidence: `routes/index.js`)
- HTTP routes → Catalog workflows: dispatches circulation (evidence: `routes/index.js`)
- Home page → Rendered pages: renders home (evidence: `controllers/homeController.js`)
- Account workflows → Rendered pages: renders account pages (evidence: `controllers/authController.js`)
- Account workflows → User records: reads and updates (evidence: `controllers/authController.js`)
- Catalog workflows → User records: checks account (evidence: `controllers/bookController.js`)
- Catalog workflows → Book records: reads and updates (evidence: `controllers/bookController.js`)
- Catalog workflows → Loan records: creates and processes (evidence: `controllers/bookController.js`)
- Catalog workflows → Database connection: starts transactions (evidence: `controllers/bookController.js`)
- Loan records → User records: associates borrowers (evidence: `models/loanModel.js`)
- Loan records → Book records: associates titles (evidence: `models/loanModel.js`)
- User records → Database connection: uses connection (evidence: `models/userModel.js`)
- Book records → Database connection: uses connection (evidence: `models/bookModel.js`)
- Database connection → SQLite database: stores records (evidence: `models/db.js`)
- Database connection → MySQL or PostgreSQL: can configure (evidence: `models/db.js`)
