Welcome to the Online Library System, a comprehensive platform for viewing different category of books. Built using the MERN stack, this system provides functionality for browsing and viewing books.
- Project Overview
- Features
- Installation
- Usage
- API Endpoints
- Project Structure
- Technologies Used
- License
The Online Library System is a MERN-based application designed for users to view different category of books. With an intuitive UI, it allows users to browse books by category, search books, add new books, and view detailed information about each book.
- Add New Books: Users can add books with details like title, author, category, and publication year.
- Browse Library: View all books categorized for easy navigation.
- Search Books: Quickly find books.
- View Book Details: Access detailed information such as the description, rating, and release year of a book.
- Responsive Design: Optimized for all screen sizes.
Ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/mmj030703/Online-Library-System.git
-
Change Directory
cd ./backend -
Install dependencies:
npm install
-
Create a
.envfile and add the following:PORT=5000 DATABASE_NAME=<db_name> MONGODB_URI=<mongodb_uri> IMAGEKIT_PUBLIC_KEY=<imagekit_publickey> IMAGEKIT_PRIVATE_KEY=<imagekit_privatekey> IMAGEKIT_URL_ENDPOINT=<imagekit_url_endpoint>
-
Start the server:
npm start
The backend will run on
http://localhost:5000.
-
Navigate to the frontend repository:
cd Online-Library-System -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will run on
http://localhost:5173.
- Open the application and browse the library to view available books by category.
- Users can use the "Add Book" link in the navbar to add new books to the collection.
- Click on a book to view its detailed information.
- Use the search bar on the browse page to locate books by title or author.
Local Base Url: http://localhost:5000/api/v1
Hosted Base Url: https://online-library-system-97mj.onrender.com/api/v1
| Method | Endpoint | Description |
|---|---|---|
| GET | /books/all |
Get all books |
| POST | /books/add |
Add a new book |
| GET | /books/book/:id |
Get book details by ID |
| GET | /books/category/:category |
Get books by cateogry ID |
| GET | /books/search |
Get books by search query |
| Method | Endpoint | Description |
|---|---|---|
| POST | /categories/add/:category |
Add a new category |
| GET | /categories/all |
Get all categories |
online-library-system/
├── backend/
│ ├── config/ # Configuration files
│ ├── controllers/ # Backend logic
│ ├── models/ # Mongoose models
│ ├── routes/ # Backend API routes
│ ├── middlewares/ # Backend middlewares
│ ├── utils/ # Utility files
│ └── server.js # Backend entry point
├── public/
├── src/
│ ├── components/ # React components
│ ├── utils/ # Utility files
│ ├── store/ # Redux Store
│ ├── slices/ # Redux Slices
│ ├── bookStore.js/ # Redux Store file
│ ├── pages/ # React pages
│ ├── App.jsx # Application component
│ └── main.jsx # Frontend entry point
-
Backend:
- Node.js, Express, MongoDB, Mongoose, ImageKit
-
Frontend:
- React, Tailwind CSS, Redux Toolkit, React Router.
This project is licensed under the MIT License - see the LICENSE file for details.