Inventory & Order Management System built with ASP.NET Core & Clean Architecture. Features include role-based authentication, product & category management, purchase orders, sales invoicing, real-time stock control, PDF export, notifications, and reporting.
Designed for scalability, testability, and real-world business workflows such as product tracking, sales invoicing, stock adjustment, and purchase order lifecycle handling — including Domain Events, Background Services, and Real-Time Notifications using SignalR.
📄 API Documentation: View PDF
- Backend: ASP.NET Core 8, EF Core
- Real-time: SignalR
- Database: SQL Server
- PDF generation: QuestPDF
- Patterns: Clean Architecture, CQRS, Domain Events
Make sure you have installed:
- .NET 8 SDK
- SQL Server (LocalDB or full instance)
- Visual Studio 2022 or Visual Studio Code
git clone https://github.com/your-username/Inventory_System.git
cd Inventory_SystemIn src/InventorySystem.Api/appsettings.json, update the configuration:
{
"ConnectionStrings": {
"DefaultConnection": "Server=YOUR_SQL_SERVER;Database=InventorySystem;Trusted_Connection=True;TrustServerCertificate=True;MultipleActiveResultSets=True"
},
"JwtOptions": {
"Issuer": "your-app",
"Audience": "your-app-users",
"SecretKey": "your-super-secret-key"
},
"SmtpOptions": {
"Host": "smtp.yourmail.com",
"Port": 587,
"UserName": "your-email@domain.com",
"Password": "your-email-password",
"EnableSsl": true
},
"LinkOptions": {
"BaseUrl": "http://localhost:4200"
}
}
dotnet ef database update --project src/InventorySystem.Infrastructure --startup-project src/InventorySystem.Apicd src/InventorySystem.Api
dotnet runYou can explore all API endpoints using Swagger:
Swagger UI
Use the following credentials to test authentication and API calls:
- Email:
Admin@Gmail.com - Password:
Admin#123 - DeviceId:
A1
src/
├── InventorySystem.Api # Presentation layer (controllers, middlewares, config)
├── InventorySystem.Application # CQRS commands, queries, DTOs, validators
├── InventorySystem.Domain # Entities, Enums, Domain Events
├── InventorySystem.Infrastructure # EF Core, Repositories, Identity, Services
└── Shared # Shared DTOs, constants, error models
The diagram below shows the core tables and relationships of the Inventory & Order Management System.
It focuses on the main entities like Products, Categories, Customers, Employees, Orders, and Suppliers.
Note: Some technical or auxiliary tables (like notifications, logs, or Identity internal tables) are omitted for clarity.
- ✅ Clean Architecture (Domain, Application, Infrastructure, WebAPI)
- ✅ CQRS with MediatR for commands and queries
- ✅ Domain Events for triggering side effects like:
- 📧 Sending emails when a Purchase Order is Created, Received, or Cancelled
- 🔔 Sending real-time SignalR notifications
- 📉 Automatically checking for low-stock products after stock adjustments
- ✅ SignalR for real-time notifications (e.g., low stock alerts, PO updates)
- ✅ Background Services for deferred or long-running domain operations
- ✅ SQL atomic updates to guarantee stock integrity at the database level.
- ✅ Role-based Authorization (Admin, Manager, Sales, Warehouse)
- ✅ Soft Deletion, Optimistic Concurrency, FluentValidation pipeline
- ✅ Applied the Observer pattern with Domain Events, SignalR, and Background Services to decouple workflows (e.g., triggering real-time notifications and emails when purchase orders are created or updated).
- 🔐 Authentication & Refresh Tokens
- 🧾 Sales Invoicing
- 📦 Inventory Control with value reports & manual adjustments
- 🛒 Purchase Orders (create, cancel, receive, export to PDF)
- 🧍 Employee, Customer & Supplier Management
- 📊 Sales Reports + PDF export
- 🔔 Real-time Notifications with SignalR
- 📃 Stock Adjustment Logs + PDF export
-
🟡
PurchaseOrderStatusChangedDomainEvent:- Sends SignalR notifications to warehouse users
- Emails supplier with the order details
-
🔴
ProductStockDecreasedDomainEvent:- Automatically triggers low stock warning
- Sends SignalR notification to managers
- Commands → Handlers → Services for business logic
- Queries → Handlers for read-only views
- MediatR decouples the flow
- Validators run in the pipeline before command handlers
NotificationHubbroadcasts:- 🔔 New domain event-based notifications
- 📉 Low-stock warnings
- ✅ Purchase order status updates



