A backend API for a Library Management System built using Express, TypeScript, Mongoose, and MongoDB, and deployed on Render.
It provides features for Admin and User roles to manage books and borrowing functionality.
Base URL: https://library-management-system-backend-g0s6.onrender.com/
- Node.js
- Express.js
- TypeScript
- MongoDB + Mongoose
-
Create new books
-
View all books/single book
-
Update existing books
-
Delete books
-
Borrow books
-
View summary of borrowed books
POST /api/booksto Create Book
Example Input:
{
"title": "The Theory of Everything",
"author": "Stephen Hawking",
"genre": "SCIENCE",
"isbn": "9780553380163",
"description": "An overview of cosmology and black holes.",
"copies": 5,
"available": true
}
-
GET /api/booksto View all Books -
GET /api/books/:bookIdto View single Book -
PUT /api/books/:bookIdto Update Book
Example Input:
{
"copies": 50
}
-
DELETE /api/books/:bookIdto Delete Book -
POST /api/borrowto Borrow Book
Example Input:
{
"book": "64ab3f9e2a4b5c6d7e8f9012",
"quantity": 2,
"dueDate": "2025-07-18T00:00:00.000Z"
}
GET /api/borrowto View Borrow Summary
Create a .env file in the root directory and configure the following variables:
# MongoDB
MONGO_URI = your mongodb:url