How realatul/retail-store-sample-app works
Project Type & Purpose
This is a full-stack, microservices-based sample retail application. It comprises five independently-deployable containerized services (UI, Catalog, Cart, Orders, Checkout) running on Amazon EKS, managed via GitOps (ArgoCD) and deployed with Infrastructure-as-Code (Terraform).
High-Level File Structure & Architectural Patterns
• src/ui, src/catalog, src/cart, src/orders, src/checkout – each is a microservice, containing:
– Dockerfile & Helm chart (chart/ templates + values.yaml)
– Source code in Java (Spring Boot), Go, or Node (NestJS)
• src/app/chart – umbrella Helm chart for deploying all services together
• argocd/ – ArgoCD Application & Project manifests (retail-store-project)
• terraform/ – AWS infrastructure modules (VPC, EKS cluster, IAM, ArgoCD, ingress, cert-manager)
• CI/CD: GitHub Actions (trigger build → push to ECR → ArgoCD sync)
Architectural patterns:
– Microservices with language-agnostic APIs
– Kubernetes & Helm for container orchestration
– GitOps (ArgoCD) for continuous deployment
– IaC (Terraform) for provisioning AWS resources
– Service mesh (Istio) used by UI for routing (gateway + virtualservice)
Main Components
A. AWS VPC
• Public & private subnets
• Security groups, NAT gateways, Internet gateway
B. Amazon EKS Cluster
• Worker nodes (Auto Scaling groups)
• cert-manager, NGINX Ingress Controller, Istio Gateway
C. GitOps Platform
• ArgoCD control plane running in “argocd” namespace
D. CI/CD Pipeline
• GitHub Actions → Docker build → Amazon ECR → GitOps branch ←→ ArgoCD
E. Microservices (each in its own namespace “retail-store”)
1. UI Service (Java/Spring Boot + Thymeleaf)
2. Catalog Service (Go + MySQL StatefulSet)
3. Cart Service (Java + DynamoDB)
4. Orders Service (Java + PostgreSQL + RabbitMQ/SQS)
5. Checkout Service (Node/NestJS + Redis + external shipping/orders clients)
• Each service exposes a REST/gRPC API and is fronted by its own Kubernetes Service object
• Helm charts define Deployments, Services, ConfigMaps, Secrets, HPA, PDB
F. Data Stores & Messaging
• Amazon DynamoDB table for Cart
• Amazon RDS (MySQL) for Catalog
• Amazon RDS (PostgreSQL) for Orders + Flyway migrations
• Messaging: RabbitMQ or Amazon SQS for order events
• Redis for Checkout session/state
Relationships & Data Flows
• User → HTTPS → NGINX Ingress / Istio Gateway → UI Service
• UI → REST API calls → Catalog, Cart, Checkout, Orders endpoints
• Checkout → orchestrates calls: reads Cart, reserves inventory via Catalog, writes Order, enqueues events, writes to Redis, calls external shipping API
• Orders → persists to PostgreSQL, publishes/consumes events via messaging (RabbitMQ/SQS)
• ArgoCD continuously watches Git repos (umbrella & per-service Helm values) → applies to Kubernetes
• Terraform provisions & tears down all above AWS resources
Architectural Patterns & Principles
• Microservices: services are loosely coupled, independently deployable
• Twelve-Factor App: externalize config via ConfigMaps/Secrets, stateless services
• GitOps: declarative infra & app manifests in Git, ArgoCD enforces live state
• IaC: Terraform modules for VPC, EKS, IAM, ingress, ArgoCD
• Helm for packaging & templating Kubernetes resources
• Service Mesh (Istio) for advanced routing/observability