Case study · 2026
BH Shop Microservices E-commerce Platform
A distributed e-commerce platform built with Next.js, Docker, and Apache Kafka, featuring event-driven microservices for scalable order, payment, and inventory management

Overview
BH Shop is an enterprise-grade, distributed e-commerce platform designed to decouple core shopping functionalities into resilient microservices . The system provides dedicated Customer Storefront and Admin Management web apps built with Next.js and Shadcn/ui . Core domains—including User Auth, Product Catalog, Order Processing, Payment Gateway, and Email Notifications—communicate asynchronously over an Apache Kafka event bus to ensure high availability and horizontal scalability .
Problem
Traditional monolithic e-commerce platforms struggle under peak traffic spikes due to tight coupling between payment processing, inventory locks, and notification dispatches. Synchronous HTTP calls across services often lead to cascading timeouts, slow checkout experiences, and single points of failure.
My role
As the Lead Fullstack Developer & System Architect, I designed the event-driven microservices architecture using Apache Kafka. I built the customer and admin applications with Next.js & Shadcn/ui, implemented Clerk RBAC authentication , orchestrated Docker containerization, and set up database schemas across PostgreSQL & MongoDB.
System Architecture & Core Concept
BH Shop was designed from the ground up to solve the scalability bottlenecks of traditional e-commerce monoliths. By separating front-facing customer interactions from backend order workflows, the system achieves near-zero downtime and independent service scalability.
Key Architectural Pillars
- Asynchronous Message Bus — Apache Kafka acts as the central nervous system, handling message queues for order.created, payment.completed, and email.dispatched events.
- Service Isolation with Docker — Every microservice (Auth, Product, Order, Payment, Notification) is isolated in its own Docker container with independent database instances.
- Monorepo Developer Experience — Managed via TurboRepo, allowing shared UI component libraries (Shadcn/ui) and unified TypeScript types across Customer and Admin applications.
// Example Kafka Event Producer for Order Checkout Workflow
export async function handleOrderCheckout(orderData: OrderPayload) {
const event = {
eventType: "ORDER_CREATED",
payload: {
orderId: orderData.id,
userId: orderData.userId,
amount: orderData.totalAmount,
timestamp: new Date().toISOString(),
},
};
await kafkaProducer.send({
topic: "order-events",
messages: [{ key: orderData.id, value: JSON.stringify(event) }],
});
}Security & Authentication
Role-Based Access Control (RBAC) is enforced at both the API Gateway and frontend route levels using Clerk. Customer accounts are isolated from administrative functions, ensuring that sensitive store management endpoints remain protected against unauthorized access.
