A backend-only Library Management System built using Node.js, Express.js, and MongoDB. The system provides RESTful APIs for managing books, users, authentication, issue/return operations, and library records.
This project is a backend API service for a Library Management System. It allows administrators and users to:
- Manage books
- Manage users
- Issue and return books
- Authenticate users securely
- Perform CRUD operations
The backend is designed using REST API architecture with MongoDB database integration.
- User Signup & Login
- JWT Authentication
- Password Hashing using bcrypt
- Protected Routes
- Add Books
- Update Book Details
- Delete Books
- Get All Books
- Search Books
- Register Users
- Login Users
- Manage User Records
- Issue Books
- Return Books
- Track Borrowed Books
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT
- bcryptjs
- dotenv
- cors
- morgan
- nodemon
backend/
│
├── config/
│ └── db.js
│
├── controllers/
│ ├── authController.js
│ ├── bookController.js
│ └── userController.js
│
├── middleware/
│ ├── authMiddleware.js
│ └── errorMiddleware.js
│
├── models/
│ ├── User.js
│ ├── Book.js
│ └── Issue.js
│
├── routes/
│ ├── authRoutes.js
│ ├── bookRoutes.js
│ └── userRoutes.js
│
├── services/
│
├── .env
├── server.js
├── package.json
└── README.mdPOST /api/auth/signup{
"name": "Akshit",
"email": "akshit@gmail.com",
"password": "123456"
}POST /api/auth/login{
"email": "akshit@gmail.com",
"password": "123456"
}POST /api/books{
"title": "Atomic Habits",
"author": "James Clear",
"category": "Self Help",
"quantity": 5
}GET /api/booksGET /api/books/:idPUT /api/books/:idDELETE /api/books/:idGET /api/books/search?title=AtomicPOST /api/issues{
"userId": "USER_ID",
"bookId": "BOOK_ID"
}PUT /api/issues/return/:idCreate .env file inside backend folder:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_keygit clone YOUR_GITHUB_REPO_URLnpm installnpm run devnpm start- JWT Authentication
- Password Hashing
- Protected Routes
- Environment Variables
- Secure API Handling
Stores:
- name
- password
Stores:
- title
- author
- category
- quantity
Stores:
- userId
- bookId
- issueDate
- returnDate
- CRUD Operations
- REST API Architecture
- Authentication System
- MongoDB Integration
- Error Handling Middleware
- Search & Filtering
- Fine Calculation System
- Admin Dashboard
- Email Notifications
- Book Reservation System
- Role-Based Access
Add:
- Postman API Testing
- MongoDB Collections
- Authentication APIs
- CRUD Operations
- Deployment Screenshots
Library Management System Backend 😄🔥