How phamquocdien/261dasa230179_06_nhom20 works
This is a Vietnamese library-management system with browser, JSON API, and console modes. The principal web workflow sends user actions through the JavaScript API client to the PHP endpoint and then to the C++ action dispatcher; the dispatcher coordinates domain services and JSON-backed state. The codebase also includes catalog, membership, lending, fines, reservations, loan slips, renewals, and interest-ranking capabilities. Edges reflect excerpted calls, imports, or README statements; links from PHP to the C++ executable and several unsampled service interactions remain unverified.
Main entry points: main.cpp Action dispatcher · script.js Web application · api.js JSON API client · repositories Domain repositories
Components 27
Web interface
- Web application
src/presentation/script.js - Catalog UI
src/presentation/js/book.js - Borrow / return UI
src/presentation/js/borrowBook.js - Members and fines
src/presentation/js/memberRegister.js - Renewal UI
src/presentation/js/renewBook.js - Reservation UI
src/presentation/js/reservation.js - Loan slip UI
src/presentation/js/loanSlip.js - Navigation UI
src/presentation/js/navigation.js - JSON API client
src/presentation/js/api.js
Application entry
- PHP API endpoint
src/api/api.php - Action dispatcher
src/main.cpp
Library operations
- Catalog service
src/dsa_core/services/BookService.cpp - Member service
src/dsa_core/services/MemberService.cpp - Loan and fine service
src/dsa_core/services/LoanService.cpp - Reservation service
src/dsa_core/services/ReservationService.cpp - Renewal service
src/dsa_core/services/RenewService.cpp - Loan slip service
src/dsa_core/services/LoanSlipService.cpp - Interest ranking
src/dsa_core/services/InterestManager.cpp - Administration service
src/dsa_core/services/AdminService.cpp
Data and persistence
- Domain repositories
src/dsa_core/repositories - Library records
src/dsa_core/models - JSON mapper
src/persistence/JsonMapper.cpp - JSON database
src/persistence/JsonDatabase.cpp
DSA structures
- AVL book index
src/dsa_core/structures/AVLTree.cpp - Hash table
src/dsa_core/structures/HashTable.h
Other components
- Library user
- Console operator
Connections 32
- Library user → Web application: uses
- Console operator → Action dispatcher: uses console
- Web application → Catalog UI: initializes
src/presentation/script.js - Web application → Loan slip UI: initializes
src/presentation/script.js - Web application → Borrow / return UI: initializes
src/presentation/script.js - Web application → Members and fines: initializes
src/presentation/script.js - Web application → Renewal UI: initializes
src/presentation/script.js - Web application → Reservation UI: initializes
src/presentation/script.js - Web application → Navigation UI: initializes
src/presentation/script.js - Catalog UI → JSON API client: sends requests
src/presentation/js/book.js - Loan slip UI → JSON API client: sends requests
src/presentation/js/loanSlip.js - Navigation UI → JSON API client: sends requests
src/presentation/js/navigation.js - Members and fines → JSON API client: sends requests
- JSON API client → PHP API endpoint: POSTs JSON
src/presentation/js/api.js - PHP API endpoint → Action dispatcher: dispatches actions
- Action dispatcher → Catalog service: calls
src/main.cpp - Action dispatcher → Loan and fine service: calls
src/main.cpp - Action dispatcher → Reservation service: calls
src/main.cpp - Action dispatcher → Member service: calls
- Action dispatcher → Loan slip service: calls
src/main.cpp - Action dispatcher → JSON mapper: converts JSON
src/main.cpp - Action dispatcher → JSON database: loads and saves
src/main.cpp - Catalog service → Domain repositories: uses catalog store
- Loan and fine service → Domain repositories: uses domain stores
- Reservation service → Domain repositories: uses domain stores
- Domain repositories → Library records: stores records
src/dsa_core/repositories/BookRepository.h - JSON mapper → Library records: maps records
- Action dispatcher → AVL book index: uses index
src/main.cpp - Interest ranking → Domain repositories: reads books
- Action dispatcher → Renewal service: calls
- Action dispatcher → Administration service: calls
- Action dispatcher → Interest ranking: calls