
ecommerce-microservices is a production-grade, cloud-native e-commerce platform built with a microservice architecture. It consists of 13 Spring Boot 3 backend services, an Apache APISIX API Gateway, a Next.js 16 frontend, and a full suite of infrastructure β all deployable on Kubernetes (k3d) with a single command.
| β‘ Backend | 13 microservices Β· Java 21 Β· Spring Boot 3.3.5 |
| πͺ Gateway | Apache APISIX 3.9 Β· Rate limiting Β· JWT validation |
| ποΈ Databases | PostgreSQL 16 Β· Redis 7 Β· Elasticsearch 8 |
| π¨ Messaging | Apache Kafka 3.9 (KRaft mode, no Zookeeper) |
| π Auth | Keycloak 26 Β· OAuth2 / OIDC Β· JWT |
| βοΈ Storage | RustFS (S3-compatible) |
| π³ Deploy | Docker Compose Β· k3d / Kubernetes Β· ArgoCD |
| Runtime | Java 21 (Virtual Threads) |
| Framework | Spring Boot 3.3.5, Spring Security 6, Spring Data JPA |
| Database | PostgreSQL 16, Liquibase migrations |
| Search | Elasticsearch 8, Spring Data Elasticsearch |
| Messaging | Apache Kafka 3.9 (KRaft), Spring Kafka |
| Security | Keycloak 26, OAuth2 / OIDC, JWT, Spring Security Resource Server |
| Gateway | Apache APISIX 3.9 (OpenID Connect, rate limiting, CORS) |
| Storage | RustFS (S3-compatible), AWS SDK v2 |
| Observability | Micrometer, Prometheus, Spring Boot Actuator |
| API Docs | Springdoc OpenAPI 3, Swagger UI w/ PKCE |
| Resilience | Resilience4j (circuit breaker, retry) |
| Build | Maven, Jib (Dockerless containerization) |
| Framework | Next.js 16.2, React 19.2 |
| State | Zustand 5, TanStack Query 5 |
| Styling | Tailwind CSS 4, Lucide icons |
| HTTP | Axios |
| Local K8s | k3d (K3s in Docker), NGINX Ingress Controller |
| Production | Kubernetes, ArgoCD (GitOps) |
| Registry | GitHub Container Registry (ghcr.io) |
| CI | GitHub Actions, SonarCloud |
- Docker Desktop (macOS / Windows) or Docker Engine (Linux)
- 8 GB+ RAM allocated to Docker
git clone https://github.com/hoangtien2k3/ecommerce-microservices.git
cd ecommerce-microservices
bash start-ecommerce.shThe script automatically:
- Installs k3d and kubectl (if missing)
- Creates a local Kubernetes cluster
- Deploys NGINX Ingress Controller
- Applies secrets, config maps, and infrastructure (PostgreSQL, Redis, Kafka, Elasticsearch, RustFS, Keycloak)
- Deploys APISIX gateway + all 13 backend services + frontend
- Updates
/etc/hosts
Wait ~5 minutes for all pods to become ready:
kubectl get pods -n ecommerce -w| Service | URL |
|---|---|
| π Frontend | http://ecommerce.local |
| πͺ API Gateway | http://api.ecommerce.local |
| π Keycloak Admin | http://keycloak.ecommerce.local |
| π¦ RustFS Console | http://rustfs.ecommerce.local/rustfs/console |
ecommerce-microservices/
βββ auth-service/ # Port 8088
βββ common-lib/ # Shared library
β βββ common-core/ # Contracts, exceptions, i18n
β βββ common-spring/ # Auto-configurations
β βββ common-security/ # JWT / OAuth2 security
β βββ common-keycloak/ # Keycloak admin client
β βββ common-kafka/ # Kafka / CDC helpers
β βββ common-logging/ # AOP performance logging
β βββ common-storage/ # S3 object storage abstraction
βββ deploy/
β βββ apisix/ # APISIX standalone config
βββ docker/
β βββ keycloak/import/ # Keycloak realm configuration
β βββ postgres/init/ # Database creation scripts
βββ docker-compose.yml # Full-stack local orchestration
βββ favourite-service/ # Port 8081
βββ frontend/ # Next.js 16 application
βββ inventory-service/ # Port 8082
βββ k3d-config.yaml # k3d cluster definition
βββ k3d-setup.sh # One-shot K8s deployment script
βββ k8s/ # Kubernetes manifests
β βββ argocd/ # ArgoCD GitOps configurations
β βββ backend/ # 13 service deployments
β βββ frontend/ # Frontend deployment
β βββ gateway/ # APISIX Ingress CRDs
β βββ infra/ # Infrastructure deployments
β βββ ingress/ # NGINX Ingress rules
β βββ configmap.yaml
β βββ namespace.yaml
β βββ secrets.yaml
βββ Makefile # Build & deploy automation
βββ media-service/ # Port 8083
βββ notification-service/ # Port 8090
βββ order-service/ # Port 8084
βββ payment-service/ # Port 8085
βββ pom.xml # Parent POM
βββ product-service/ # Port 8086
βββ promotion-service/ # Port 8093
βββ rating-service/ # Port 8089
βββ search-service/ # Port 8094
βββ shipping-service/ # Port 8087
βββ start-ecommerce.sh # Entry point
βββ tax-service/ # Port 8091
Every service exposes:
- Health:
/actuator/health(liveness + readiness on port 9000) - Metrics:
/actuator/prometheus(Micrometer + Prometheus) - Distributed Tracing: Correlation ID (
X-Correlation-Id) propagated across all services - APISIX Metrics: Prometheus metrics on port 9091
If you would like to contribute to the development of this project, please follow our contribution guidelines.
MIT License
Copyright (c) 2026 HoΓ ng Anh TiαΊΏn