This is the library-management system, where you can register, log in, and access restricted resources.
You can explore the API documentation using Swagger UI. Access the documentation by navigating to:
https://library-management-system-five-red.vercel.app/api-docs
The API includes the following functionality:
- User Registration
- User Login and Authentication
- User details
- book Management- create , update, delete
The backend of this project is deployed on AWS and can be accessed via the following link:
- User Authentication:
POST /users/register
: Register a new user.POST /users/login
: Log in with a registered user.GET /users/
: Get all user details (jwt protected) .
- Book Management:
GET /books/
: List of all available books.GET /books/search?{title=?,available=?}
: Update book details.POST /books/
: Add a new book.PUT /books/
: Update book details.DELETE /books/
: Delete a book form database.
- Borrowing Book:
POST /borrow/{:bookid}
: Borrow a new book (jwt prltected).POST /borrow/return/{:bookid}
: Return a borrowed book.
- Node.js
- Express.js
- MongoDB
- Mongoose
- Bcrypt
- JWT
- Swagger (for API documentation)
-
Clone the repository to your local machine:
git clone https://github.com/Rubel011/library-management-system.git
-
Navigate to the project directory:
cd library-management-system
-
Install the project dependencies:
npm install
-
Create a .env file in the project root and configure the following environment variables:
PORT=8080 mongoUrl=database link saltRounds=15 ACCESS_TOKEN_SECRET=masai_school REFRESH_TOKEN_SECRET=masai_refresh_token
-
Start the server:
npm run server
-
Access the backend API at http://localhost:PORT.