A comprehensive, modern e-commerce platform showcasing enterprise-level React development with TypeScript, Redux Toolkit, React Query, and advanced state management patterns.
- Overview
- Features
- Tech Stack
- Project Requirements
- Installation & Setup
- Project Structure
- Key Implementation Details
- Testing
- Deployment
- API Integration
- Contributing
- Acknowledgments
This advanced e-commerce application is a full-featured online shopping platform built as part of the Frontend Development Specialization course at Coding Temple. The project demonstrates mastery of modern React development practices, state management, data fetching strategies, and production-ready application architecture.
Live Application: https://advanced-react-chi.vercel.app/
The application integrates with the FakeStore API to provide a realistic e-commerce experience with product browsing, category filtering, shopping cart management, and checkout functionality.
-
π¦ Product Catalog
- Dynamic product listing fetched via React Query
- Display of title, price, category, description, ratings, and images
- Real-time product search and filtering
- Responsive grid and list view options
-
ποΈ Category Navigation
- Dynamic category dropdown populated from API
- Filter products by category (Electronics, Jewelry, Men's/Women's Clothing)
- Dedicated category pages with breadcrumb navigation
- Sort products by price, rating, and newest arrivals
-
π Shopping Cart
- Add/remove products with instant feedback
- Update product quantities with increment/decrement controls
- Real-time total price calculation
- Session storage persistence across page refreshes
- Redux Toolkit for centralized state management
- Visual cart badge with item count
-
π³ Checkout Process
- Simulated checkout with order confirmation
- Cart clearing functionality
- Success modal with visual feedback
- Session storage cleanup
-
π¨ Modern UI/UX
- Responsive design (mobile-first approach)
- Smooth animations and transitions
- Tailwind CSS styling with custom color palette
- Accessible components with ARIA labels
- Image fallback handling for broken URLs
-
β‘ Performance Optimizations
- React Query caching and background refetching
- Code splitting and lazy loading
- Optimized bundle size
- Fast page loads with Vite
-
π State Management
- Redux Toolkit for global cart state
- React Query for server state
- Local storage for cart persistence
- Centralized state logic with slices
-
π§ͺ Testing & Quality
- 14 unit tests with Vitest
- 21 end-to-end tests with Playwright
- GitHub Actions CI/CD pipeline
- Automated testing on pull requests
-
π‘ Observability
- OpenTelemetry distributed tracing
- HTTP instrumentation
- Performance monitoring ready
- React 18.2.0 - Modern UI library with hooks and concurrent features
- TypeScript 5.3.0 - Type-safe JavaScript for better developer experience
- Vite 7.2.7 - Next-generation frontend tooling for lightning-fast builds
- Redux Toolkit 1.9.7 - Simplified Redux with best practices built-in
- React Query 5.0.0 - Powerful data synchronization for server state
- Session Storage - Client-side cart persistence
- React Router DOM 6.20.0 - Declarative routing for React applications
- Tailwind CSS 3.4.18 - Utility-first CSS framework
- PostCSS - CSS transformations and optimizations
- CSS Modules - Scoped styling for components
- Axios - Promise-based HTTP client
- FakeStore API - RESTful API for product data
- Vitest 4.0.15 - Blazing fast unit testing framework
- Playwright 1.57.0 - End-to-end testing automation
- Testing Library - User-centric testing utilities
- GitHub Actions - CI/CD pipeline automation
- Vercel/Netlify - Deployment platforms
- ESLint - Code linting and formatting
- OpenTelemetry - Distributed tracing and observability
This project fulfills all requirements for the Advanced React E-Commerce assignment:
- React Query retrieves all products and displays on Home component
- Shows title, price, category, description, rating, and image for each product
- Add to cart button on each product
- Image fallback implementation for 404 errors
- Dynamic select dropdown for product categories (not hardcoded)
- React Query fetches categories from API endpoint
- Filter products by selected category
- Uses category-specific API endpoint for filtered results
- Redux Toolkit manages shopping cart state
- Reducers and actions for add, update, and remove operations
- Shopping Cart component displays cart items
- Shows title, image, quantity (count), and price for each item
- Remove button for each product in cart
- Add to cart directly from home product listing page
- Cart data stored in sessionStorage
- Data persists across components and browser sessions
- Cart stored as array of product objects
- Display total number of products in cart
- Display total price of all products
- Dynamic updates as cart contents change
- Checkout feature implemented
- Simulated checkout clears Redux state and sessionStorage
- Visual feedback on successful checkout
- GitHub repository created with regular commits
- Clean and interactive README.md with instructions
- Clear explanations of application features
- Node.js 20.19.0+ (required for Vite 7)
- npm, yarn, or pnpm
- Git for version control
git clone https://github.com/justinwols88/Advanced-React.git
cd Advanced-React/my-storenpm installnpm run devOpen http://localhost:5173 in your browser.
npm run buildOutput will be in the dist/ directory.
npm run preview# Unit tests
npm test
# E2E tests
npm run test:e2e
# E2E tests with UI
npm run test:e2e:uimy-store/
βββ public/ # Static assets
β βββ images/ # Product images
βββ src/
β βββ components/ # React components
β β βββ cart/ # Cart-specific components
β β β βββ CartIcon.tsx
β β β βββ CartItem.tsx
β β β βββ CartSummary.tsx
β β βββ checkout/ # Checkout components
β β β βββ CheckoutModal.tsx
β β βββ common/ # Reusable UI components
β β β βββ Button.tsx
β β β βββ ErrorBoundary.tsx
β β β βββ ImageWithFallback.tsx
β β β βββ Loader.tsx
β β βββ layout/ # Layout components
β β β βββ Header.tsx
β β β βββ Footer.tsx
β β β βββ Layout.tsx
β β βββ products/ # Product components
β β β βββ CategoryDropdown.tsx
β β β βββ ProductCard.tsx
β β β βββ ProductGrid.tsx
β β βββ Breadcrumb.tsx
β β βββ FilterSidebar.tsx
β β βββ Pagination.tsx
β βββ hooks/ # Custom React hooks
β β βββ useCart.ts # Cart management hook
β β βββ useProducts.ts # Product fetching hook
β βββ pages/ # Page components
β β βββ Home.tsx # Homepage with products
β β βββ CategoryPage.tsx # Category listing page
β β βββ ProductDetail.tsx # Single product page
β β βββ CartPage.tsx # Shopping cart page
β βββ services/ # External services
β β βββ api.ts # API calls to FakeStore
β β βββ storage.tsx # Session storage utilities
β βββ store/ # Redux store
β β βββ index.ts # Store configuration
β β βββ cartSlice.ts # Cart state slice
β βββ types/ # TypeScript definitions
β β βββ product.types.ts
β β βββ cart.types.tsx
β β βββ index.ts
β βββ utils/ # Utility functions
β β βββ cn.ts # Class name utilities
β βββ App.tsx # Root component
β βββ main.tsx # Application entry point
β βββ routes.tsx # Route definitions
βββ e2e/ # End-to-end tests
β βββ app.spec.ts # Playwright test suite
βββ test/ # Test utilities
β βββ setup.ts # Test configuration
βββ .github/
β βββ workflows/
β βββ main.yml # CI/CD pipeline
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ playwright.config.ts # Playwright configuration// Efficient data fetching with caching
const { data: products, isLoading, error } = useProducts(categoryId);- Automatic caching and background refetching
- Error handling and loading states
- Category-based filtering
- Optimistic UI updates
// Centralized cart state management
const dispatch = useDispatch();
dispatch(addToCart(product));
dispatch(updateQuantity({ id, quantity }));
dispatch(removeFromCart(id));- Immutable state updates with Immer
- Action creators automatically generated
- DevTools integration for debugging
- Session storage middleware
// Graceful degradation for broken images
<ImageWithFallback
src={product.image}
alt={product.title}
fallbackSrc="https://via.placeholder.com/300"
/>- Handles 404 errors from FakeStore API
- Automatic fallback to placeholder images
- No broken image icons visible to users
// Dynamic category dropdown
const { data: categories } = useCategories();
<CategoryDropdown
categories={categories}
onChange={setSelectedCategory}
/>- Fetches categories from API (not hardcoded)
- Filters products by selected category
- Updates URL with category parameter
// Simulated checkout with state clearing
const handleCheckout = () => {
dispatch(clearCart());
sessionStorage.removeItem('cart');
showSuccessModal();
};- 14 passing tests covering components, hooks, and utilities
- Testing Library for user-centric assertions
- Mock implementations for external dependencies
npm test- 21 passing tests covering critical user flows
- Homepage product display
- Product detail navigation
- Add to cart functionality
- Quantity updates
- Cart management
- Checkout process
- Category filtering
npm run test:e2e- GitHub Actions workflow runs on every push
- Automated testing on Node 20.x
- Build verification before deployment
- Test results reported in pull requests
- Production: https://advanced-react-chi.vercel.app/
- Platform: Vercel
- Build: Automatic deployment from
masterbranch
- Push code to GitHub
- Import repository in Vercel dashboard
- Configure build settings:
- Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist
- Deploy automatically on every push
- Connect GitHub repository
- Configure build settings:
- Build Command:
npm run build - Publish Directory:
dist
- Build Command:
- Enable automatic deployments
- Graceful fallbacks for API failures
- Image placeholder for 404 image errors
- User-friendly error messages
- Retry logic with React Query
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
- FakeStore API - Providing free, reliable product data
- Tailwind CSS - Beautiful, customizable styling utilities
- React Query - Powerful data synchronization
- Redux Toolkit - Simplified Redux state management
- Vercel - Seamless deployment platform
- Coding Temple - Frontend Development Specialization program
- GitHub: @justinwols88
- Project: Advanced React E-Commerce
- Course: Full-stack specialization Developer @ Coding Temple
This project was hand-crafted with many hours of focused care to build the best possible e-commerce experience. Every component, every interaction, and every line of code was thoughtfully designed and implemented with attention to detail and dedication to quality.