Back to Projects

Single Vendor E-Commerce — Microservices Architecture

Node.jsNestJSTypeScriptPostgreSQLMongoDBRedisNextJSRedisDockerSocket.io

About this Project

A scalable, niche-agnostic e-commerce engine built on a microservices backend.  

This project is a single-vendor e-commerce platform designed not for one specific niche, but as a reusable commerce engine — flexible enough to power a fashion store, an electronics shop, a beauty brand, or a grocery business, all with the same underlying architecture.


The core focus wasn't just "build an online store" — it was build a scalable, service-oriented system that could grow without collapsing under its own complexity.

Why Microservices?

A typical monolithic e-commerce app works fine at small scale, but breaks down when:


  • Product catalog logic starts mixing with cart/session logic

  • Inventory updates need to stay consistent under order load

  • Different teams need to work on different domains independently


So instead, I split the backend into independent, purpose-built services, connected through an API Gateway.

Backend Services

Service

Responsibility

api-gateway

Central routing, public API access

user-service

Authentication, users, account logic

product-service

Product catalog management

cart-service

Shopping cart behavior via Redis

inventory-service

Stock and inventory validation

order-service

Order creation, processing, payments

Core Features

Customer Experience


  • Product browsing, search, and detail pages

  • Redis-powered cart for fast, session-based shopping

  • Full checkout and order flow

  • Authenticated customer accounts


Store Management


  • Product creation and inventory tracking

  • Order management and sales monitoring

  • Admin-friendly dashboards

  • Brand/storefront customization support

Tech Stack

Layer

Technology

Backend

Node.js, NestJS, TypeScript

Database

PostgreSQL, MongoDB (per-service)

Cache/Cart

Redis

Frontend

Next.js, React, TypeScript, Tailwind

Infra

Docker, Docker Compose

Architecture

Microservices + API Gateway

🧩 Key Engineering Decisions

  • Service isolation: Each domain (users, products, cart, orders, inventory) is independently deployable and scalable

  • Redis for cart: Chosen for speed and to avoid unnecessary database writes during active shopping sessions

  • Shared protocol definitions: Used for consistent internal service-to-service communication

  • Docker Compose orchestration: For reproducible local development matching production topology






This project was built to sharpen my understanding of distributed system design — service boundaries, inter-service communication, and building a backend that can genuinely scale, not just run.



© 2026 Mehraj Hosen. All rights reserved.