Skip to content

amanuel1221/e-commerce

Repository files navigation

πŸ›’ E-Commerce Website

License Build Deployment

A modern responsive e-commerce frontend built with React, Tailwind CSS, and Vite.
Features product listing, cart management, favorites, dummy payment flow, EmailJS contact form, AI-driven UI, and a clean responsive design.


πŸ”— Live Demo

πŸ‘‰ View Demo


πŸ“Έ Screenshots

Home Product Cart
Home Product Cart
Favorites Contact Payment
Favorites Contact Payment

❀️ Favorites

-Adding/removing favorites -πŸ›οΈ Browse & Add -Browsing products + adding to cart

Favorites GIF

πŸ’³ Checkout Flow

-Simulated checkout process -and sees the order history

CHECKOUT FLOW GIF


Responsiveness of Website

-Check the responsiveness with different devices

MOBILE GIF

Authentications

Sign Up

sign-up

Sign-in

Sign in

πŸš€ Features

  • πŸ›οΈ Product Listing – Images, prices, descriptions
  • πŸ›’ Shopping Cart – Add/remove items, update quantities, localStorage persistent
  • ❀️ Favorites / Wishlist – Save favorite products
  • βœ‰οΈ Contact Form – EmailJS frontend integration
  • πŸ’³ Payment (Demo) – Address + card form UI for checkout simulation
  • πŸ” Search & Filter – Keyword & category search
  • πŸ€– AI Visibility Component – AI-driven product suggestions
  • πŸ“¦ Order History – Simulated order progress (Pending β†’ Delivered)
  • πŸ§ͺ Testing – Vitest + Testing Library for UI & logic

*** Tech Stacks & Badges

React Vite Axios Vitest Zustand Vercel


πŸ›  Tech Stack

  • Frontend: React + Vite
  • Styling: Tailwind CSS
  • State Management: React Context API + Zustand + Hooks
  • Email Service: EmailJS
  • Icons: Lucide React
  • Hosting: Vercel
  • Data: Static JSON (mock backend)

πŸ’» Installation & Setup

# 1. Clone repo
git clone https://github.com/amanuel1221/e-commerce.git
cd e-commerce

# 2. Install dependencies
npm install

# 3. Add environment variables (.env)
VITE_EMAILJS_SERVICE_ID=xxxx
VITE_EMAILJS_TEMPLATE_ID=xxxx
VITE_EMAILJS_PUBLIC_KEY=xxxx

# 4. Start dev server
npm run dev

# 5. Open app
http://localhost:5173
πŸ§ͺ Testing
bash
Copy code
# Run all tests
npm run test
ProductCard Tests: Rendering, add to cart, favorites, filtering, load more

Cart Tests: Increment/decrement, remove, clear cart, total calculation

Orders Tests: Current user filtering, mark delivered, clear history

Testing Experience:

Initial failures due to undefined props and missing store mocks

Solved with mocking Zustand store/context and passing proper test data

Learned state, props, and hooks interactions in tests

After debugging, all tests pass successfully βœ…

πŸ“‚ Project Structure
css
Copy code
e-commerce/
β”œβ”€ public/
β”œβ”€ src/
β”‚  β”œβ”€ components/
β”‚  β”‚   β”œβ”€ Header.jsx
β”‚  β”‚   β”œβ”€ Footer.jsx
β”‚  β”‚   β”œβ”€ ProductCard.jsx
β”‚  β”‚   β”œβ”€ CartItem.jsx
β”‚  β”‚   β”œβ”€ FavoriteItem.jsx
β”‚  β”‚   β”œβ”€ ContactForm.jsx
β”‚  β”‚   β”œβ”€ PaymentForm.jsx
β”‚  β”‚   └─ AIVisibility.jsx
β”‚  β”œβ”€ pages/
β”‚  β”‚   β”œβ”€ Home.jsx
β”‚  β”‚   β”œβ”€ Product.jsx
β”‚  β”‚   β”œβ”€ Cart.jsx
β”‚  β”‚   β”œβ”€ Favorites.jsx
β”‚  β”‚   β”œβ”€ Contact.jsx
β”‚  β”‚   └─ Payment.jsx
β”‚  β”œβ”€ context/
β”‚  β”œβ”€ data/
β”‚  β”œβ”€ services/
β”‚  β”œβ”€ store/
β”‚  β”œβ”€ App.jsx
β”‚  └─ main.jsx
β”œβ”€ package.json
β”œβ”€ tailwind.config.js
β”œβ”€ vite.config.js
└─ README.md
⚑ Usage
Browse products & add to Cart/Favorites

Manage items from Cart/Favorites

Submit Contact Form (EmailJS)

Test demo Payment UI

View AI suggested items

🧠 What I Learned
Component Architecture: Reusable components, props, shared state

EmailJS: Setup, environment variables, debugging failed submissions

UI Libraries: Tailwind, Lucide icons, Framer Motion

Cart & Payment Logic: State management, totals, multi-step checkout

Testing: Mocking context, handling hooks, UI & state validation

Deployment: Vercel build fixes & environment variables

🧩 Challenges & Solutions
Component connection issues β†’ Fixed by lifting state & reorganizing components

EmailJS failures β†’ Correct IDs & .env setup

UI bugs β†’ Debugged imports & library setup

Cart/Payment bugs β†’ Fixed totals & navigation

Testing failures β†’ Mocked store & context properly, carefully passing data β†’ all tests pass βœ…

πŸ”§ Future Improvements
Real backend (Node.js / Django)

Real payments (Stripe/PayPal)

Admin dashboard

AI-powered recommendations

Persistent orders & favorites in database

🀝 Contributing
bash
Copy code
# Fork the repo
git checkout -b feature/your-feature
git commit -m "Add feature"
git push origin feature/your-feature
Open a pull request πŸš€

πŸ“„ License
This project is licensed under the MIT License.

🌟 Acknowledgements
React

Tailwind CSS

Vite

EmailJS

Lucide React Icons

About

Modern responsive e-commerce website built with React, Vite,Vitest and Tailwind CSS. Includes cart, favorites, payment UI, EmailJS contact form.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages