Skip to content

About

A modern e-commerce web application built with React that integrates a third-party API to display products, categories, and images. Designed to simulate a real-world online shopping experience with dynamic data and a responsive user interface.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

176 Commits

Folders and files

Repository files navigation

πŸ›οΈ LumΓ© β€” E-Commerce Website

A modern multi-page React e-commerce web application powered by a free products API. Designed to simulate a real-world online shopping experience with dynamic data, dark mode, and a responsive user interface.

🌐 Live Demo: lume-commerce.vercel.app


πŸ“¦ Tech Stack

Technology Purpose
React 18 UI framework
Vite Build tool and dev server
React Router v6 Client-side routing
Tailwind CSS v4 Utility-first styling
Context API Cart and Wishlist state management
localStorage Cart and Wishlist persistence

No external state library (Redux, Zustand) needed.


✨ Features

  • πŸ›’ Add to Cart with quantity controls
  • ❀️ Wishlist / Favorites page
  • πŸ” Search and filter by category
  • πŸŒ™ Dark mode with system preference detection
  • πŸ“¦ Checkout and purchase flow
  • πŸ—‚οΈ Product modal with description on click
  • πŸ’Ύ Cart and Wishlist persist after page refresh

πŸš€ Getting Started

Prerequisites

Make sure you have the following installed:

  • Node.js v18 or higher
  • npm v9 or higher

Check your versions:

node -v
npm -v

Installation

# 1. Clone the repo
git clone https://github.com/Nyxth-666/E-Commerce-App.git

# 2. Move into the project folder
cd E-Commerce-App

# 3. Install all dependencies
npm install

# 4. Start the development server
npm run dev

Open http://localhost:5173 in your browser.

Build for Production

npm run build

The output will be in the dist/ folder.

Vercel Deployment Note

If deploying to Vercel, make sure vercel.json exists in the root of your project with:

{
  "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}

This is required for React Router to work on Vercel.

πŸ—‚οΈ Project Structure

src/
β”œβ”€β”€ api/
β”‚   └── product.js             # All API fetch functions + formatPrice helper
β”‚
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useProducts.js         # Fetch list (with category/search filter)
β”‚   β”œβ”€β”€ useProduct.js          # Fetch single product by id
β”‚   β”œβ”€β”€ useCategories.js       # Fetch all unique categories
β”‚   └── useDarkMode.js         # Toggle and persist dark mode
β”‚
β”œβ”€β”€ context/
β”‚   β”œβ”€β”€ CartContext.jsx        # Cart state β€” add/remove/update/clear
β”‚   └── WishlistContext.jsx    # Wishlist toggle + persist
β”‚
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   β”œβ”€β”€ Layout.jsx         # Navbar + Outlet + Footer wrapper
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx         # Top nav β€” search, cart, wishlist, dark mode
β”‚   β”‚   └── FooterBar.jsx      # Links, contact info, team, social icons
β”‚   β”‚
β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”œβ”€β”€ ProductCard.jsx    # Card β€” image, name, price, Add to Cart
β”‚   β”‚   β”œβ”€β”€ ProductModal.jsx   # Modal popup with full product description
β”‚   β”‚   β”œβ”€β”€ CategoryCard.jsx   # Category image + icon badge + label
β”‚   β”‚   β”œβ”€β”€ CategoriesSection.jsx # Full categories row pulled from API
β”‚   β”‚   β”œβ”€β”€ FeaturedBanner.jsx # Top Pick hero banner from API
β”‚   β”‚   β”œβ”€β”€ HeroSlider.jsx     # Auto-rotating homepage hero with dots
β”‚   β”‚   β”œβ”€β”€ TrustBar.jsx       # Quality / Delivery / Returns / Support
β”‚   β”‚   └── StarRating.jsx     # Reusable star rating display
β”‚   β”‚
β”‚   └── common/
β”‚       β”œβ”€β”€ Button.jsx         # Reusable button variants
β”‚       └── SearchBar.jsx      # Search input with icon
β”‚
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ HomePage.jsx           # Landing page with hero, featured, categories
β”‚   β”œβ”€β”€ ProductsPage.jsx       # All products with search + category filter
β”‚   β”œβ”€β”€ AboutPage.jsx          # About the store
β”‚   β”œβ”€β”€ ContactPage.jsx        # Contact form
β”‚   β”œβ”€β”€ CartPage.jsx           # Shopping cart with promo code
β”‚   β”œβ”€β”€ PurchasePage.jsx       # Checkout with address + payment
β”‚   β”œβ”€β”€ WishlistPage.jsx       # Saved / liked products
β”‚   └── NotFoundPage.jsx       # 404 fallback
β”‚
β”œβ”€β”€ App.jsx                    # Routes + Provider wrappers
β”œβ”€β”€ main.jsx                   # React entry point
└── index.css                  # Tailwind + CSS variables (light/dark mode)

🌐 API

All product data is fetched from a free public JSON API:

https://kolzsticks.github.io/Free-Ecommerce-Products-Api/main/products.json

Configure via .env in the root of your project:

VITE_API_URL=https://kolzsticks.github.io/Free-Ecommerce-Products-Api/main/products.json

Available API Functions (src/api/product.js)

Function Description
getProducts() Returns all 50 products
getProductById(id) Returns one product by id
getProductsByCategory(cat) Filters products by category name
searchProducts(query) Searches by name, category, keywords
getCategories() Returns ["All", ...unique categories]
getFeaturedProducts(limit) Top-rated products, default limit 4
formatPrice(priceCents) Formats cents to β‚±1,234

Product Categories

Category Description
Electronics & Gadgets Phones, monitors, peripherals
Fashion & Apparel Clothing, shoes, accessories
Beauty & Personal Care Skincare, cosmetics
Home & Kitchen Appliances, home essentials
Health & Fitness Equipment, supplements

πŸ›’ Using Cart & Wishlist

Import and use in any component:

import { useCart } from "../context/CartContext";
import { useWishlist } from "../context/WishlistContext";

// Cart
const {
  addToCart,
  removeFromCart,
  updateQuantity,
  clearCart,
  items,
  totalItems,
  totalPrice,
  isInCart,
} = useCart();

// Wishlist
const {
  toggleWishlist,
  removeFromWishlist,
  clearWishlist,
  items,
  isWishlisted,
  totalWishlisted,
} = useWishlist();

Example β€” ProductCard usage

// Add to cart
addToCart(product); // quantity defaults to 1
addToCart(product, 3); // add 3 at once

// Check if already in cart
isInCart(product.id); // β†’ true or false

// Toggle wishlist heart
toggleWishlist(product); // adds if not there, removes if already saved
isWishlisted(product.id); // β†’ true or false

🀝 Contributing

We welcome contributions from all team members! Here's how to work on the project:

Workflow

# 1. Always pull the latest changes before starting work
git pull origin main

# 2. Create a new branch for your feature or fix
git checkout -b feature/your-feature-name

# 3. Make your changes, then stage and commit
git add .
git commit -m "feat: describe what you did"

# 4. Push your branch
git push origin feature/your-feature-name

# 5. Open a Pull Request on GitHub β€” do NOT push directly to main

Commit Message Format

feat: add new feature
fix:  fix a bug
style: change styling only
refactor: restructure code without changing behavior
docs: update documentation

Rules

  • Never push directly to main
  • Always open a Pull Request for review
  • Test locally with npm run dev before pushing
  • Keep components small and focused β€” one job per file

πŸ“„ License

This project is licensed under the MIT License.

You are free to use, copy, modify, and distribute this project for personal or educational purposes.

See the LICENSE file for full details.


πŸ‘₯ Team

Member Role / Assigned Section
Barotea πŸ‘‘ Project Leader
Aguilera Navbar
De Guzman Footer
Lacuesta Contact Page
Hufana, Sepillo, Chua About Page
Domanico, Elumba, Guiruela, Oabel Featured Section / Design
Rances, Endozo Category Section
Orte, Camunag, Dalumpines Products Section

Made with ❀️ by the Lumé Team

About

A modern e-commerce web application built with React that integrates a third-party API to display products, categories, and images. Designed to simulate a real-world online shopping experience with dynamic data and a responsive user interface.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages