Skip to content

Ozymandros/ERP.Microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

346 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

Metric Status
Build Build Status
Tests Tests
Coverage Coverage
Code Quality Quality Gate
Security Security
CodeQL CodeQL
Deployment Deploy

πŸš€ 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

Service Responsibility Database
Auth Authentication & Authorization AuthDB
Billing Invoice and billing management BillingDB
Inventory Stock and warehouse management InventoryDB
Orders Order processing OrderDB
Purchasing Procurement management PurchasingDB
Sales Sales operations SalesDB

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)

Quick Links

πŸ› οΈ 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

Azure Container Apps (Recommended)

# 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:

Workflow Purpose Triggers
build.yml Build, test, coverage push/PR to main, develop
sonarcloud.yml SonarCloud code quality & coverage analysis push/PR to main, develop
codeql.yml CodeQL security analysis push/PR to main, develop
deploy.yml Provision, Docker build, GHCR push, Azure deploy after 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, SONAR_PROJECT_KEY, SONAR_ORG.

πŸ” 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.

πŸ”— Links

πŸ’‘ 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

About

ERP Microservices solution with Aspire and Dapr

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors