A simple library management system that allows library staff to manage users, books, and borrowing operations. This project is built using React.js for the frontend, Node.js with Express.js for the backend, and a relational database PostgreSQL.
- Existing users should be listed in a grid. This grid will display all registered users.
- When a user is selected, the user’s detail page should be accessible. This page will display:
- Books currently borrowed by the user
- Books previously borrowed by the user along with the ratings they provided
- On the user’s detail page, there should be an option to return a book currently in the user’s possession.
- Existing books should be listed in a grid. This grid will display all available books.
- When a book is selected, the book’s detail page should be accessible. This operation should be considered as a process much more frequent than others. This page will display:
- Information related to the book (author, year etc)
- Current owner, if there is
- The average rating of the book
- From the book’s detail page, there should be an option to lend the book to a user.
- Frontend: React.js (TypeScript)
- Backend: Node.js, Express.js (REST API)
- Database: Relational (PostgreSQL)
- ORM: Sequelize
- Version Control: Git
- Styling: SCSS (Bonus), UI libraries like Bootstrap/Material UI
- Node.js (>= 14.x)
- PostgreSQL
- Git
-
Clone the repository:
git clone https://github.com/demirelfth/library-management-system.git cd library-management-system
-
Install dependencies for both frontend and backend:
# For the backend cd backend npm install --force # For the frontend cd frontend npm install --force
-
Set up the database:
- Ensure you have PostgreSQL installed and running.
- Create the database:
cd backend/config node createDatabase.js
- Create data for database:
cd backend/config node init_db.js
-
Start the backend server:
cd backend node app.js
-
Start the frontend application:
cd frontend npm start
-
Open the app in your browser at
http://localhost:3200
.
Method | Endpoint | Description |
---|---|---|
GET |
/users |
Get list of all users |
GET |
/users/2 |
Get details of a specific user |
GET |
/books |
Get list of all books |
GET |
/books/2 |
Get details of a specific book |
POST |
/users/2/borrow/4 |
Borrow a book to a user |
POST |
/users/2/return/5 |
Return a borrowed book |
GET |
/borrowed/user/2 |
Get list of borrowed books for a user |
GET |
/borrowed/book/2 |
Get status of book with details |
- Borrow a Book: Navigate to the list of books, select a book, and borrow it to a user.
- Return a Book: Go to the user's details page and return a currently borrowed book.
library-management-system/
│
├── backend/ # Backend codebase (Express.js, API)
│ ├── config/ # Configuration files for database connection and initialization
│ ├── controllers/ # Controller functions for handling request and responses
│ ├── models/ # ORM models for database schema (using Sequelize)
│ ├── routes/ # API route definitions and endpoint handlers
│ └── app.js # Main application entry point and server setup
│
├── frontend/ # Frontend codebase (React.js)
│ └── src/ # Main source code
│ ├── api/ # API request and service-related functions
│ ├── components/ # Reusable UI components and elements
│ ├── pages/ # Individual pages in the application
│ └── styles/ # Global and component-specific styling (SCSS)
│ ├── public/ # Static files and public assets
│ └── App component # Main application component (entry point of the app)
│
└── README.md # Project instructions
This project is licensed under the MIT License. See the LICENSE file for details.