How xianworksc/library works
This repository is a small Express library application: users browse and manage book records, and can register, log in, and access a session-gated dashboard. Requests enter through the server and route table, then controllers render Xian templates or use Sequelize models backed by MySQL. The sampled files show these paths, but not template contents or all runtime details; the unused home handler is therefore shown without an inferred route.
Main entry points: authController.js Auth handlers · index.js Express server · routes/index.js Route table · book.js Book handlers
Components 12
Web server
- Express server
index.js - Route table
routes/index.js - Xian views
views
Book catalog
- Book handlers
controllers/book.js - Home handler
controllers/homeController.js
Accounts
- Auth handlers
controllers/authController.js - Password hashing
controllers/authController.js
Persistence
- Book model
models/Books.js - User model
models/userModel.js - Sequelize config
models/db.js
Other components
- Visitor
- MySQL database
Connections 13
- Visitor → Express server: sends requests
- Express server → Route table: mounts routes
index.js - Route table → Book handlers: dispatches books
routes/index.js - Route table → Auth handlers: dispatches auth
routes/index.js - Book handlers → Book model: reads and writes
controllers/book.js - Auth handlers → User model: reads and writes
controllers/authController.js - Book model → Sequelize config: uses connection
models/Books.js - User model → Sequelize config: uses connection
models/userModel.js - Sequelize config → MySQL database: connects to
models/db.js - Book handlers → Xian views: renders pages
controllers/book.js - Auth handlers → Xian views: renders pages
controllers/authController.js - Express server → Xian views: configures rendering
index.js - Auth handlers → Password hashing: hashes passwords
controllers/authController.js