R
0

Commerce Architecture

Commerce Stack

From catalog to checkout, I build systems that connect the entire commerce lifecycle. This page maps how modern commerce systems work — and which ones I've built.

Built
In Development
Learning
Planned

System Architecture

How the systems connect.

Each module is a self-contained system. Hover to see connections. Click for engineering details.

Core Systems

The building blocks of commerce.

Nine core systems that every commerce platform needs. Each one has its own data model, business rules, and engineering challenges.

Product Catalog

Built — VedaGlow

Source of truth for products, variants, attributes and availability.

Products & categories
Variants / SKUs
Attributes & specifications
Pricing & price lists
+2 more

Search & Discovery

Built — GharBazaar

How customers find what they need — search, filters, and recommendations.

Full-text product search
Faceted filtering
Category navigation
Sort & relevance ranking
+1 more

Cart Engine

Built — VedaGlow

Manages shopping sessions — items, quantities, pricing, and state.

Add / remove / update items
Quantity validation
Real-time price calculation
Coupon application
+2 more

Checkout Flow

Built — VedaGlow

Guides the customer from cart to confirmed order.

Address collection & validation
Shipping method selection
Order summary & confirmation
Final price calculation
+2 more

Payment Gateway

Built — VedaGlow

Processes payments securely — charges, refunds, and reconciliation.

Payment processing
Multiple payment methods
Refund handling
Payment status tracking
+2 more

Order Management

Built — VedaGlow

Tracks orders from placement through fulfillment to completion.

Order creation & confirmation
Order status tracking
Fulfillment coordination
Order history
+2 more

Inventory System

Learning

Tracks stock levels, reservations, and availability in real time.

Stock level tracking
Inventory reservations
Low stock alerts
Stock adjustments
+2 more

Pricing & Coupons

Built — VedaGlow

Calculates prices, applies discounts, and enforces promotion rules.

Base price management
Discount rules & tiers
Coupon code validation
Promotion scheduling
+2 more

Admin & Operations

Built — VedaGlow + GharBazaar

Back-office tools for managing the entire commerce system.

Product CRUD
Order processing & management
Inventory adjustments
Customer management
+2 more

Customer Journey

From discovery to fulfillment.

Every commerce interaction follows a path. Understanding this journey shapes how each system is designed.

01Discover

Customer finds the store through search, ads, or direct visit.

search discoveryproduct catalog
02Evaluate

Browses products, reads details, compares options.

product catalogsearch discovery
03Add to Cart

Selects products, chooses variants, adds to shopping cart.

cart engineinventory systempricing engine
04Checkout

Provides shipping info, selects payment, reviews order.

checkout flowpricing engineauth
05Payment

Completes payment securely through the payment gateway.

payment gatewaycheckout flow
06Order

Order is confirmed, tracked, and prepared for fulfillment.

order managementnotificationsinventory system
07Fulfillment

Order is picked, packed, shipped, and delivered.

order managementinventory systemnotifications
08Returns

Customer initiates return, refund is processed.

returns refundspayment gatewayinventory system

Engineering Challenges

The hard problems in commerce.

Commerce systems deal with real money, real inventory, and real customers. These are the engineering challenges that separate toy projects from production systems.

Inventory Overselling

Multiple customers buying the last item simultaneously. Requires atomic operations and pessimistic locking strategies.

inventory systemcart enginecheckout flow

Payment Idempotency

Network failures during payment must never result in double charges. Every payment operation needs idempotency keys.

payment gatewaycheckout flow

Pricing Consistency

Price shown in catalog must match cart, checkout, and the final charge. Server-side price authority is essential.

pricing engineproduct catalogcart enginecheckout flow

Coupon Race Conditions

Single-use coupons redeemed simultaneously by multiple users. Requires atomic validation and redemption.

pricing enginecart engine

Order State Management

Orders move through complex state transitions. Invalid transitions must be prevented and every change audited.

order management

Refund Handling

Partial refunds, inventory restocking, and payment gateway coordination must all succeed or fail together.

returns refundspayment gatewayinventory system

Database Consistency

Cross-collection operations (order + inventory + payment) need transaction guarantees to prevent data corruption.

order managementinventory systempayment gateway

Search Scalability

Full-text search with faceted filtering must remain fast as the catalog grows. Indexing strategy is critical.

search discoveryproduct catalog

Authentication Security

Session management, token rotation, CSRF protection, and secure password storage across customer and admin contexts.

authadmin operations

Cache Invalidation

Product and pricing caches must invalidate correctly on updates. Stale prices in cart or checkout break trust.

product catalogpricing engine

Architecture

How the layers connect.

A modern commerce platform is built in layers. Each layer has clear responsibilities and communicates through defined interfaces.

Frontend

Server-rendered React with client interactivity where needed.

Next.js 16TanStack StartReact 19TypeScriptTailwind CSS v4

API Layer

RESTful API routes with validation, rate limiting, and auth middleware.

Route HandlersServer FunctionsZod ValidationAuth Middleware

Business Logic

Domain-specific logic for pricing, inventory, orders, and payments.

Pricing EngineInventory ManagementOrder State MachinePayment Processing

Data Layer

Database access with ORM, transactions, and query optimization.

PostgreSQLSupabaseRow-Level SecurityPostGISSQL Migrations

External Services

Third-party integrations for payments, media, and delivery.

RazorpaySupabase StorageWhatsAppGoogle Maps

My Experience

Where I've applied these systems.

This page represents my commerce engineering knowledge and architecture thinking. Where something comes from an actual project, it's clearly identified.

VedaGlow

Built

D2C skincare store built end to end — catalog, cart, checkout, Razorpay payments, order lifecycle and admin.

Systems Implemented

Product CatalogCart EngineCheckout FlowPayment GatewayOrder ManagementPricing & CouponsCustomer AccountsAuthenticationNotificationsAdmin & Operations

GharBazaar

In Development

Property marketplace with PostGIS university-proximity search, tiered KYC and 128 row-level security policies.

Systems In Development

Search & DiscoveryAuthenticationAdmin & OperationsNotificationsAnalytics

Engineering Principles

How I think about commerce systems.

These are the principles I follow when building commerce software. They come from building real products and learning from real mistakes.

Server-Side Source of Truth

All critical calculations — pricing, inventory, discounts — happen server-side. The client displays, the server decides.

Secure Payments

Payment processing follows gateway best practices. No raw card data touches the server. Webhooks are verified.

Idempotent Operations

Every write operation can be safely retried. Network failures never cause duplicate charges or orders.

Consistent Inventory

Stock operations use atomic updates. Reservations have timeouts. Overselling is prevented at the database level.

Validated Inputs

Every API endpoint validates input with Zod schemas. Invalid data is rejected before it reaches business logic.

Proper Authorization

Role-based access control on every protected route. Admin operations require elevated permissions.

Observable Systems

Structured logging, error tracking, and audit trails make debugging production issues possible.

Performance-First UX

Server-side rendering, optimistic updates, and strategic caching keep the experience fast for customers.

Maintainable Architecture

Clear separation of concerns. Business logic isolated from framework code. Easy to test, easy to change.

See It in Action

Want to see these systems in a real product?

These aren't theoretical concepts — they're patterns I've built, debugged, and shipped.