π A production-ready, cloud-native ERP system built with .NET 10, Domain-Driven Design, and enterprise-grade patterns
Quick Start β’ Features β’ Architecture β’ Deployment β’ Contributing
| β Most Open-Source ERPs | β This Project |
|---|---|
| Legacy monoliths | 15+ Microservices with independent deployment |
| Outdated tech stacks | .NET 10, Dapr, Kubernetes-ready |
| Oversimplified demos | Real-world complexity: Event Sourcing, MRP, Multi-tenancy |
| Vendor lock-in | 100% Open Source, MIT Licensed |
|
|
|
|
|
|
|
|
graph TB
subgraph "π Gateway Layer"
GW[YARP API Gateway]
end
subgraph "π Core Business Services"
FIN[π° Finance]
INV[π¦ Inventory]
SALES[π Sales]
PROC[π Procurement]
PROD[π Production]
CRM[π€ CRM]
PROJ[π
Projects]
end
subgraph "π§ Supporting Services"
HR[π₯ HR]
PAY[πΈ Payroll]
ASSET[π’ Assets]
ID[π Identity]
MD[π MasterData]
MRP[π MRP]
RPT[π Reporting]
end
subgraph "βοΈ Platform Services"
AUTO[π€ Automation]
QUAL[β
Quality]
MAINT[π§ Maintenance]
SET[βοΈ Settings]
ANA[π Analytics]
end
subgraph "π οΈ Infrastructure"
PG[(PostgreSQL)]
TSDB[(TimescaleDB)]
REDIS[(Redis)]
DAPR{Dapr Sidecar}
end
GW --> FIN & INV & SALES & PROC & PROD & CRM & PROJ
GW --> HR & PAY & ASSET & ID & MD & MRP & RPT
GW -.->|SignalR / WebSocket| ANA
FIN & INV & SALES & CRM & PROJ -.->|Event Bus| DAPR
DAPR -.-> AUTO & ANA
FIN & INV & SALES --> PG
ANA --> TSDB
ID --> REDIS
| Pattern | Implementation |
|---|---|
| Event Sourcing | Complete audit trail, temporal queries |
| CQRS | Separate read/write models with MediatR |
| Domain-Driven Design | Aggregates, Value Objects, Domain Events |
| Saga Pattern | Distributed transactions via Dapr |
| Outbox Pattern | Reliable event publishing with EF Core |
| Specification Pattern | Reusable query logic |
| Result Pattern | Railway-oriented error handling |
Our shared kernel provides production-ready cross-cutting concerns:
ErpSystem.BuildingBlocks/
βββ Behaviors/ # MediatR pipeline (Validation, Logging, Idempotency, Audit, Performance)
βββ CQRS/ # ICommand, IQuery, Handler abstractions
βββ Common/ # Result<T> pattern, Error types
βββ Domain/ # Specifications, Domain Event Dispatcher
βββ Outbox/ # Transactional Outbox with EF Core
βββ MultiTenancy/ # SaaS tenant isolation (query filters + interceptors)
βββ Resilience/ # Polly V8 (Retry, Circuit Breaker, Timeout)
βββ Caching/ # Distributed cache extensions (GetOrSet)
βββ Auditing/ # Automatic audit logging
βββ Middleware/ # CorrelationId, RequestLogging, GlobalException
| Tool | Version |
|---|---|
| .NET SDK | 10.0+ |
| Docker | Latest |
| PostgreSQL | 16+ |
# 1. Clone
git clone https://github.com/Edison0621/erp-microservice.git
cd erp-microservice
# 2. Build & Test
dotnet build src/ErpSystem.sln
dotnet test src/ErpSystem.sln
# 3. Run a service (e.g., Finance)
cd src/Services/Finance/ErpSystem.Finance
dotnet run# Build all images
docker build -t erp-system/finance:latest --build-arg SERVICE_NAME=Finance .
# Or use Docker Compose
docker-compose up -d# Install the chart
helm install erp-system deploy/helm/erp-system \
--set postgresql.auth.password=your-secure-password \
--set ingress.host=erp.yourcompany.com
# Verify
kubectl get pods -n erp-systemdeploy/
βββ k8s/ # Raw Kubernetes manifests
β βββ namespace.yaml
β βββ configmap.yaml
β βββ secrets.yaml
β βββ ingress.yaml
β βββ services/*.yaml # Per-service deployments
βββ helm/erp-system/ # Helm Chart
βββ Chart.yaml
βββ values.yaml
βββ templates/
π Full Guide: docs/deployment.md
erp-microservice/
βββ src/
β βββ BuildingBlocks/ # π§± Shared kernel (enterprise patterns)
β βββ Gateways/ErpSystem.Gateway/ # π YARP reverse proxy
β βββ Services/
β β βββ Finance/ # π° General Ledger, AP/AR
β β βββ Inventory/ # π¦ Stock management
β β βββ Sales/ # π Order processing
β β βββ Procurement/ # π Purchase orders
β β βββ Production/ # π Manufacturing
β β βββ CRM/ # π€ Customer Relationship Management
β β βββ Projects/ # π
Project Management
β β βββ HR/ # π₯ Employee management
β β βββ Payroll/ # πΈ Payroll & Compensation
β β βββ Assets/ # π’ Asset Lifecycle Management
β β βββ Identity/ # π Auth & RBAC
β β βββ MasterData/ # π Materials, Customers, Suppliers
β β βββ Mrp/ # π Material Requirements Planning
β β βββ Reporting/ # π BI Dashboard & Reports
β β βββ Quality/ # β
QC & Inspection
β β βββ Analytics/ # π Time-series analytics
β β βββ Automation/ # π€ Workflow engine
β β βββ Maintenance/ # π§ Asset maintenance
β β βββ Settings/ # βοΈ System configuration
β βββ Web/ErpSystem.Web/ # π₯οΈ React frontend
βββ tests/
β βββ ErpSystem.IntegrationTests/ # β
21 passing tests
βββ deploy/
βββ k8s/ # Kubernetes manifests
βββ helm/erp-system/ # Helm chart
# Run all tests
dotnet test src/ErpSystem.sln
# Run specific module
dotnet test --filter "GLTests"
# With coverage
dotnet test /p:CollectCoverage=trueCurrent Status: β 21 tests passing
| Phase | Status | Description |
|---|---|---|
| Phase 1 | β Complete | Core Infrastructure & Event Sourcing |
| Phase 2 | β Complete | Finance Module (General Ledger) |
| Phase 3 | β Complete | Inventory & Procurement |
| Phase 4 | β Complete | MRP (Material Requirements Planning) |
| Phase 5 | β Complete | Enterprise BuildingBlocks |
| Phase 6 | β Complete | Reporting & BI Dashboard |
| Phase 7 | β Complete | Kubernetes & Helm Charts |
| Phase 8 | β Complete | CRM & Customer Portal |
| Phase 9 | β Complete | Project Management & Timesheets |
| Phase 10 | β Complete | Payroll & Compensation |
| Phase 11 | β Complete | Asset Lifecycle Management |
| Phase 12 | β Complete | Real-time Notifications (SignalR) |
| Phase 13 | β Complete | AI-Driven Demand Forecasting (ML.NET) |
We welcome contributions! See CONTRIBUTING.md for guidelines.
# Fork β Clone β Branch β Code β Test β PR
git checkout -b feature/amazing-feature
git commit -m "feat: add amazing feature"
git push origin feature/amazing-featureThis project is licensed under the MIT License - see LICENSE for details.
Built with β€οΈ using .NET 10, DDD, and modern cloud-native patterns