Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/astrxnomo/shop-microservers/llms.txt

Use this file to discover all available pages before exploring further.

Shop Microservers is a full-stack e-commerce platform that demonstrates a production-grade microservices architecture. The system is composed of four independent backend services — auth, catalog, cart, and orders — each owning its own data store, exposed through a single Nginx reverse-proxy gateway, and paired with a Next.js 15 frontend. Every component is containerized and wired together with Docker Compose, so you can spin up the entire platform with a single command and explore how real-world services communicate, authenticate, and share data without being tightly coupled.

Services at a glance

The platform is divided into four backend microservices, each with a single, well-defined responsibility:
  • Auth handles user registration and login, issuing signed JWTs that every other protected service validates.
  • Catalog manages the product inventory, exposing endpoints to list products and adjust stock levels. It auto-seeds 12 products on first boot.
  • Cart provides a per-user ephemeral shopping cart backed by Redis, with a 7-day TTL. No database migration required — carts live and expire in memory.
  • Orders implements the checkout flow: it verifies available stock against the catalog, decrements it, persists the order to PostgreSQL, and clears the user’s cart — all in a single coordinated operation.

Nginx gateway

All external traffic enters the system through a single Nginx gateway listening on port 80. The gateway routes requests to the correct upstream service based on URL prefix, strips the prefix before forwarding, and passes real client IP headers downstream. The frontend route additionally supports WebSocket upgrades, enabling Next.js hot-module replacement in development. No service is directly accessible from outside the Docker network.

Next.js frontend

The frontend is a Next.js 15 application using the App Router. It communicates exclusively through the Nginx gateway — never directly with any backend service — and stores the user’s JWT in localStorage. It is built with React 19, styled with Tailwind CSS, and uses Radix UI primitives for accessible component composition.

Routing table

PathServiceInternal portResponsibility
/api/auth/auth3004Registration, login, JWT issuance
/api/catalog/catalog3001Product listing and stock management
/api/cart/cart3002Per-user ephemeral cart (Redis, 7-day TTL)
/api/orders/orders3003Checkout: verify stock → decrement → persist order → clear cart
/frontend3000Next.js App Router SPA

Explore the services

Auth Service

User registration, login, and JWT issuance backed by PostgreSQL.

Catalog Service

Product listing, stock management, and automatic seeding.

Cart Service

Ephemeral per-user cart stored in Redis with a 7-day TTL.

Orders Service

Checkout orchestration across catalog, cart, and the orders database.

Nginx Gateway

Single public entry point routing all traffic by URL prefix.

Frontend

Next.js 15 App Router SPA communicating through the gateway.

Tech stack

LayerTechnologies
BackendNode.js, TypeScript, Express, Prisma
FrontendNext.js 15, React 19, Tailwind CSS, Radix UI
DatabasesPostgreSQL 16, Redis 7
GatewayNginx
OrchestrationDocker Compose

Build docs developers (and LLMs) love