Code Monkey home page Code Monkey logo

library-management-system's Introduction

Library Management System

This backend application manages the borrowing and returning of books in a library system.

Database Schema

The database schema diagram can be found in the following image:

Database Schema

Installation

1- Clone the repository:

  git clone https://github.com/MahmoudMehisen/Library-Management-System

2- Navigate to the project directory:

  cd Library-Management-System

3- Ensure that ports 5432 (PostgreSQL) and 8080 (Node.js backend) are free to use.

4- Run Docker Compose to set up the environment:

  docker-compose up

Docker will handle the database setup and migrations using the scripts provided in the backend, ensuring everything is properly configured.

API Reference

To interact with the API endpoints, you can use the Postman collection provided in the Library-Management.postman_collection.json file.

Auth

Login: POST localhost:8080/api/auth/login
Register: POST localhost:8080/api/auth/register

Book

Add Book: POST localhost:8080/api/book/ (Bearer token required)
Update Book: PUT localhost:8080/api/book/:id (Bearer token required)
Delete Book: DELETE localhost:8080/api/book/:id (Bearer token required)
All Books: GET localhost:8080/api/book/all (Bearer token required)
Search Books: GET localhost:8080/api/book/search?key=author&query=author (Bearer token required)

Borrower

Add Borrower: POST localhost:8080/api/borrower/ (Bearer token required)
Update Borrower: PUT localhost:8080/api/borrower/:id (Bearer token required)
Delete Borrower: DELETE localhost:8080/api/borrower/:id (Bearer token required)
All Borrowers: GET localhost:8080/api/borrower/all (Bearer token required)

Borrowing

Create Borrowing: POST localhost:8080/api/borrowing/create-borrowing (Bearer token required)
Return Book: POST localhost:8080/api/borrowing/return-book (Bearer token required)
Borrowed Books By Borrower: GET localhost:8080/api/borrowing/borrowed-books-by-borrower/:borrowerId (Bearer token required)
Overdue Books: GET localhost:8080/api/borrowing/overdue-books (Bearer token required)

Please ensure you have the correct bearer token before making requests to protected endpoints.

library-management-system's People

Contributors

mahmoudmehisen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.