
🛒 Retail & E-commerce · C4 Architecture · Pro
An online store split into microservices: catalog, cart, orders, payments and search, with Kafka events connecting them to shipping and notifications.
C4 Architecture diagrams are part of Pro. Anyone can view this one; generating and editing it needs Pro.
Drawing diagram…
An e-commerce platform with a React web app and a mobile app calling an API gateway. Behind it are catalog, search, cart, order and payment microservices. Catalog uses PostgreSQL, search uses Elasticsearch, cart uses Redis. Orders publish events to Kafka, which the shipping service and the notification service consume. Payments go to an external payment gateway.
C4Container
title E-commerce Platform
Person(shopper, "Shopper", "Browses and buys")
System_Boundary(shop, "Online Store") {
Container(web, "Web Store", "React", "Browse, cart, checkout")
Container(gw, "API Gateway", "Node.js", "Auth and routing")
Container(catalog, "Catalog Service", "Java", "Products and prices")
Container(cart, "Cart Service", "Go", "Shopping carts")
Container(orders, "Order Service", "Java", "Orders and status")
ContainerDb(cartdb, "Cart Store", "Redis", "Active carts")
ContainerDb(orderdb, "Order DB", "PostgreSQL", "Orders")
ContainerQueue(kafka, "Events", "Kafka", "Order events")
Container(ship, "Shipping Service", "Node.js", "Courier bookings")
}
System_Ext(pay, "Payment Gateway", "Cards and UPI")
Rel(shopper, web, "Uses")
Rel(web, gw, "Calls", "HTTPS")
Rel(gw, catalog, "Routes")
Rel(gw, cart, "Routes")
Rel(gw, orders, "Routes")
Rel(cart, cartdb, "Stores")
Rel(orders, orderdb, "Stores")
Rel(orders, pay, "Charges")
Rel(orders, kafka, "Publishes")
Rel(kafka, ship, "Consumed by")What happens when a shopper clicks Pay: stock is reserved, the payment is authorised, the order is created and stock is released again if payment fails.
Every status an online order moves through, from placed to delivered, including cancellations, returns and refunds.
A flexible product catalog: categories, products with variants (size, colour), prices, stock per warehouse and images.
How stock stays in sync across stores, warehouses and marketplaces so the same item isn't sold twice.
How an online store handles a return: eligibility, pickup, quality check at the warehouse and the refund or replacement.
How an online store builds 'recommended for you' and 'frequently bought together': click and order data, model training and a fast serving layer.