How tranquangthanh902-source/library-management works
Thư Viện Số is an Express/EJS library-management web app backed by SQLite. A visitor can browse or search books publicly; an administrator signs in, manages books and readers, records loans and returns, and reviews overdue and usage statistics. The principal stages are authentication, catalog/member management, circulation, and reporting, with SQLite as the shared state layer. The graph follows the sampled server and route code; README capabilities such as responsive presentation and print reporting are represented by the relevant view layer, while unsampled details are not expanded.
Main entry points: server.js Express server · init.js SQLite library data · auth.js Login guard · index.js Landing page
Components 19
Web runtime
- Express server
server.js - Login guard
middleware/auth.js - SQLite library data
database/init.js - Browser assets
public
Access and discovery
- Authentication
routes/auth.js - Public book search
routes/search.js - Landing page
routes/index.js - Search screen
views/search.ejs
Catalog and readers
- Book management
routes/books.js - Book screens
views/books - Reader management
routes/readers.js - Reader screens
views/readers
Circulation
- Loan and return
routes/borrow.js - Circulation screens
views/borrow
Dashboard and reporting
- Dashboard stats
routes/index.js - Dashboard screen
views/dashboard.ejs - Usage reports
routes/reports.js - Report screen
views/reports
Other components
- Visitor or admin
Connections 30
- Visitor or admin → Express server: sends requests
- Express server → Authentication: dispatches routes
- Express server → Public book search: dispatches routes
- Express server → Landing page: dispatches routes
- Express server → Login guard: guards admin
- Express server → Browser assets: serves files
- Login guard → Book management: allows access
- Login guard → Reader management: allows access
- Login guard → Loan and return: allows access
- Login guard → Usage reports: allows access
- Authentication → SQLite library data: reads and writes
- Public book search → SQLite library data: queries books
- Public book search → Search screen: renders results
- Landing page → SQLite library data: queries counts
- Landing page → Landing page: renders landing
- Express server → Book management: dispatches routes
- Book management → SQLite library data: reads and writes
- Book management → Book screens: renders screens
- Express server → Reader management: dispatches routes
- Reader management → SQLite library data: reads and writes
- Reader management → Reader screens: renders screens
- Express server → Loan and return: dispatches routes
- Loan and return → SQLite library data: updates loans and stock
- Loan and return → Circulation screens: renders screens
- Express server → Dashboard stats: dispatches route
- Dashboard stats → SQLite library data: queries metrics
- Dashboard stats → Dashboard screen: renders dashboard
- Express server → Usage reports: dispatches routes
- Usage reports → SQLite library data: queries statistics
- Usage reports → Report screen: renders report