A comprehensive library management system built with the MERN stack (MongoDB, Express.js, React, Node.js).
- Book Management: Add, edit, delete, and search books
- Member Management: Register and manage library members with different membership types
- Transaction Management: Issue and return books with automatic fine calculation
- Dashboard: Overview of library statistics and quick actions
- Modern UI: Responsive design using Tailwind CSS and Heroicons
- Authentication: User authentication system (basic implementation)
- Node.js
- Express.js
- MongoDB with Mongoose
- JWT for authentication
- Express Validator for input validation
- React 18
- React Router for navigation
- Axios for API calls
- Tailwind CSS for styling
- Heroicons for icons
- Node.js (v14 or higher)
- MongoDB (installed and running)
- npm or yarn
-
Clone the repository
git clone https://github.com/Sahil7898-sahu/Library-Management-System.git cd library-management -
Install backend dependencies
npm install
-
Install frontend dependencies
cd client npm install cd ..
-
Set up environment variables
Create a
.envfile in the root directory with the following:PORT=5000 MONGODB_URI=mongodb://localhost:27017/library_management JWT_SECRET=your_jwt_secret_key_here NODE_ENV=development -
Start MongoDB
Make sure MongoDB is running on your system. The default connection string is
mongodb://localhost:27017/library_management.
-
Start the backend server
npm run server
-
Start the frontend (in a new terminal)
npm run client
The application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
Run both frontend and backend simultaneously:
npm run dev-
Build the frontend
npm run build
-
Start the server
npm start
GET /api/books- Get all books (with pagination and search)GET /api/books/:id- Get a specific bookPOST /api/books- Add a new bookPUT /api/books/:id- Update a bookDELETE /api/books/:id- Delete a book
GET /api/members- Get all members (with pagination and search)GET /api/members/:id- Get a specific memberPOST /api/members- Add a new memberPUT /api/members/:id- Update a memberDELETE /api/members/:id- Delete a member
GET /api/transactions- Get all transactionsGET /api/transactions/:id- Get a specific transactionPOST /api/transactions/issue- Issue a bookPOST /api/transactions/return/:id- Return a bookGET /api/transactions/overdue/list- Get overdue transactions
POST /api/auth/register- Register a new userPOST /api/auth/login- Login user
{
title: String,
author: String,
isbn: String,
category: String,
publicationYear: Number,
totalCopies: Number,
availableCopies: Number,
description: String,
location: String
}{
firstName: String,
lastName: String,
email: String,
phone: String,
address: String,
membershipType: String, // Student, Regular, Premium
maxBooksAllowed: Number,
currentBooksIssued: Number,
status: String, // Active, Inactive, Suspended
fineAmount: Number
}{
book: ObjectId,
member: ObjectId,
issueDate: Date,
dueDate: Date,
returnDate: Date,
status: String, // Issued, Returned, Overdue
fine: Number,
remarks: String
}- Add new books with details like title, author, ISBN, category, etc.
- Search books by title, author, or ISBN
- Filter books by category
- Track available copies vs total copies
- Edit and delete book records
- Register new members with personal details
- Three membership types: Student (3 books), Regular (5 books), Premium (10 books)
- Track member status (Active, Inactive, Suspended)
- Monitor current books issued vs maximum allowed
- Calculate and track fines
- Issue books to members with automatic due date calculation (14 days)
- Return books with automatic fine calculation (₹5 per day overdue)
- Track transaction history
- View overdue books and members
- Search and filter transactions
- Real-time statistics: total books, members, active transactions, overdue books
- Quick action buttons for common tasks
- System overview with status indicators
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Email notifications for due dates and overdue books
- Advanced reporting and analytics
- Book reservation system
- Multi-library support
- Mobile app
- Barcode/QR code scanning
- Fine payment integration
- Advanced user roles and permissions