This project is a web application for managing a book inventory. It allows users to add, view, filter, and export book data in a user-friendly interface.
- Project Overview
- Features
- Tech Stack
- Installation
- Usage
- API Endpoints
- Project Structure
- Future Enhancements
- Contributing
- License
The Book Inventory Management System is designed to help users manage a collection of books. Users can add new books with details such as title, author, genre, publication date, and ISBN. The system also supports filtering the inventory based on specific criteria and exporting the book list to CSV.
- Add Books: Enter new book details and add them to the inventory.
- Filter Books: Search for books by title, author, genre, or publication date.
- View Book List: Display all books in a paginated table format.
- Export Data: Export the book inventory in CSV format for easy backup or transfer.
- Frontend: Vue.js with Element UI for styling and form components
- Backend: Node.js with Express
- Database: MySQL
- Other Libraries: Body-Parser, CORS
- Node.js (v14 or higher)
- MySQL (v5.7 or higher)
cd book-inventory-management
-
Navigate to the backend folder:
cd backend
-
Install backend dependencies:
npm install
-
Configure the database:
- Create a MySQL database for the project.
- Modify the database variables:
// create MySQL connector const pool = mysql.createPool({ host: '', port: '', user: '', password: '', database: '', waitForConnections: true, connectionLimit: 10, queueLimit: 0,
}); -
Create the database table by running the following SQL commands:
CREATE TABLE inventory ( id INT AUTO_INCREMENT PRIMARY KEY, title VARCHAR(255) NOT NULL, author VARCHAR(255) NOT NULL, genre VARCHAR(100), publication_date DATE, isbn VARCHAR(13) UNIQUE );
-
Start the backend server:
npm start
The backend server will run on
http://localhost:5000
.
-
Open a new terminal, navigate to the frontend folder:
cd frontend
-
Install frontend dependencies:
npm install
-
Start the frontend development server:
npm run serve
The frontend server will run on
http://localhost:8080
.
- Add Books: Use the "Add New Book" form to input book details and click "Add Book" to save it to the inventory.
- Filter Books: Use the filter form to specify criteria and display books that match the criteria.
- View Book List: The list of books will be displayed in a paginated table with sorting options.
- Export Data: Click the "Export to CSV" button to download the inventory data in CSV format.
Adds a new book to the inventory.
- Request Body: JSON with
title
,author
,genre
,publicationDate
, andisbn
.
Fetches all books or filters them based on query parameters.
- Query Parameters (optional):
title
author
genre
publicationDate
Exports the inventory in Json/CSV format.
book-inventory-management
├── backend
│ ├── server.js
│ ├── db.js
│ └── package.json
├── frontend
│ ├── public
│ │ └── indexl.html
│ ├── src
│ │ ├── App.vue
│ │ ├── Home.vue
│ │ └── main.js
│ ├── package.json
│ └── vue.config.js
└── README.md
- Pagination: Add pagination to the book list for easier navigation through large datasets.
- User Authentication: Implement user accounts and login functionality.
- Additional Export Formats: Support export in other formats, such as PDF.
- Book Cover Images: Allow users to upload cover images for each book.
Contributions are welcome! If you'd like to contribute, please fork the repository and create a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
Enjoy using the Book Inventory Management System!