An open API service indexing awesome lists of open source software.

https://github.com/developerzeeshu/react-cart

A simple e-commerce web application built with React and TypeScript. Browse products, filter and sort by category/price, view product details, and manage a cart with persistent state.
https://github.com/developerzeeshu/react-cart

context-api ecommerce-website localstorage playwright react reactjs tailwindcss typescript

Last synced: about 1 month ago
JSON representation

A simple e-commerce web application built with React and TypeScript. Browse products, filter and sort by category/price, view product details, and manage a cart with persistent state.

Awesome Lists containing this project

README

          

# ๐Ÿ›’ React Cart

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

---

## โœจ Features

### ๐Ÿ  Home Page
- 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

### ๐Ÿ“„ Product Detail Page
- Full product details
- Product description
- Add to Cart button (โž• Add to cart only from here)

### ๐Ÿ›๏ธ Cart Page
- View selected products
- Increase / decrease quantity
- Remove items from cart
- Cart total & item count displayed
- Cart state **persists using localStorage**

### โœ… General
- Responsive design for all screen sizes
- Toast notifications using **React Hot Toast**
- Clean UI with simple user flow

---

## ๐Ÿงช E2E Testing
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 `/cart` route correctly.

### โ–ถ๏ธ How to Run Tests
```bash
npx playwright test
```

---

## โš™๏ธ Technologies Used

- โš›๏ธ React.js
- ๐Ÿ” TypeScript
- ๐Ÿ”€ React Router
- ๐Ÿง  React Context API (State Management)
- ๐Ÿ“ฆ FakeStoreAPI (Product Data)
- ๐Ÿ”” React Hot Toast (Notifications)
- ๐Ÿ’พ localStorage (Cart Persistence)
- ๐Ÿงช Playwright (E2E Testing)

---

## ๐Ÿš€ Installation & Setup

1. **Clone the repository**
```bash
git clone https://github.com/DeveloperZeeshu/React-Cart.git

2. **Navigate to the project directory:**
```bash
cd React-Cart

4. **Install dependencies:**
```bash
npm install
# or
yarn

5. **Start the development server:**
```bash
npm run dev
# or
yarn dev

6. **Open your browser and go to:**
```bash
http://localhost:5173

> Make sure you have Node.js (v18 or higher) installed before running the project.

---

# How to Use

- 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

---

## ๐Ÿ™‹โ€โ™‚๏ธ Author
Made with โค๏ธ by Jeesan Abbas