/shopping-cart

This is a shopping cart website built using React.js where customers can add clothes to their cart and update the quantities of items. Managed state using the Context API.

Primary LanguageJavaScript

Shopping Cart Website

This is a shopping cart website built using React.js where customers can add clothes to their cart and update the quantities of items. Managed state using the Context API.

Features

  • Browse a collection of clothes and add items to the shopping cart
  • Update the quantity of items in the shopping cart
  • View the total count and price of items in the cart
  • Persistent state management using the Context API and useReducer hook

Concepts Used

  • Context API: Utilized for centralized state management and to avoid prop drilling.

  • useReducer Hook: Implemented for handling complex state logic and actions.

  • Provider Component: Modularized context and state into a dedicated provider component.

  • Context Consumption: Efficiently accessing and managing context values across the component tree.

  • State Management Integration: Linking context to state for dynamic updates.

    Getting Started

To run this project locally, follow these steps:

  1. Clone this repository to your local machine:
git https://github.com/trishna456/shopping-cart.git
  1. Navigate to the project directory:
cd shopping-cart
  1. Install dependencies using npm or yarn:
npm install
# or
yarn install
  1. Start the development server:
npm start
# or
yarn start
  1. Open your web browser and navigate to http://localhost:3000 to view the app.