Ozymandros/ERP.Microservices

ERP Microservices solution with Aspire and Dapr

C#

0

475 commits

updated Sep 24, 2026

See the code

README

ERP Microservices

.NET 10 Aspire Dapr Azure Docker Microservices License: MIT

A cloud-native ERP system built with .NET 10, Aspire, Dapr, and deployed to Azure Container Apps.

🎯 Status Dashboard

MetricStatus
BuildBuild Status
TestsTests
CoverageCoverage
Code QualityQuality Gate
SecuritySecurity
CodeQLCodeQL
DeploymentDeploy

🚀 Features

  • Microservices Architecture: 6 independent services (Auth, Billing, Inventory, Orders, Purchasing, Sales)
  • API Gateway: YARP-based reverse proxy with external HTTPS ingress
  • Dapr Integration: Service invocation, pub/sub, and state management
  • Azure Container Apps: Production-ready deployment with auto-scaling
  • Local Development: Full stack runs locally with Aspire and Docker
  • CI/CD Ready: GitHub Actions workflow included

📋 Architecture

Services

ServiceResponsibilityDatabase
AuthAuthentication & AuthorizationAuthDB
BillingInvoice and billing managementBillingDB
InventoryStock and warehouse managementInventoryDB
OrdersOrder processingOrderDB
PurchasingProcurement managementPurchasingDB
SalesSales operationsSalesDB

Infrastructure

  • Gateway: External HTTPS endpoint, routes to internal services
  • Azure SQL: One database per microservice
  • Azure Redis: Shared distributed cache
  • Dapr: Service mesh for microservices communication
  • Container Apps: Managed Kubernetes-based hosting

🏃 Quick Start

Local Development

# Prerequisites: .NET 10 SDK, Docker
cd AppHost
dotnet run

The Aspire dashboard will open automatically showing all services.

Deploy to Azure

# Prerequisites: Azure Developer CLI (azd)
azd up

See QUICKSTART.md for detailed 5-minute deployment guide.

📚 Documentation

Browse the complete documentation site at https://ozymandros.github.io/ERP.Microservices/ (generated with DocFX)

🛠️ Technology Stack

  • .NET 10: Latest .NET framework
  • Aspire: Cloud-native orchestration for local development
  • Dapr: Distributed application runtime
  • Azure Container Apps: Managed container hosting
  • Azure SQL Database: Relational database
  • Azure Cache for Redis: Distributed caching
  • Entity Framework Core: ORM
  • Ocelot: API Gateway
  • JWT: Authentication

🏗️ Project Structure

ERP.Microservices/
├── AppHost/                      # Aspire orchestration
├── ErpApiGateway/               # YARP API Gateway
├── MyApp.Auth/                  # Auth microservice
├── MyApp.Billing/               # Billing microservice
├── MyApp.Inventory/             # Inventory microservice
├── MyApp.Orders/                # Orders microservice
├── MyApp.Purchasing/            # Purchasing microservice
├── MyApp.Sales/                 # Sales microservice
├── MyApp.Shared/                # Shared libraries
├── infra/                       # Azure infrastructure (Bicep)
│   ├── core/                    # Reusable Bicep modules
│   ├── main.bicep              # Main infrastructure definition
│   └── main.parameters.json    # Parameters template
├── .github/workflows/           # CI/CD pipelines
├── docs/                        # Documentation
├── azure.yaml                   # Azure Developer CLI config
└── README.md                    # This file

Each microservice follows Clean Architecture:

MyApp.[Service]/
├── MyApp.[Service].API/         # Web API layer
├── MyApp.[Service].Application/ # Application logic
├── MyApp.[Service].Domain/      # Domain entities
└── MyApp.[Service].Infrastructure/ # Data access

🔧 Development

Prerequisites

  • .NET 10.0 SDK
  • Docker Desktop
  • Visual Studio 2022 / VS Code / Rider
  • Azure Developer CLI (for deployment)

Build

# Restore dependencies
dotnet restore

# Build all projects
dotnet build

# Run tests
dotnet test

Run Locally

# Using Aspire (recommended)
cd AppHost
dotnet run

# Or run individual services
cd MyApp.Auth/MyApp.Auth.API
dotnet run

Environment Variables

Local development uses appsettings.Development.json in AppHost:

{
  "Jwt": {
    "SecretKey": "your-secret-key",
    "Issuer": "MyApp.Auth",
    "Audience": "MyApp.All"
  },
  "Parameters": {
    "FrontendOrigin": "http://localhost:3000"
  }
}

Production uses Azure Container Apps secrets and environment variables.

🚢 Deployment

# One command deployment
azd up

This deploys:

  • ✅ All microservices with Dapr sidecars
  • ✅ API Gateway with external HTTPS
  • ✅ Azure SQL with 6 databases
  • ✅ Azure Cache for Redis
  • ✅ Auto-scaling and health checks

See DEPLOYMENT.md for details.

GitHub Actions (CI/CD)

Modular CI/CD with separate workflows for security and speed:

WorkflowPurposeTriggers
build.ymlBuild, test, coveragepush/PR to main, develop
sonarcloud.ymlSonarCloud code quality & coverage analysispush/PR to main, develop
codeql.ymlCodeQL security analysispush/PR to main, develop
deploy.ymlProvision, Docker build, GHCR push, Azure deployafter Build & Test succeeds on main/develop, or manual

Coverage: Tests collect coverage using Coverlet (Cobertura format), merged to coverage/coverage.cobertura.xml and analyzed by SonarCloud.

Required secrets (deploy): AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID.
Required secrets (SonarCloud): SONAR_TOKEN.
Optional SonarCloud configuration: SONAR_PROJECT_KEY and SONAR_ORG can be provided as repository variables or secrets; otherwise the workflow falls back to Ozymandros_ERP.Microservices and the repository owner.

🔐 Security

  • JWT Authentication: Bearer token authentication
  • Role-Based Access Control: Fine-grained permissions
  • Azure Managed Identities: No credentials in code
  • Secrets Management: Azure Container Apps secrets
  • HTTPS Only: TLS termination at gateway
  • CORS: Configurable allowed origins

📊 Monitoring

  • Application Insights: Performance monitoring (coming soon)
  • Log Analytics: Centralized logging
  • Health Checks: Liveness and readiness probes
  • Dapr Dashboard: Service mesh visibility

🤝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

📄 License

This project is licensed under the MIT License.

💡 Tips

  • Use azd down to delete resources when not in use
  • Check logs with az containerapp logs show
  • Monitor costs in Azure Portal
  • Scale services independently as needed

🆘 Support

Ozymandros/ERP.Microservices

ERP Microservices solution with Aspire and Dapr

C#

0

475 commits

updated Sep 24, 2026

See the code

README

ERP Microservices

.NET 10 Aspire Dapr Azure Docker Microservices License: MIT

A cloud-native ERP system built with .NET 10, Aspire, Dapr, and deployed to Azure Container Apps.

🎯 Status Dashboard

MetricStatus
BuildBuild Status
TestsTests
CoverageCoverage
Code QualityQuality Gate
SecuritySecurity
CodeQLCodeQL
DeploymentDeploy

🚀 Features

  • Microservices Architecture: 6 independent services (Auth, Billing, Inventory, Orders, Purchasing, Sales)
  • API Gateway: YARP-based reverse proxy with external HTTPS ingress
  • Dapr Integration: Service invocation, pub/sub, and state management
  • Azure Container Apps: Production-ready deployment with auto-scaling
  • Local Development: Full stack runs locally with Aspire and Docker
  • CI/CD Ready: GitHub Actions workflow included

📋 Architecture

Services

ServiceResponsibilityDatabase
AuthAuthentication & AuthorizationAuthDB
BillingInvoice and billing managementBillingDB
InventoryStock and warehouse managementInventoryDB
OrdersOrder processingOrderDB
PurchasingProcurement managementPurchasingDB
SalesSales operationsSalesDB

Infrastructure

  • Gateway: External HTTPS endpoint, routes to internal services
  • Azure SQL: One database per microservice
  • Azure Redis: Shared distributed cache
  • Dapr: Service mesh for microservices communication
  • Container Apps: Managed Kubernetes-based hosting

🏃 Quick Start

Local Development

# Prerequisites: .NET 10 SDK, Docker
cd AppHost
dotnet run

The Aspire dashboard will open automatically showing all services.

Deploy to Azure

# Prerequisites: Azure Developer CLI (azd)
azd up

See QUICKSTART.md for detailed 5-minute deployment guide.

📚 Documentation

Browse the complete documentation site at https://ozymandros.github.io/ERP.Microservices/ (generated with DocFX)

🛠️ Technology Stack

  • .NET 10: Latest .NET framework
  • Aspire: Cloud-native orchestration for local development
  • Dapr: Distributed application runtime
  • Azure Container Apps: Managed container hosting
  • Azure SQL Database: Relational database
  • Azure Cache for Redis: Distributed caching
  • Entity Framework Core: ORM
  • Ocelot: API Gateway
  • JWT: Authentication

🏗️ Project Structure

ERP.Microservices/
├── AppHost/                      # Aspire orchestration
├── ErpApiGateway/               # YARP API Gateway
├── MyApp.Auth/                  # Auth microservice
├── MyApp.Billing/               # Billing microservice
├── MyApp.Inventory/             # Inventory microservice
├── MyApp.Orders/                # Orders microservice
├── MyApp.Purchasing/            # Purchasing microservice
├── MyApp.Sales/                 # Sales microservice
├── MyApp.Shared/                # Shared libraries
├── infra/                       # Azure infrastructure (Bicep)
│   ├── core/                    # Reusable Bicep modules
│   ├── main.bicep              # Main infrastructure definition
│   └── main.parameters.json    # Parameters template
├── .github/workflows/           # CI/CD pipelines
├── docs/                        # Documentation
├── azure.yaml                   # Azure Developer CLI config
└── README.md                    # This file

Each microservice follows Clean Architecture:

MyApp.[Service]/
├── MyApp.[Service].API/         # Web API layer
├── MyApp.[Service].Application/ # Application logic
├── MyApp.[Service].Domain/      # Domain entities
└── MyApp.[Service].Infrastructure/ # Data access

🔧 Development

Prerequisites

  • .NET 10.0 SDK
  • Docker Desktop
  • Visual Studio 2022 / VS Code / Rider
  • Azure Developer CLI (for deployment)

Build

# Restore dependencies
dotnet restore

# Build all projects
dotnet build

# Run tests
dotnet test

Run Locally

# Using Aspire (recommended)
cd AppHost
dotnet run

# Or run individual services
cd MyApp.Auth/MyApp.Auth.API
dotnet run

Environment Variables

Local development uses appsettings.Development.json in AppHost:

{
  "Jwt": {
    "SecretKey": "your-secret-key",
    "Issuer": "MyApp.Auth",
    "Audience": "MyApp.All"
  },
  "Parameters": {
    "FrontendOrigin": "http://localhost:3000"
  }
}

Production uses Azure Container Apps secrets and environment variables.

🚢 Deployment

# One command deployment
azd up

This deploys:

  • ✅ All microservices with Dapr sidecars
  • ✅ API Gateway with external HTTPS
  • ✅ Azure SQL with 6 databases
  • ✅ Azure Cache for Redis
  • ✅ Auto-scaling and health checks

See DEPLOYMENT.md for details.

GitHub Actions (CI/CD)

Modular CI/CD with separate workflows for security and speed:

WorkflowPurposeTriggers
build.ymlBuild, test, coveragepush/PR to main, develop
sonarcloud.ymlSonarCloud code quality & coverage analysispush/PR to main, develop
codeql.ymlCodeQL security analysispush/PR to main, develop
deploy.ymlProvision, Docker build, GHCR push, Azure deployafter Build & Test succeeds on main/develop, or manual

Coverage: Tests collect coverage using Coverlet (Cobertura format), merged to coverage/coverage.cobertura.xml and analyzed by SonarCloud.

Required secrets (deploy): AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID.
Required secrets (SonarCloud): SONAR_TOKEN.
Optional SonarCloud configuration: SONAR_PROJECT_KEY and SONAR_ORG can be provided as repository variables or secrets; otherwise the workflow falls back to Ozymandros_ERP.Microservices and the repository owner.

🔐 Security

  • JWT Authentication: Bearer token authentication
  • Role-Based Access Control: Fine-grained permissions
  • Azure Managed Identities: No credentials in code
  • Secrets Management: Azure Container Apps secrets
  • HTTPS Only: TLS termination at gateway
  • CORS: Configurable allowed origins

📊 Monitoring

  • Application Insights: Performance monitoring (coming soon)
  • Log Analytics: Centralized logging
  • Health Checks: Liveness and readiness probes
  • Dapr Dashboard: Service mesh visibility

🤝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

📄 License

This project is licensed under the MIT License.

💡 Tips

  • Use azd down to delete resources when not in use
  • Check logs with az containerapp logs show
  • Monitor costs in Azure Portal
  • Scale services independently as needed

🆘 Support