← Back to Course

Project 03: E-commerce Product Catalog

Phase 1: Solidifying Fundamentals
Why This Project?

E-commerce skills are valuable because every online store needs product catalogs, filters, and shopping carts. This project teaches you how to handle large amounts of data efficiently.

You'll learn pagination, which is crucial when you have thousands of products. Loading everything at once would be too slow. You'll also learn filtering and searching, which users expect in modern web apps.

State management with shopping carts teaches you how to handle complex application state. The cart needs to persist even if users refresh the page, which is a common real-world requirement.

Why This Project?

E-commerce skills are valuable because every online store needs product catalogs, filters, and shopping carts. This project teaches you how to handle large amounts of data efficiently.

You'll learn pagination, which is crucial when you have thousands of products. Loading everything at once would be too slow. You'll also learn filtering and searching, which users expect in modern web apps.

State management with shopping carts teaches you how to handle complex application state. The cart needs to persist even if users refresh the page, which is a common real-world requirement.

Overview

Build a full-stack product browsing system with advanced filtering, sorting, pagination, and shopping cart functionality. This project teaches you how to handle complex state management, build intuitive user interfaces, and optimize database queries for better performance.

You'll create both the backend API for product management and a polished frontend that provides smooth browsing and shopping experience similar to real e-commerce sites.

Learning Objectives

Implement complex filtering and search logic

Build efficient pagination for large datasets

Manage shopping cart state with Redux Toolkit or Context API

Optimize database queries with indexes and projections

Create responsive product grid layouts

Handle loading states and error boundaries

Core Requirements

Product catalog API with filtering, sorting, and pagination

Product search by name and description (case-insensitive)

Filter products by category, price range, and rating

Sort products by price, rating, name, or newest first

Shopping cart stored in browser local storage

Add, remove, and update quantities in cart

Display cart total and item count

Responsive product grid (1 column mobile, 2-3 tablet, 4 desktop)

Product detail page with full information

Product Data Model

id, name, description, price, category, imageUrl

rating (1-5 stars), reviewCount, stock, sku

brand, tags (array), createdAt, updatedAt

Create seed data for at least 50 products across 5 categories

API Endpoints

GET /api/products - Get paginated products with filters

GET /api/products/:id - Get single product details

GET /api/categories - Get all available categories

GET /api/products/search - Search products by keyword

Query parameters: page, limit, category, minPrice, maxPrice, minRating, sort

Frontend Features

Product listing page with filter sidebar and product grid

Active filters display with ability to clear individual filters

Search bar with debounced search (300ms delay)

Pagination controls (previous, next, page numbers)

Loading skeletons while fetching products

Empty state when no products match filters

Shopping cart icon with item count badge in header

Cart sidebar or modal showing all items and total

Product cards showing image, name, price, rating

Technical Challenges

Build reusable filter component that updates URL query params

Implement debounced search to reduce API calls

Synchronize cart state with local storage

Handle loading and error states gracefully

Build efficient MongoDB queries with multiple filters

Add indexes to frequently queried fields (category, price, rating)

Implement optimistic UI updates for cart operations

Preserve scroll position when navigating back from product page

State Management

Products: fetched from API, stored in component state or Redux

Filters: synced with URL query parameters

Cart: persisted in local storage, managed with Context API or RTK

UI state: loading, errors, selected product, cart open/closed

Bonus Features

Add product image carousel on detail page

Implement "Recently Viewed" products feature

Add product comparison (select 2-3 products to compare)

Show related products on detail page

Add wishlist/favorites functionality

Implement infinite scroll instead of pagination

Add price alerts (notify when price drops)

Show stock levels and low stock warnings

Helpful Resources

MongoDB Queries: Look up MongoDB query operators like $gte, $lte, $regex. These help you filter data.

Pagination: Search for "pagination tutorial" or "API pagination best practices".

React Context API: React docs have a great Context tutorial. Use it for cart state management.

Redux Toolkit: If you prefer Redux, check out Redux Toolkit docs. It's simpler than old Redux.

Local Storage: MDN docs on localStorage. It's simple - just setItem() and getItem().

Debouncing: Search for "JavaScript debounce" to learn how to delay search requests.

Helpful Resources

MongoDB Queries: Look up MongoDB query operators like $gte, $lte, $regex. These help you filter data.

Pagination: Search for "pagination tutorial" or "API pagination best practices".

React Context API: React docs have a great Context tutorial. Use it for cart state management.

Redux Toolkit: If you prefer Redux, check out Redux Toolkit docs. It's simpler than old Redux.

Local Storage: MDN docs on localStorage. It's simple - just setItem() and getItem().

Debouncing: Search for "JavaScript debounce" to learn how to delay search requests.

Success Criteria

All filters work correctly and can be combined

Search returns relevant results quickly

Pagination works smoothly with correct page counts

Cart persists across browser refreshes

UI responds immediately to user actions

Loading states are clear but not intrusive

Application works well on mobile devices

Database queries execute in under 500ms with 1000+ products

Learning Resources

Study MongoDB query operators (and, or, gte, lte, regex)

Learn about database indexing for performance

Research debouncing patterns in React

Explore URL state management with React Router

Look into skeleton loading patterns

Hint: Store your filter state in URL query parameters so users can bookmark or share filtered views. This also makes browser back/forward buttons work naturally.

For the cart, create a custom hook like useCart() that handles all cart operations and local storage synchronization. This keeps your components clean and makes the cart logic reusable.

Submit Your Project

Once you've completed this project, submit your GitHub repository link below: