The Inventory Management System (IMS) is a production-ready, enterprise-grade RESTful API built with .NET 9 Web API. It provides comprehensive functionality for managing inventory operations across multiple warehouses with features like real-time stock tracking, order management, and role-based access control.
- Product Management: Complete CRUD operations for products with categories and suppliers
- Multi-Warehouse Support: Track inventory across multiple warehouse locations
- Order Processing: Handle sales and purchase orders with automatic stock updates
- User Management: Role-based access control with four permission levels
- Advanced Filtering: Pagination, filtering, sorting, and searching capabilities
- Validation: Robust input validation using FluentValidation
- Documentation: Interactive API documentation with Scalar
| Component | Technology | Version |
|---|---|---|
| Framework | .NET Web API | 9.0 |
| ORM | Entity Framework Core | 9.0.9 |
| Database | Microsoft SQL Server | 2019+ |
| Purpose | Library | Description |
|---|---|---|
| Authentication | JWT Bearer | Token-based authentication |
| Validation | FluentValidation | Request validation |
| Logging | Serilog | Structured logging |
| Documentation | Swagger/OpenAPI | API documentation |
| Documentation UI | Scalar | Modern API documentation interface |
inventory_management_system/
│
├── Controllers/ # API Controllers
│ ├── AuthController.cs
│ ├── ProductsController.cs
│ ├── CategoriesController.cs
│ ├── OrdersController.cs
│ └── ...
│
├── Data/ # Database Context
│ └── ApplicationDBContext.cs
│
├── DTOs/ # Data Transfer Objects
│ ├── Requests/ # Request DTOs
│ │ ├── CreateProductRequest.cs
│ │ ├── UpdateProductRequest.cs
│ │ └── ...
│ └── Responses/ # Response DTOs
│ ├── ProductResponse.cs
│ ├── OrderResponse.cs
│ └── ...
│
├── Enums/ # Enumeration Types
│ ├── OrderStatus.cs
│ ├── OrderType.cs
│ ├── UserRole.cs
│ └── ...
│
├── Exceptions/ # Custom Exceptions
│ ├── NotFoundException.cs
│ ├── UnauthorizedException.cs
│ └── ...
│
├── Extensions/ # Extension Methods
│ ├── ServiceExtensions.cs
│ └── JwtExtensions.cs
│
├── Filters/ # Action Filters
│ └── RolePermissionAttribute.cs
│
├── Helpers/ # Helper Classes
│ ├── ProblemDetailHelper.cs
│ └── ...
│
├── Middleware/ # Custom Middleware
│ └── GlobalExceptionMiddleware.cs
│
├── Migrations/ # EF Core Migrations
│ └── [Timestamp]_InitialCreate.cs
│
├── Models/ # Domain Entities
│ ├── User.cs
│ ├── Product.cs
│ ├── Category.cs
│ ├── Order.cs
│ ├── OrderItem.cs
│ ├── Inventory.cs
│ ├── Warehouse.cs
│ └── ...
│
├── Repository/ # Data Access Layer
│ ├── Implementations/
│ │ ├── ProductRepository.cs
│ │ ├── OrderRepository.cs
│ │ └── ...
│ └── Interfaces/
│ ├── IProductRepository.cs
│ ├── IOrderRepository.cs
│ └── ...
│
├── Security/ # Security Utilities
│ └── PasswordHasher.cs
│
├── Services/ # Business Logic Layer
│ ├── Implementations/
│ │ ├── AuthService.cs
│ │ ├── ProductService.cs
│ │ ├── OrderService.cs
│ │ └── ...
│ └── Interfaces/
│ ├── IAuthService.cs
│ ├── IProductService.cs
│ ├── IOrderService.cs
│ └── ...
│
├── Validations/ # FluentValidation Validators
│ ├── CreateProductValidator.cs
│ ├── LoginRequestValidator.cs
│ └── ...
│
├── logs/ # Application Logs
│ └── log-YYYYMMDD.txt
│
├── appsettings.json # Configuration
├── appsettings.Development.json # Development Config
├── appsettings.Production.json # Production Config
├── Program.cs # Application Entry Point
└── inventory_management_system.csproj
Before you begin, ensure you have the following installed:
- .NET 8 SDK or later (Download)
- SQL Server (LocalDB, Express, or Full Edition)
- Visual Studio 2022 / VS Code / JetBrains Rider
- Git (for version control)
git clone <repository-url>
cd inventory_management_systemdotnet restoreEdit appsettings.json or appsettings.Development.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=.;Database=InventoryDB;Trusted_Connection=True;TrustServerCertificate=True;"
},
"Jwt": {
"Key": "your-super-secret-key-minimum-32-characters-long",
"Issuer": "InventoryManagementSystem",
"Audience": "IMSUsers",
"AccessTokenExpirationMinutes": 15,
"RefreshTokenExpirationDays": 7
}
}dotnet ef migrations add InitialCreatedotnet ef database updatedotnet runOr with watch mode (auto-restart on file changes):
dotnet watch run