https://github.com/nullmaster7/library-management-backend
library-management-backend
https://github.com/nullmaster7/library-management-backend
Last synced: about 1 year ago
JSON representation
library-management-backend
- Host: GitHub
- URL: https://github.com/nullmaster7/library-management-backend
- Owner: Nullmaster7
- Created: 2024-10-28T14:14:29.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-01T11:19:32.000Z (over 1 year ago)
- Last Synced: 2025-03-02T11:15:04.033Z (over 1 year ago)
- Language: JavaScript
- Size: 90.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Library Management System - Backend
This is the backend of the Library Management System, built with Node.js,
Express, and SQLite for the database. Sequelize is used as an ORM to manage data models, migrations, and seeding.
## Tech Stack
Node.js - JavaScript runtime for backend development.
Express.js - Web application framework for Node.js.
SQLite - Lightweight database engine.
Sequelize - Promise-based ORM for Node.js.
CORS - Middleware for handling Cross-Origin Resource Sharing.
## Prerequisites
Ensure you have the following installed on your local machine:
- [Node.js](https://nodejs.org/) (>= version 14)
- [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/)
## Installation
1. **Clone the repository**:
```bash
git clone https://github.com/Nullmaster7/library-management-backend.git
npm install
2. **Run the Project**:
```bash
npm run start
Note : I already shared ddl.sql file so on directory so that after npm install
you can easily run the application and get database seeds that I provided.
## API Endpoints
Users
- GET /api/users - Get all users.
- GET /api/users/:id - Get a user by ID.
Books
- GET /api/books - Get all books.
- GET /api/books/:id - Get a book by ID.
Borrowing History
- POST /api/users/:userId/borrow/:bookId - Borrow book.
- POST /api/users/:userId/return/:bookId - Return book.