Skip to content

Repository files navigation

🌿 Kaamna β€” Where Money Ends, Desire Begins

A modern eCommerce application built with React, TypeScript, Axios, and MockAPI.

Kaamna is a complete frontend eCommerce experience featuring product browsing, search, cart management, delivery selection, checkout flow, order placement, order history, and package tracking.

This project was originally built using Vanilla JavaScript and later fully migrated to React + TypeScript to improve scalability, maintainability, and developer experience.


πŸš€ Live Demo

πŸ”— Live Application

https://react-ecommerce-project-xi.vercel.app/

Experience the complete Kaamna eCommerce workflow:

  • Browse products
  • Search products in real-time
  • Add items to cart
  • Update quantities
  • Select delivery options
  • Place orders
  • View order history
  • Track orders

Deployed on Vercel.


πŸ“Έ Screenshots

πŸ–₯ Desktop Experience

The primary shopping experience featuring product discovery, search, cart management, and responsive product cards.

Homepage Desktop


πŸ“± Mobile Experience

Fully responsive mobile layout with a dedicated navigation experience and mobile-optimized product browsing.

Homepage Mobile


πŸ” Real-Time Product Search

Instant product suggestions while typing, allowing users to quickly discover products.

Product Search


πŸ›’ Empty Cart State

Custom-designed empty cart experience encouraging users to continue shopping.

Empty Cart


πŸ’³ Checkout Experience

Complete checkout workflow featuring:

  • Order summary
  • Delivery option selection
  • Dynamic shipping costs
  • Tax calculations
  • Total order computation

Checkout Page


πŸ“¦ Orders Page

Users can review previous orders, view delivery information, and access order tracking.

Orders Page


🚚 Order Tracking

Track individual orders with delivery progress visualization and estimated arrival information.

Tracking Page


✨ Features

πŸ› Product Catalog

  • Browse products from backend API
  • Responsive product grid
  • Product ratings
  • Product pricing
  • Dynamic rendering using React components

πŸ” Product Search

  • Real-time search suggestions
  • Case-insensitive matching
  • Displays top matching products
  • Updates instantly as user types

❀️ Cart Management

Add to Cart

  • Add products with selected quantity
  • Updates existing cart items automatically
  • Prevents duplicate entries

Update Quantity

  • Quantity validation
  • Integer-only values
  • Range validation (1–10)

Delete Cart Items

  • Remove products from cart
  • Updates backend and UI instantly

🚚 Delivery Options

Users can select between multiple delivery options.

Features:

  • Delivery date calculation
  • Shipping cost display
  • Delivery option updates persisted to backend
  • Loading states while updating

πŸ’³ Checkout Flow

  • Order summary
  • Shipping calculations
  • Delivery calculations
  • Total cost calculation
  • Order placement

πŸ“¦ Order Management

After placing an order:

  • Order gets created in backend
  • Cart is cleared
  • User is redirected to Orders Page

Orders page displays:

  • Order Date
  • Order ID
  • Ordered Products
  • Quantity
  • Delivery Information

πŸš› Order Tracking

Track individual orders.

Displays:

  • Product Details
  • Quantity
  • Estimated Arrival Date
  • Delivery Progress UI

⚑ Loading States

Implemented loading states for:

  • Initial data fetching
  • Delivery option updates
  • Quantity updates
  • Cart item deletion
  • Order placement

🧠 Technical Concepts Used

React

  • Functional Components
  • Props
  • Component Composition
  • Conditional Rendering
  • Lists & Keys
  • Controlled Inputs
  • State Lifting

Hooks

  • useState
  • useEffect
  • useRef

TypeScript

  • Interfaces
  • Type-safe API calls
  • Typed React Props
  • Generics
  • Utility Types

API Integration

  • Axios
  • Async / Await
  • Promise.all
  • REST APIs

Routing

  • React Router
  • Route Parameters
  • Query Parameters
  • Navigation

State Management

Shared state architecture:

App
β”‚
β”œβ”€β”€ HomePage
β”‚   └── Product Cards
β”‚
β”œβ”€β”€ CheckoutPage
β”‚   β”œβ”€β”€ Cart Summary
β”‚   └── Payment Summary
β”‚
β”œβ”€β”€ OrderPage
β”‚
└── TrackingPage

State is lifted to the App component and shared across pages through props.


πŸ— Architecture

src
β”‚
β”œβ”€β”€ Components
β”‚   β”œβ”€β”€ HomePage
β”‚   β”œβ”€β”€ CheckoutPage
β”‚   β”œβ”€β”€ OrderPage
β”‚   β”œβ”€β”€ TrackingPage
β”‚   β”œβ”€β”€ SkeletonLoad
β”‚   └── Shared Components
β”‚
β”œβ”€β”€ Services
β”‚   β”œβ”€β”€ productApi.ts
β”‚   β”œβ”€β”€ cartApi.ts
β”‚   β”œβ”€β”€ orderApi.ts
β”‚   β”œβ”€β”€ deliveryOptionApi.ts
β”‚   └── deliveryOptionsApi.ts
β”‚
β”œβ”€β”€ Types
β”‚   β”œβ”€β”€ product.ts
β”‚   β”œβ”€β”€ cart.ts
β”‚   └── order.ts
β”‚
β”œβ”€β”€ Utility
β”‚   └── formatCurrency.ts
β”‚
β”œβ”€β”€ App.tsx
└── main.tsx

🌐 Backend

The application uses MockAPI for backend services.

Products

GET /products

Cart

GET    /cart
POST   /cart
PUT    /cart/:id
DELETE /cart/:id

Orders

GET  /orders
POST /orders

Delivery Options

GET /delivery-options

πŸ”„ Data Flow Example

Add To Cart

User Clicks Add To Cart
            ↓
handleAddToCart()
            ↓
Check Existing Item
       ↓           ↓
     Yes           No
       ↓           ↓
Update Qty      Create Item
       ↓           ↓
Update State Locally
       ↓
UI Re-renders

Place Order

User Clicks
"Fulfill Your Desire"
          ↓
Create Order
          ↓
Store In Orders API
          ↓
Delete Cart Items
          ↓
Clear Cart State
          ↓
Navigate To Orders Page

🎯 Challenges Solved

React Migration

One of the biggest goals of this project was migrating a complete eCommerce application from:

Vanilla JavaScript
        ↓
React + TypeScript

This migration required:

  • Component architecture design
  • State management redesign
  • Event handling refactor
  • API integration refactor
  • TypeScript adoption

Avoiding Unnecessary API Requests

Instead of refetching the cart after every update:

POST
↓
GET Cart Again ❌

The application updates local state directly:

POST
↓
Update State Locally βœ…

This reduces network requests and improves responsiveness.


πŸ“ˆ What I Learned

Through this project I gained hands-on experience with:

  • React Architecture
  • TypeScript
  • API Integration
  • State Management
  • Routing
  • Async JavaScript
  • Component Design
  • Frontend Debugging
  • CRUD Operations
  • Project Structuring

πŸ›  Tech Stack

Frontend

  • React
  • TypeScript
  • CSS3

Libraries

  • Axios
  • React Router DOM
  • Day.js

Backend

  • MockAPI

Build Tool

  • Vite

πŸš€ Installation

Clone the repository:

git clone https://github.com/yk-09/kaamna-ecommerce.git

Move into project:

cd kaamna-ecommerce

Install dependencies:

npm install

Start development server:

npm run dev

Build production version:

npm run build

πŸ‘¨β€πŸ’» Author

Yash Kumar

Frontend Developer


🌱 Future Improvements

  • Authentication
  • User Profiles
  • Wishlist
  • Product Reviews
  • Context API / Zustand
  • Payment Gateway Integration
  • Backend Migration from MockAPI
  • Order Status Synchronization
  • Admin Dashboard

⭐ If you like this project

Consider giving the repository a star.

It helps more people discover the project and motivates future improvements.


"Where Money Ends, Desire Begins."

Kaamna 🌿

Releases

Packages

Contributors

Languages