E-COMMERCE • WEB DEVELOPMENT

Cleanveda E-commerce Platform

A modern e-commerce experience built for product discovery, shopping and conversion.

Next.jsReactNode.jsPostgreSQLRazorpayTailwind CSS
C

Project Snapshot

IndustryRetail / Health & Wellness
Project TypeE-commerce Storefront & Admin Portal
RoleLead Frontend Developer
Timeline6 Weeks
TeamSolo Developer
PlatformWeb App (Desktop & Mobile)
Core Stack
Next.jsReactNode.jsPostgreSQLTailwind CSSRazorpay

Project Overview

Cleanveda is a custom-built e-commerce storefront for health and wellness products. Unlike template-based solutions, Cleanveda was designed from scratch to maximize page speed, optimize checkout conversions, and simplify administrative management. The architecture combines a Next.js frontend, an API layer, a PostgreSQL database, and Razorpay integrations.

The Problem

Template-based online stores are often slow to load and offer rigid checkout flows, which increases bounce rates and reduces conversions. Additionally, managing products, tracking inventory levels, and handling payments across disparate platforms introduces data sync errors.

The Solution

We built a custom Next.js storefront using Static Site Generation (SSG) for fast initial loads, coupled with client-side hydration for cart operations and dynamic features. We integrated Razorpay to process payments, and built a dedicated administrative dashboard for managing product catalogs and orders.

Architecture & Data Flow

Cleanveda uses Next.js to deliver static product pages. Cart updates and search queries are handled via client-side components communicating with a Node.js API gateway connected to a PostgreSQL database.

Layer 1: Entry & Client

Storefront (Next.js)

Static Product & Category Pages

Admin Dashboard

Catalog & Order Management

Layer 2: Orchestration & Logic

Node.js API

Inventory & Cart Middleware

Layer 3: Storage & Services

PostgreSQL DB

Product & Order Records

Razorpay API

Payment Gateway

Data Flow Connections

1
Storefront (Next.js)Node.js API

Checkout & Cart Requests

2
Admin DashboardNode.js API

Update Catalog & Inventory

3
Node.js APIPostgreSQL DB

SQL Queries

4
Node.js APIRazorpay API

Verify Payments via Webhooks

Key Features

Core capabilities implemented to fulfill business requirements and user needs.

Static Product Pages

Pre-rendered pages that load in milliseconds, helping to boost SEO and search visibility.

Dynamic Cart Management

Client-side cart validation that updates quantities and handles discounts.

Frictionless Payment Flow

Integrated Razorpay checkout to reduce steps and improve conversions.

Merchant Admin Panel

Dashboard for listing products, tracking orders, and updating inventory levels.

Responsive Storefront Design

Optimized layouts for mobile and desktop screens to ensure a consistent shopping experience.

Automated Billing Notifications

Sends order confirmations and PDF invoices via email upon payment completion.

Technical Implementation

Deep dive into code execution, state orchestrations, and API integrations for core modules.

1. Static Site Generation with ISR

Product catalogs are statically pre-rendered to ensure fast page loads, using Next.js Incremental Static Regeneration (ISR) to update catalog pages without requiring a full site rebuild.

app/products/[id]/page.tsxtypescript
import { getProductDetails } from "@/lib/db";
import { constructMetadata } from "@/lib/metadata";

export const revalidate = 3600; // Revalidate page content once per hour

export async function generateMetadata({ params }: { params: { id: string } }) {
  const product = await getProductDetails(params.id);
  return constructMetadata({
    title: `${product.title} | Cleanveda`,
    description: product.description,
    image: product.imageUrl
  });
}

export default async function ProductPage({ params }: { params: { id: string } }) {
  const product = await getProductDetails(params.id);
  
  return (
    <div className="container py-12">
      <div className="grid grid-cols-1 md:grid-cols-2 gap-8">
        {/* Product image and details layout */}
      </div>
    </div>
  );
}

2. Dynamic Cart State Management

To prevent client-side cart states from diverging from actual inventory, quantity updates are dynamically validated against the PostgreSQL database before checkout initialization.

hooks/useCart.tstypescript
import { useState, useEffect } from "react";

export function useCart() {
  const [items, setItems] = useState<CartItem[]>([]);

  const updateQuantity = async (productId: string, qty: number) => {
    const res = await fetch(`/api/cart/validate`, {
      method: "POST",
      body: JSON.stringify({ productId, quantity: qty }),
      headers: { "Content-Type": "application/json" }
    });
    
    if (res.ok) {
      setItems(prev => prev.map(item => 
        item.id === productId ? { ...item, quantity: qty } : item
      ));
    } else {
      alert("Requested quantity exceeds available inventory.");
    }
  };

  return { items, updateQuantity };
}

Technical Challenges & Solutions

Deep engineering obstacles solved during development, detailing specific logic, tradeoffs, and outcomes.

C1

Challenge

Optimizing Storefront Load Times

Resolution

Implemented Next.js Image Optimization and static pre-rendering.

Large product images slowed down load times. We solved this by using Next.js Image components to dynamically resize images, and pre-rendered all product pages to achieve sub-second load times.

C2

Challenge

Synchronizing Inventory Levels During High Traffic

Resolution

Implemented database transactions and checkout locks.

During high-traffic events, multiple users could attempt to purchase the last remaining item. We implemented SQL transaction locks in PostgreSQL to ensure quantities are updated atomically during order processing.

C3

Challenge

Reducing Checkout Abandonment Rates

Resolution

Designed a simplified multi-step checkout flow.

Complex checkout forms caused users to abandon their carts. We designed a simplified checkout flow with pre-filled addresses and a direct Razorpay modal integration to streamline the payment process.

Results & Engineering Outcomes

Concrete metrics and operational upgrades delivered through the completed project.

Sub-Second Page Load Times

Product and category pages load in milliseconds, improving the user experience and SEO performance.

Frictionless Mobile Checkout

Designed a simplified, responsive checkout flow that resulted in higher conversion rates on mobile devices.

Unified Store Management

Administrative dashboards centralized product catalog updates, inventory tracking, and order management.

Interface Gallery & Screenshots

Visual interface layout and user dashboards designed for the system.

Wellness Products

Cleanveda Herbal Essence

Organic, fast-dissolving supplement for daily vitality support.

₹699₹899Save 22%

Technology Stack

Detailed breakdown of the architectural choices and engineering considerations behind each technology.

TechnologyArchitectural RoleSelection Rationale
Next.jsFrontend FrameworkPowers static page rendering for fast load times, and dynamic API routes for cart operations.
Node.jsAPI ServerHandles business logic, permissions checks, and Razorpay integrations.
PostgreSQLDatabaseStores product metadata, order records, and user session data.
RazorpayPayment GatewayProcesses online transactions securely and handles billing receipts.

Frequently Asked Questions

Answers to technical details, implementation scopes, and operations related to the project.

Catalog updates made in the admin panel trigger Next.js Incremental Static Regeneration (ISR), updating pages in the background without requiring a full rebuild.
Yes. The storefront supports guest checkouts, requiring only basic contact and shipping information to complete orders.
Yes. The cart management service validates promo codes against configured discount rules in the PostgreSQL database before applying reductions.

Related Solutions

Need a similar platform?

Explore how I build, optimize, and launch technical solutions across these service verticals.

Work with me

Have a similar project in mind?

I can help design, build, and deploy custom AI solutions, SaaS portals, and full-stack web platforms. Tell me about your requirements — no sales calls required.

Discuss Your Project →