A modern, minimal e-commerce web application built with React + TypeScript.
Users can browse products, apply filters & sorting, view detailed product information, and manage a shopping cart with persistent state using localStorage.
🔗 Live Demo: https://reacts-cart.vercel.app
- Displays all products in a responsive grid
- Each Product Card shows only:
- 🖼️ Image
- 🏷️ Title
- 💰 Price
- ✅ Availability
- Category filters and price sorting available directly on the Home Page
- Full product details
- Product description
- Add to Cart button (➕ Add to cart only from here)
- View selected products
- Increase / decrease quantity
- Remove items from cart
- Cart total & item count displayed
- Cart state persists using localStorage
- Responsive design for all screen sizes
- Toast notifications using React Hot Toast
- Clean UI with simple user flow
Basic End-to-End testing is implemented using Playwright:
- Application loads successfully.
- Products page renders and displays the "Products" text.
- Cart page loads and navigates to
/cartroute correctly.
npx playwright test- ⚛️ React.js
- 🔐 TypeScript
- 🔀 React Router
- 🧠 React Context API (State Management)
- 📦 FakeStoreAPI (Product Data)
- 🔔 React Hot Toast (Notifications)
- 💾 localStorage (Cart Persistence)
- 🧪 Playwright (E2E Testing)
- Clone the repository
git clone https://github.com/DeveloperZeeshu/React-Cart.git
- Navigate to the project directory:
cd React-Cart - Install dependencies:
npm install # or yarn - Start the development server:
npm run dev # or yarn dev - Open your browser and go to:
http://localhost:5173
Make sure you have Node.js (v18 or higher) installed before running the project.
-
Browse products on the Home Page
-
Filter products by category
-
Sort products by price
-
Click on any product to open the Product Detail Page
-
Add product to cart from the detail page
-
Open the Cart Page to:
- Adjust quantities
- Remove items
- View total price
-
Reload the page — your cart will still be there
Made with ❤️ by Jeesan Abbas