A simple microservices-based shopping application built with .NET 9, demonstrating containerization and Kubernetes deployment patterns.
- Shopping.API: RESTful API service for product management using MongoDB
- Shopping.Client: MVC web application for product display
- MongoDB: NoSQL database for product storage
graph TB
User[👤 User] --> LB[⚖️ Load Balancer]
subgraph "Azure Kubernetes Service (AKS)"
LB --> ClientSvc[🌐 Shopping Client Service<br/>Port 80]
LB --> APISvc[🔗 Shopping API Service<br/>Port 80]
subgraph "Worker Nodes"
subgraph "Node 1"
ClientSvc --> ClientPod[📱 Shopping Client Pod<br/>ASP.NET Core MVC]
APISvc --> APIPod[🔧 Shopping API Pod<br/>ASP.NET Core Web API]
end
subgraph "Node 2"
APISvc --> APIPod2[🔧 Shopping API Pod<br/>Replica]
DBSvc[🗄️ MongoDB Service<br/>Port 27017] --> DBPod[📊 MongoDB Pod<br/>Database Storage]
end
end
end
subgraph "External Services"
ACR[📦 Azure Container Registry<br/>Container Images]
DevOps[🚀 Azure DevOps<br/>CI/CD Pipelines]
end
APIPod --> DBSvc
APIPod2 --> DBSvc
ClientPod -.->|HTTP Calls| APISvc
DevOps -.->|Deploy| ClientPod
DevOps -.->|Deploy| APIPod
ACR -.->|Pull Images| ClientPod
ACR -.->|Pull Images| APIPod
classDef userClass fill:#e1f5fe
classDef serviceClass fill:#f3e5f5
classDef podClass fill:#e8f5e8
classDef dbClass fill:#fff3e0
classDef externalClass fill:#fce4ec
class User userClass
class ClientSvc,APISvc,DBSvc serviceClass
class ClientPod,APIPod,APIPod2,DBPod podClass
class ACR,DevOps externalClass
# Clone the repository
git clone https://github.com/miguelbtcode/shopping-microservices-k8s.git
cd shopping-microservices-k8s
# Run with Docker Compose
docker-compose up -d
Access the application:
- Web App: http://localhost:8001
- API Swagger: http://localhost:8000/swagger
# Deploy to local Kubernetes
kubectl apply -f k8s/
# Deploy to Azure Kubernetes Service (AKS)
kubectl apply -f aks/
- .NET 9 - Latest .NET framework
- ASP.NET Core - Web framework
- MongoDB - NoSQL database
- Docker - Containerization
- Kubernetes - Container orchestration
- Azure DevOps - CI/CD pipelines
- Azure Container Registry - Container registry
Shopping/
├── Shopping.API/ # Product API service
├── Shopping.Client/ # MVC web application
├── docker-compose.yaml # Local development setup
aks/ # Azure Kubernetes manifests
k8s/ # Local Kubernetes manifests
pipelines/ # Azure DevOps pipelines
The application uses environment-specific configurations:
- Development: Uses local MongoDB connection
- Production: Configured for Azure/cloud deployment
GET /product
- Retrieve all products
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Author: Miguel Barreto
Year: 2025