A Command-Line Interface (CLI) based Library Management System using Node.js, Express, and MySQL. It allows users to view, issue, return books, and check fines via a terminal-based interface.
Before you begin, make sure you have the following installed:
- Node.js (v14 or higher) – Install Node.js
- MySQL Server – Install MySQL
LibraryManagmentSystem/
├── data.sql # SQL script to initialize the database
├── package.json # Project metadata and dependencies
├── client/
│ └── client.js # CLI interface to interact with the system
├── server/
│ ├── server.js # Express server entry point
│ ├── db/
│ │ └── connection.js # MySQL database connection
│ ├── routes/
│ │ ├── book.js # Book operations
│ │ ├── manager.js # Manager functionalities
│ │ └── user.js # User authentication and interactions
│ └── utils/
│ ├── mailer.js # Email notifications
│ └── otpService.js # OTP generation and validation
If not already done:
git clone https://github.com/RushikeshChary/LibraryManagementSystem.git
cd LibraryManagmentSystemInstall the required packages:
npm installCreate a .env file inside the server/ folder:
cd server
touch .envThen open the .env file and add:
DB_HOST=localhost
DB_USER=your_mysql_user
DB_PASSWORD=your_mysql_password
DB_NAME=library_management_system
EMAIL=your_email@gmail.com
EMAIL_PASSWORD=your_passwordReplace the placeholder values with your actual MySQL and email credentials.
Run the following commands to create and populate the database:
mysql -u your_mysql_user -p < ../data.sqlStart the Express backend server:
node server.jsThe backend will be running on
http://localhost:8080or at port specified in your.envfile.
In a new terminal window/tab, run:
cd ../client
node client.jsThis will launch the command-line interface for interacting with the system.
✅ You’re all set!
Use the CLI to log in, view and manage books, issue/return books, and check fines.