Project Structure
An overview of the entire directory structure and description of each component in the Multi-Region Shopping Mall project.
Overall Structure Overview
multi-region-architecture/
├── src/ # Microservices source code
├── terraform/ # Infrastructure code (IaC)
├── k8s/ # Kubernetes manifests
├── scripts/ # Utility scripts
├── docs/ # Architecture documentation
├── webpage/ # Docusaurus documentation site
└── .github/workflows/ # CI/CD pipelines
src/ - Microservices
20 microservices organized by domain.
src/
├── shared/ # Shared libraries
│ ├── go/ # Go common packages
│ │ └── pkg/
│ │ ├── kafka/ # Kafka producer/consumer
│ │ ├── region/ # Region-aware middleware
│ │ ├── tracing/ # OpenTelemetry setup
│ │ └── health/ # Health check utilities
│ ├── java/ # Java common libraries
│ │ └── mall-common/
│ │ └── src/main/java/com/mall/common/
│ │ ├── kafka/
│ │ ├── region/
│ │ └── tracing/
│ └── python/ # Python common packages
│ └── mall_common/
│ ├── kafka.py
│ ├── region.py
│ └── tracing.py
│
├── api-gateway/ # [Go] API routing, authentication, rate limiting
├── event-bus/ # [Go] Kafka event routing
├── cart/ # [Go] Shopping cart (Valkey cache)
├── search/ # [Go] Product search (OpenSearch)
├── inventory/ # [Go] Inventory management (Aurora)
│
├── order/ # [Java] Order processing (Saga pattern)
├── payment/ # [Java] Payment processing
├── user-account/ # [Java] Authentication, session management
├── warehouse/ # [Java] Warehouse allocation
├── returns/ # [Java] Returns processing
├── pricing/ # [Java] Dynamic pricing, promotions
├── seller/ # [Java] Seller portal
│
├── product-catalog/ # [Python] Product CRUD (DocumentDB)
├── shipping/ # [Python] Shipping tracking
├── user-profile/ # [Python] User profiles
├── recommendation/ # [Python] ML recommendations
├── wishlist/ # [Python] Wishlist (Valkey)
├── analytics/ # [Python] Event analytics
├── notification/ # [Python] Notifications (email, SMS, push)
└── review/ # [Python] Product reviews
Languages and Frameworks by Service
Service Structure Patterns
Go Service Structure
src/cart/
├── cmd/
│ └── main.go # Entry point
├── internal/
│ ├── handler/ # HTTP handlers
│ │ └── cart_handler.go
│ ├── service/ # Business logic
│ │ └── cart_service.go
│ ├── repository/ # Data access
│ │ └── cart_repository.go
│ └── middleware/ # Middleware
│ └── auth.go
├── go.mod
├── go.sum
├── Dockerfile
└── AGENTS.md
Java Service Structure
src/order/
├── src/main/java/com/mall/order/
│ ├── OrderApplication.java # Spring Boot main
│ ├── controller/
│ │ └── OrderController.java
│ ├── service/
│ │ ├── OrderService.java
│ │ └── impl/
│ │ └── OrderServiceImpl.java
│ ├── repository/
│ │ └── OrderRepository.java
│ ├── entity/
│ │ └── Order.java
│ ├── dto/
│ │ ├── OrderRequest.java
│ │ └── OrderResponse.java
│ └── config/
│ └── KafkaConfig.java
├── src/main/resources/
│ └── application.yml
├── build.gradle
├── Dockerfile