How nayak-sahil/bookshelf-system works
Project type and purpose
• This is a backend library management system implemented in Node.js.
• Core functionality revolves around managing books, inventory operations, library operations (borrow/return), and transaction logging.
• No external UI or database is included—data is held in memory within the modules.
Main components
a. Data Models (Domain Layer)
• Book Module (book.js) – defines the Book entity (ISBN, title, author, year, copies)
• Transaction Module (transaction.js) – defines borrow/return transaction details
b. Business-Logic Services (Service Layer)
• Inventory Module (inventory.js) – add/find/modify Book instances, check availability
• Library Module (library.js) – borrowBook(), returnBook(), listAvailable()
• TransactionManager Module (transactionManager.js) – record and retrieve Transaction logs
c. (Optionally) Test Suite
Relationships & interactions
• Inventory → Book
• Library → Inventory
• Library → TransactionManager
• TransactionManager → Transaction
Important architectural patterns & principles
• SOLID: Each module has a single responsibility.
• Dependency Injection (at runtime, modules import only what they need).
• Layered architecture: Domain → Services → (Client).
Technologies & environment
• Node.js runtime (CommonJS modules)
• In-memory data structures (no external DB in code)
• Jest/Mocha (test framework; coverage reports).