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/Oh011/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": "[email protected]",
"Password": "your-email-password",
"EnableSsl": true
},
"LinkOptions": {
"BaseUrl": "http://localhost:4200"
}
}
dotnet ef database update --project src/InventorySystem.Infrastructure --startup-project src/InventorySystem.Api
cd 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:
[email protected] - 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



