- Executive Summary
- Technical Architecture
- Prerequisites & Installation
- Environment Configuration
- Project Structure
- Key Features & Modules
- State Management Strategy
- API Integration & Security
- Styling & UI/UX
- Deployment
- Screenshots
- Changelog
The Rangiri WebStore Frontend is a high-performance, single-page application (SPA) designed for seamless online clothing retail. Built with React.js + Vite, it emphasizes:
- Fast page load and optimized performance.
- Mobile-first responsive design with smooth transitions.
- Reusable, modular components for maintainability.
- Integration with multiple payment gateways (Stripe, Razorpay, COD).
Highlights:
-
Premium UI design with modern 2025 trends (rounded cards, subtle shadows, smooth hover effects).
-
Lazy-loaded images with WebP/AVIF support for optimal performance.
-
Component-based architecture ensuring scalability and ease of updates.
-
Fast page load and optimized performance.
-
Mobile-first responsive design with smooth transitions.
-
Reusable, modular components for maintainability.
-
Integration with multiple payment gateways (Stripe, Razorpay, COD).
To remove all `` (bold formatting) from the file, here's the cleaned content for the $SELECTION_PLACEHOLDER$ section:
Highlights:
- Fast page load and optimized performance.
- Mobile-first responsive design with smooth transitions.
- Reusable, modular components for maintainability.
- Integration with multiple payment gateways (Stripe, Razorpay, COD).
- Premium UI design with modern 2025 trends (rounded cards, subtle shadows, smooth hover effects).
- Lazy-loaded images with WebP/AVIF support for optimal performance.
- Component-based architecture ensuring scalability and ease of updates.
Note: You'll also need to remove `` from other sections like:
- "Core Framework:" β "Core Framework:"
- "Build Tool:" β "Build Tool:"
- All other bolded terms throughout the document
Consider using find-and-replace (``) to remove all instances globally.
- Premium UI design with modern 2025 trends (rounded cards, subtle shadows, smooth hover effects).
- Lazy-loaded images with WebP/AVIF support for optimal performance.
- Component-based architecture ensuring scalability and ease of updates.
-
Core Framework: React.js (v18+)
-
Build Tool: Vite (optimized bundling, HMR)
-
Routing: React Router DOM (v6)
-
State Management: React Context API
-
Styling: Tailwind CSS (Utility-first framework)
-
HTTP Client: Axios
-
Notifications: React Toastify
-
Payment Integration: Stripe.js & Razorpay SDK
-
Font Typography: Google Fonts β Outfit, Prata
-
Performance Optimization:
- Lazy loading for product and hero images.
- Purged unused Tailwind CSS for minimal bundle size.
- Responsive grid layouts and mobile-first breakpoints.
Ensure your machine has:
- Node.js: v18+
- npm: v9+ or yarn
# Clone the repository
git clone <https://github.com/Nethmina01/Ecommerce-site.git>
# Navigate to frontend
cd frontend
# Install dependencies
npm install
# or
yarn install
# Start development server
npm run dev
# or
yarn devCreate a .env file in the root of the frontend directory with required environment variables:
VITE_BACKEND_URL=https://api.example.com
REACT_APP_STRIPE_KEY=your_stripe_key
REACT_APP_RAZORPAY_KEY=your_razorpay_keySecurity Note: Never commit .env to version control.
frontend/
βββ public/ # Static assets (images, icons)
βββ src/
β βββ assets/ # Images, icons, and other static resources
β βββ components/ # Reusable UI components
β β βββ Navbar.jsx
β β βββ Footer.jsx
β β βββ Hero.jsx
β β βββ ProductItem.jsx
β β βββ RelatedProducts.jsx
β β βββ CartTotal.jsx
β β βββ ...
β βββ context/ # Global State Logic (ShopContext.jsx)
β βββ pages/ # Route Views
β β βββ Home.jsx
β β βββ Collection.jsx
β β βββ Product.jsx
β β βββ Cart.jsx
β β βββ Login.jsx
β β βββ PlaceOrder.jsx
β β βββ Orders.jsx
β β βββ ...
β βββ App.jsx # Root component & route definitions
β βββ main.jsx # Entry point
β βββ index.css # Tailwind + global styles
βββ .env # Environment variables
βββ tailwind.config.js # Tailwind configuration
βββ vite.config.js # Vite configuration
βββ package.json # Dependencies & scripts
- Dynamic Filtering: Category (Men, Women, Kids) and Sub-Category (Topwear, Bottomwear, Winterwear).
- Sorting: Price Low-High, High-Low, and relevance.
- Search Functionality: Real-time search globally accessible from Navbar.
- Managed via ShopContext: add items, update sizes, modify quantities.
- Persistence: Cart state synced with backend for logged-in users.
- JWT-based login & registration.
- Protected routes redirect guests to login.
- Form validation for shipping information.
- Payment Gateways: Stripe (redirect), Razorpay (modal), Cash on Delivery.
-
Global state via Context API avoids prop drilling.
-
State includes:
products,cartItems,currency,token,search,navigate. -
Exposed functions:
addToCart(itemId, size)updateQuantity(itemId, size, quantity)getCartCount()getCartAmount()
- Axios used for HTTP requests.
- Base URL configured via
.env. - Token injected into headers for protected endpoints:
const headers = { token: localStorage.getItem("token") };
await axios.post(url, data, { headers });- Error Handling: Try-catch blocks + React Toastify notifications.
- Optimistic UI updates for better responsiveness.
- Framework: Tailwind CSS for rapid styling & low bundle size.
- Responsive Design: Mobile-first, adapts across devices.
- Animations: Subtle hover effects for buttons, product cards, and route transitions.
- Premium Visuals: Rounded cards, shadows, smooth scaling effects.
- Scroll Management: Hidden scrollbars for clean aesthetics in horizontal sections (Related Products).
- Lazy Loading: High-quality images load progressively for faster initial paint.
- Build:
npm run buildoryarn build. - Hosting Options: Vercel, Netlify, AWS S3 + CloudFront.
- Environment Variables: Configure on the hosting platform.
- HTTPS: Ensure secure headers are enabled.
v1.0.0 β Initial release
- SPA with React + Vite
- Tailwind CSS styling
- Product discovery, cart, checkout with Stripe & Razorpay
- Context API state management
- Mobile-first, responsive UI
v1.1.0 β Improvements
- Lazy loading of images
- Premium rounded cards & hover effects
- PropTypes validation added to all components
- Optimized for faster load and smaller bundle size



