Skip to content

A simple Product Management Application built using the MERN stack (MongoDB, Express.js, React, and Node.js). This application allows you to manage products through CRUD operations (Create, Read, Update, Delete) and provides a user-friendly interface for browsing and managing products.

Notifications You must be signed in to change notification settings

vipullsingh/product-listing-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Product Listing React App

Welcome to the Product Listing React App! This is a full-stack web application built using the MERN stack (MongoDB, Express.js, React, and Node.js). This application allows you to manage and display a list of products with CRUD (Create, Read, Update, Delete) functionality.

Table of Contents

Installation

  1. Clone the Repository:

    git clone https://github.com/vipullsingh/product-listing-react.git
  2. Navigate to Client and Backend Folders:

    cd product-listing-react/client
    npm install
    
    cd ../backend
    npm install
  3. Create a Dotenv file (.env) and Paste below code into it:

    PORT = 5000
    MONGODB_URL = <place_your_MongoDB_URL>
    

    This will install the required dependencies for both the frontend and backend.

Usage

  1. Start the Backend Server:

    cd backend
    npm start

    The backend server will run on https://localhost:5000.

  2. Start the React App:

    cd client
    npm start

    The React app will run on https://localhost:3000.

  3. Access the App:

    Open your web browser and navigate to https://localhost:3000 to interact with the React app.

API Routes

The following API routes are available:

  • GET /api/products: Fetch all products.
  • GET /api/products/:id: Fetch a single product by its ID.
  • POST /api/products: Create a new product.
  • PUT /api/products/:id: Update a product by its ID.
  • DELETE /api/products/:id: Delete a product by its ID.

Example Requests with Postman

  1. Fetch All Products:

  2. Fetch a Single Product by ID:

  3. Create a New Product:

  4. Update a Product by ID:

  5. Delete a Product by ID:

Folder Structure

The project is organized into two main folders:

  • client: Contains the React frontend code.
  • backend: Contains the Node.js and Express.js backend code.

Technologies Used

  • Frontend: React
  • Backend: Node.js, Express.js
  • Database: MongoDB
  • HTTP Library: Axios
  • Routing: React Router
  • Styling: CSS

Contributing

Contributions are welcome! If you find any issues or want to add new features, feel free to open a pull request.

About

A simple Product Management Application built using the MERN stack (MongoDB, Express.js, React, and Node.js). This application allows you to manage products through CRUD operations (Create, Read, Update, Delete) and provides a user-friendly interface for browsing and managing products.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published