R
0

Commerce Engineering

What I understand about eCommerce systems.

An honest breakdown of my commerce engineering knowledge — what I've built in production, what I'm actively learning, and what's on my roadmap. No inflation.

0
Built
0
Working Knowledge
0
Learning
0
Planned

Level definitions

Built — Implemented in a real, production project
Working Knowledge — Used in a real project or studied in depth
Learning — Actively studying and building with
Planned — On my learning and building roadmap

Commerce System Map

The eCommerce lifecycle.

Every eCommerce system is a pipeline. This is the full lifecycle — from product discovery through to post-purchase analytics — and where I am in understanding each stage.

01Product CatalogVedaGlow
02Search & DiscoveryGharBazaar
03Cart EngineVedaGlow
04Checkout FlowVedaGlow
05PaymentRazorpay verified
06Order ManagementVedaGlow
07InventoryIn progress
08AnalyticsGharBazaar events

Supporting Systems

Supabase AuthBoth products
Row-Level Security155 policies
Admin PanelBoth products
REST API DesignAll projects
PostgreSQL / SupabaseBoth products
PostGISGharBazaar
Payment GatewayRazorpay verified
Automated Testing196 unit tests

Technical Stack

The technology layer by layer.

How the technical stack is organized across my projects — from browser to database.

Frontend

React 19

Server and client components

Next.js 16 (App Router)

GharBazaar + this portfolio

TanStack Start

SSR + server functions (VedaGlow)

TypeScript 5

Strict typing across every project

API Layer

Next.js Route Handlers

59 endpoints in GharBazaar

TanStack server functions

Typed server calls with auth middleware

Zod

Runtime schema validation

Supabase Auth

Session and identity management

Data

PostgreSQL

Primary database in both products

Supabase

Managed Postgres, Auth and Storage

Row-Level Security

155 policies across both products

PostGIS

Geospatial proximity (GharBazaar)

Commerce Logic

Cart Engine

Persistence, validation, totals

Order Management

Six-state lifecycle

Coupon Engine

Discount rules + usage caps

Razorpay

Server-side signature verification

Quality & Delivery

Vitest + Playwright

196 unit + 23 e2e specs

GitHub Actions

Lint, test, build, e2e on every push

Vercel

Deployment + scheduled jobs

Git + GitHub

Version control

Core Commerce

The fundamental systems that every eCommerce platform must have

Product Catalog

Built

Product listings, variants, categories, images, SEO-friendly URLs, and schema.org structured data.

  • ·Product model design with variants (size, colour, SKU)
  • ·Category and collection hierarchies
  • ·Image upload, storage, and WebP optimization
  • ·Schema.org Product markup for SEO rich results
  • ·Admin product management interface — CRUD + publish workflow
  • ·Slug-based SEO URLs with canonical tags
VedaGlow

Cart Engine

Built

Add to cart, quantity management, persistent cart state across sessions, and cart totals with discount application.

  • ·Add, update, and remove items
  • ·Persistent cart state surviving refresh and tab closure
  • ·Real-time cart totals and subtotal calculation
  • ·Coupon/discount code application with eligibility checks
  • ·Cart validation before checkout — stock, price, availability
  • ·Server-side re-validation of line items and totals at order creation
VedaGlow

Checkout Flow

Built

Multi-step checkout covering address collection, order summary, payment selection, and order confirmation.

  • ·Multi-step checkout UX (address → review → payment → confirm)
  • ·Address form with validation and PIN-code auto-fill
  • ·Order summary with full line-item breakdown
  • ·Payment method selection UI
  • ·Order ID generation and confirmation page
  • ·WhatsApp order-status notifications on state change
VedaGlow

Order Management

Built

Full order lifecycle — order placement, status tracking, admin order views, and customer order history.

  • ·Server-authoritative order placement with verified payment state
  • ·Six-state lifecycle: pending → confirmed → processing → shipped → delivered, plus cancelled
  • ·Admin order list with filtering, search, and status update
  • ·Payment status tracked independently: pending, paid, failed, refunded
  • ·Order notes and internal admin comments
  • ·Guest and account orders share one model
VedaGlow

Coupon & Pricing Engine

Built

Discount codes, percentage and flat discounts, validity windows, minimum order rules, and single-use enforcement.

  • ·Percentage and flat-amount discount types
  • ·Coupon code validation against database
  • ·Minimum order value rules
  • ·Global usage cap enforced via used_count against max_uses
  • ·Validity window (start / expiry dates)
  • ·Admin coupon CRUD and usage tracking
VedaGlow

Admin Dashboard

Built

Product, order, and user management with role-based access, secure authentication, and operational views.

  • ·Product CRUD — create, edit, delete, publish/unpublish
  • ·Order list with status update controls
  • ·Dashboard with operational KPIs
  • ·Role-based access control (admin only)
  • ·Secure admin auth — separate session, httpOnly cookies
  • ·Media management and image uploader
VedaGlowGharBazaarThis Portfolio

Payments & Auth

Payment workflows and user authentication systems

Payment Workflows

Built

Razorpay integration covering order creation, checkout, server-side verification and failure handling — plus a split advance-payment and cash-on-delivery path built for Indian D2C.

  • ·Razorpay order created server-side; the client never sets the amount
  • ·Razorpay Checkout for cards, UPI and netbanking in one integration
  • ·Payment id, order id and signature verified server-side before an order is marked paid
  • ·Payment identifiers and timestamp persisted on the order for reconciliation
  • ·Payment failures surfaced without losing the customer's cart or address
  • ·Cash on delivery and split advance payment as first-class methods
VedaGlow

Payment state is never taken on trust from the browser — the signature is verified on the server before an order is treated as paid.

Authentication & Session Management

Built

Supabase Auth manages customer and admin identity in both products. This portfolio additionally runs a hand-built JWT flow, so I have implemented both the managed and the from-scratch version.

  • ·Supabase Auth for customer sessions in both products
  • ·Guest checkout preserved alongside accounts — signing in is never a purchase gate
  • ·Hand-built JWT with jose, bcrypt hashing and httpOnly cookies in this portfolio
  • ·Role model backed by a user_roles table and an app_role enum
  • ·Shared admin assertion guarding every privileged server function
  • ·Rate limiting on the login endpoint
VedaGlowGharBazaarThis Portfolio

RBAC — Role-Based Access Control

Built

Multi-role system with permission-based route and action gating — separating buyers, sellers, and platform admins.

  • ·Roles: student, seller, dealer and admin
  • ·128 Row-Level Security policies in GharBazaar; 27 in VedaGlow
  • ·Authorization enforced at the database, not only in route handlers
  • ·Role-aware route groups and dashboards per user type
  • ·A forgotten filter returns nothing rather than another user's data
GharBazaarVedaGlow

Refunds & Payment Reconciliation

Learning

Automated refund processing and financial reconciliation on top of a live payment integration.

  • ·Refund initiation and status tracking via the Razorpay refund API
  • ·Idempotency keys to prevent duplicate refund processing
  • ·Reconciling captured payments against order totals
  • ·Partial refunds and store credit

The refunded payment state already exists in the VedaGlow schema; automating the refund path itself is the next step.

Marketplace Systems

Multi-sided platforms — buyers, sellers, and platform operators

Property Marketplace

Built

Listing lifecycle, location-based discovery, university-based student housing search, and multi-role workflows.

  • ·Property listing model — flats, PGs, hostels, shared rooms
  • ·University-property association for student housing discovery
  • ·Location and category-based filtering
  • ·Listing lifecycle: DRAFT → SUBMITTED → APPROVED → LIVE → DEACTIVATED
  • ·Lead management for student inquiry capture
  • ·Seller (owner) and buyer (student) user roles
  • ·Admin moderation and listing approval workflow
GharBazaar

Implemented across 58 tables and 59 API routes, and deployed on Vercel with the database connected. Pre-launch: seller onboarding is still in progress.

Multi-Vendor Architecture

Planned

Vendor isolation, separate catalogs, order routing to correct vendor, commission calculation, and payout systems.

  • ·Vendor data isolation — each vendor manages own catalog
  • ·Order splitting and routing to correct vendor
  • ·Commission calculation and vendor ledger
  • ·Vendor onboarding and KYC workflow
  • ·Vendor-level inventory and fulfillment tracking
  • ·Returns and refunds scoped per vendor
  • ·Financial reconciliation and payout reporting

Data & Search

Product discovery, search, and inventory systems

Database Design

Built

PostgreSQL schema design across a commerce store and a marketplace platform — 68 tables and 155 Row-Level Security policies in total.

  • ·10-table commerce schema on Supabase (VedaGlow), 11 migrations
  • ·PostgreSQL relational schema for marketplace and portfolio
  • ·Relational modeling — normalized with strategic denormalization
  • ·Index design aligned to common query patterns
  • ·Prisma ORM for type-safe, migration-tracked data access
  • ·Soft-delete and audit timestamp patterns
VedaGlowGharBazaarThis Portfolio

REST API Design

Built

Structured, validated, and authenticated REST APIs with consistent response shapes and pagination.

  • ·Resource-based URL structure — /products, /orders, /users
  • ·Zod schema validation on all input payloads
  • ·Consistent success/error response envelope
  • ·Cursor and offset-based pagination for list endpoints
  • ·Authentication middleware — route-level protection
  • ·Request logging and error tracking patterns
VedaGlowGharBazaarThis Portfolio

Inventory Management

Learning

Stock tracking, variant-level inventory, low-stock alerts, and reservation during checkout.

  • ·Stock level tracking per SKU / variant
  • ·Optimistic stock reservation during checkout (with timeout)
  • ·Atomic decrement on order placement
  • ·Low-stock threshold and admin alert
  • ·Inventory audit log — who changed what and when
  • ·Backorder and pre-order handling (planned)

Search & Discovery

Built

Filtered property discovery with saved searches and a nightly job that matches new listings against them.

  • ·Filtering across property type, room type, amenities and area
  • ·Proximity ordering backed by an index on (university_id, computed_distance_m)
  • ·Saved searches persisted per user
  • ·A scheduled alert-matcher pairs new listings against saved searches
  • ·Search events recorded for relevance and zero-result analysis
  • ·Full-text and typo-tolerant search is the next step, not yet built
GharBazaar

Built for property discovery. Product search over a large catalog — relevance tuning, synonyms, typo tolerance — is a different problem I have not yet solved.

AI & Performance

AI-powered features and engineering performance practices

Frontend Performance

Learning

Code splitting, lazy loading, image optimization, caching, and Core Web Vitals engineering.

  • ·React.lazy and dynamic imports for code splitting
  • ·next/image with WebP/AVIF format negotiation
  • ·Bundle size analysis and tree-shaking
  • ·CDN-first deployment via Vercel edge network
  • ·LCP, CLS, INP optimization patterns
  • ·Reduced motion support (prefers-reduced-motion)
VedaGlowThis Portfolio

AI Commerce Engine

Planned

Natural-language product search, semantic recommendations, review summarization, and RAG-based product Q&A.

  • ·Semantic search using vector embeddings
  • ·Hybrid retrieval — keyword + vector (BM25 + ANN)
  • ·LLM-powered product recommendations
  • ·Review summarization and sentiment analysis
  • ·RAG-based product knowledge Q&A
  • ·Personalised ranking using purchase history

Semantic Search / RAG

Planned

Vector database, embedding generation, and retrieval-augmented generation for commerce queries.

  • ·Embedding generation — OpenAI text-embedding-3 or Cohere
  • ·Vector storage — Pinecone or pgvector
  • ·Retrieval-augmented generation pipeline
  • ·Hybrid retrieval (BM25 + approximate nearest neighbour)
  • ·Re-ranking layer for result quality

Advanced Commerce

Order operations, returns, and marketplace financials

Analytics & Reporting

Built

First-party event capture across the listing funnel, plus platform performance monitoring.

  • ·Listing events captured across eight types: view, gallery open, contact reveal, WhatsApp click, call click, share, favourite and visit request
  • ·Search events recorded separately for query analysis
  • ·Contact reveals stored in their own table, making the funnel step countable
  • ·Vercel Analytics and Speed Insights instrumented
  • ·Reporting dashboards over this data are not built yet
GharBazaar

The event capture is built and the data model supports funnel analysis. Turning it into admin-facing dashboards is still ahead.

Engineering Insights

What real builds taught me.

Specific lessons from VedaGlow and GharBazaar — things I didn't understand until I built them.

Never trust the browser about money

VedaGlow

A payment confirmation arriving from client-side code proves nothing — anything the browser sends can be forged. Verifying the Razorpay signature on the server before marking an order paid is the line between a payment system and a hopeful one. Building that in VedaGlow changed how I think about every client-supplied value.

Payment method is a market decision

VedaGlow

Card-first checkout underperforms in Indian D2C. Cash on delivery converts, but exposes the seller to refused deliveries. Splitting the difference — a small advance captured online, balance on delivery — took real design work and did more for conversion than any UI change I made.

Authorization belongs in the database

GharBazaar

With four roles and 58 tables, enforcing access only in route handlers means every new endpoint is a fresh chance to leak someone's KYC document. Moving the rules into 128 Row-Level Security policies changed the failure mode: a forgotten filter now returns nothing instead of returning another user's data.

Derived data should be computed by the database

GharBazaar

Campus distance is the entire product promise, so it cannot be something a seller types in. Making it a PostGIS value computed by a trigger — and recomputed whenever a property's pin moves — removed a whole class of drift bugs that application-side calculation would have kept reintroducing.

Cart state is harder than it looks

VedaGlow

Persistence across refreshes, price changes while an item sits in the cart, coupon eligibility recalculated on every mutation — each is a distinct edge case. Persisting locally keeps guest checkout frictionless, but only because totals and line items are re-validated server-side before an order exists.

Tests changed the schema, not just the code

GharBazaar

Several Row-Level Security gaps in GharBazaar surfaced because a test asserted a user could not read something and it turned out they could. Writing the tests alongside the features caught design problems, not just regressions.

Engineering Philosophy

How I think about commerce systems.

Real problems over perfect code

Commerce systems need to work reliably under real-world conditions — incomplete data, edge cases, user errors. I prioritize correctness and resilience over technical elegance.

Honest about what I haven't built yet

There's a lot I'm still learning. The most dangerous engineer is one who overstates their experience. I clearly separate what I've shipped, what I'm studying, and what's planned.

The full stack matters

eCommerce is a full-stack problem. UX, API design, data modeling, and deployment all affect the outcome. I care about every layer because they're all part of the user's experience.

Commerce is a systems problem

Great eCommerce is not about features — it's about systems. Catalog, cart, checkout, payments, orders, and inventory are all interconnected. Understanding how they compose is what separates a developer from a commerce engineer.

See it in practice.

The best way to evaluate my commerce engineering is to read the actual case studies — architectural decisions, challenges, and tradeoffs.