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
| 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.
- π 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
Make sure you have the following installed:
- Node.js v18 or higher
- npm v9 or higher
Check your versions:
node -v
npm -v# 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 devOpen http://localhost:5173 in your browser.
npm run buildThe output will be in the dist/ folder.
If deploying to Vercel, make sure vercel.json exists in the root of your project with:
{
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}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)
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| 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 |
| 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 |
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();// 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 falseWe welcome contributions from all team members! Here's how to work on the project:
# 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 mainfeat: add new feature
fix: fix a bug
style: change styling only
refactor: restructure code without changing behavior
docs: update documentation
- Never push directly to
main - Always open a Pull Request for review
- Test locally with
npm run devbefore pushing - Keep components small and focused β one job per file
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.
| 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