Book CRUD Application with MongoDB

This project is a full-stack application for managing books using React for the frontend, Express with MongoDB for the backend, and storing book images as BLOBs in the database.

Project Screenshot Project Screenshot Project Screenshot Project Screenshot Project Screenshot Project Screenshot Project Screenshot Project Screenshot

Table of Contents

Features

  • CRUD operations for books (Create, Read, Update, Delete)
  • Image uploads for book covers stored as BLOBs in MongoDB
  • Responsive UI with React and Tailwind CSS

Technologies Used

  • Frontend: React, Tailwind CSS
  • Backend: Node.js, Express.js
  • Database: MongoDB (using Mongoose for ODM)
  • File Storage: Storing book images as BLOBs in MongoDB
  • Other Tools: Axios for API requests, Multer for handling file uploads

Getting Started

To get a local copy of the project up and running, follow these steps:

Prerequisites

  • Node.js installed on your machine
  • MongoDB installed locally or access to a MongoDB instance (local or cloud)

Installing Dependencies

  1. Clone the repository:

    git clone https://github.com/SudeepMi/react-node-crud.git
    cd react-node-crud
  2. Install frontend and backend dependencies:

    # Install backend dependencies
    cd server
    npm install
    
    # Install frontend dependencies
    cd ../frontend
    npm install

Setting Up MongoDB

  1. Make sure MongoDB is running either locally or accessible remotely.

  2. Create a MongoDB database and configure connection settings in backend/index.js.

Running the Application

  1. Start the backend server (from backend directory):

    npm start

    The server will run on http://localhost:3000 by default.

  2. Start the frontend development server (from frontend directory):

    npm start

    The frontend will run on http://localhost:5173 by default.

  3. Open your browser and navigate to http://localhost:5173 to view the application.

Usage

Adding a Book

  1. Click on the "Add Book" button.
  2. Fill in the book details and select an image file for the book cover.
  3. Click "Add" to save the book.

Updating a Book

  1. Navigate to the book you want to update.
  2. Click on the "Update" button.
  3. Modify the book details or update the book cover image.
  4. Click "Update" to save the changes.

Deleting a Book

  1. Navigate to the book you want to delete.
  2. Click on the "Delete" button.
  3. Confirm the deletion when prompted.

Contributing

Contributions are welcome! Fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.