A RESTfull API to manage a library management system built using Express, Typescript, Mongodb ,Mongoose this project coverd all assignment requiredments.
✅ Create, update, delete and fetch books
✅ Borrow books with business rules
✅ Filter & sort books by genre, date, etc
✅ Aggregated summary of borrowed books
✅ Error handling with structured response
✅ Mongoose static methods & middleware used
✅ Clean and scalable project structure
- Node.js + Express.js
- TypeScript
- MongoDB with Mongoose
- Postman for testing
Method | Endpoint | Description |
---|---|---|
POST | /api/books |
Create a new book |
GET | /api/books |
Get all books (with filter, sort, limit) |
GET | /api/books/:bookId |
Get a book by ID |
PUT | /api/books/:bookId |
Update book info |
DELETE | /api/books/:bookId |
Delete a book |
Method | Endpoint | Description |
---|---|---|
POST | /api/borrow |
Borrow a book |
GET | /api/borrow |
Get summary of borrowed books |
Github Link : https://github.com/sujoncoder/Library-Management-API
Live Link : https://library-management-api-nine-plum.vercel.app/
Video Link : https://drive.google.com/file/d/1G6FB4CDyNpMwIUjtzeMuWsiW9RMZABZ6/view?usp=sharing
- Clone the repository
git clone https://github.com/sujoncoder/library-management-api.git
- Install dependensis
npm install
- Create .env file
MONGODB_URI = YOUR_MONGODB_URI_STRING
- Run the project
npm run dev