(ASP.NET Core 8 β Razor Pages β Clean Architecture)
A full-featured Warehouse Inventory Management System built with ASP.NET Core 8 Razor Pages and Entity Framework Core, following Clean Architecture principles.
This project demonstrates how to structure a real-world ASP.NET Core application with:
- Domain layer
- Application layer
- Infrastructure layer
- Web (UI) layer
It includes authentication, role-based access (Admin & Customer), inventory management, orders, and clean separation of concerns.
- ASP.NET Identity integration
- Separate Admin and Customer roles
- Login & Register for both roles
- Role-based page access
- Create and edit inventory items
- Manage categories and suppliers
- Track item status and stock quantity
- View warehouse logs
- Browse item catalog
- View item details
- Add items to cart
- Place orders
- View order history
- Domain entities isolated from UI & database
- Repository pattern
- Service layer for business logic
- DTOs for data transfer
- AutoMapper for mapping entities to DTOs
- Entity Framework Core (Code First)
- SQL Server database
- Migrations support
- Database seeding
- Generic repository implementation
- Custom exceptions (NotFound, OperationFailed)
- Server-side validation
- Model binding
- ASP.NET Core 8.0 (Razor Pages)
- Entity Framework Core 8.0
- SQL Server
- ASP.NET Identity
- AutoMapper
- Clean Architecture
- Customer Login
- Customer Dashboard
- Customer Cart
- Admin Login
- Admin Dashboard
- Warehouse Item List
- Add New Item
- Filter Items Modal
- Supplier List
- Add New Supplier
- Warehouse Orders List
- Order Details View
- Receive Shipment
- Adjust Stock Levels
- Add Item-Supplier Relation
π¦ ASP.NET-Core-8-Warehouse-Inventory-System
β
βββ Domain β Core business layer
β βββ Entities (Item, Category, Supplier, Order, OrderItem, WarehouseLog, Status enums)
β βββ Interfaces (IRepository, IOrderItemRepository)
β βββ Domain.csproj
β
βββ Application β Application contracts & DTOs
β βββ DTOs (ItemDto, OrderDto, SupplierDto, CategoryDto, ItemFilterDto, WarehouseLogDto)
β βββ Interfaces (IItemsService, IOrderService, ISupplierService, ICategoryService, IAdminService, ICustomerService)
β βββ Mappings (AutoMapper profile)
β βββ Common/Exceptions (NotFoundException, OperationFailedException)
β βββ Application.csproj
β
βββ Infrastructure β Implementations & data access
β βββ Data (AppDbContext, Repository, OrderItemRepository)
β βββ Services (ItemService, OrderService, SupplierService, CategoryService, WarehouseLogService, ItemStatusService)
β βββ Identity (ApplicationUser, IdentityService, AdminService, CustomerService, Role seeding)
β βββ Migrations
β βββ Infrastructure.csproj
β
βββ Web β Presentation layer (Razor Pages UI)
β βββ Pages
β β βββ Admin (Auth, Items, Orders, Suppliers)
β β βββ Customer (Auth, Catalogs, Carts)
β β βββ Shared (_Layout, Sidebars)
β β βββ Index.cshtml
β β
β βββ wwwroot (CSS, JS, images)
β βββ Program.cs (Dependency Injection & middleware)
β βββ appsettings.json
β βββ Web.csproj
β
βββ Warehouse.sln
This project follows Clean Architecture:
Contains only business entities and repository contracts:
Item,Order,Supplier,WarehouseLogIRepository
No dependency on EF Core or UI.
Defines use-cases and data transfer:
- DTOs
- Service interfaces
- AutoMapper profile
- Custom exceptions
Implements application contracts using:
- EF Core (
AppDbContext) - Repository pattern
- Business services
- ASP.NET Identity
- Database migrations
Razor Pages UI:
- Admin area
- Customer area
- Authentication pages
- Layout & shared components
- Dependency injection configuration
- Clone the repository:
git clone https://github.com/Alireza-Jafari-tech/ASP.NET-Core-8-Warehouse-Inventory-System.git
cd ASP.NET-Core-8-Warehouse-Inventory-System- Update connection string in
Web/appsettings.json:
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Database=WarehouseDb;Trusted_Connection=True;TrustServerCertificate=True"
}- Apply migrations:
dotnet ef database update- Run the application:
dotnet run --project Web- Open in browser:
[http://localhost:5258]
- Demo Accounts:
- Admin User:
- Email: michael.anderson@warehouse.com
- Password: Admin123!
- Customer Account:
- Email: john.smith@amazon.com
- Password: Amazon12!
- Login/Register as Admin
- Manage items, categories, suppliers
- View and manage orders
- Track warehouse logs
- Register/Login
- Browse catalog
- Add items to cart
- Place orders
- View order history
- Apply Clean Architecture in ASP.NET Core
- Implement Repository & Service patterns
- Work with ASP.NET Identity
- Build real-world Razor Pages UI
- Practice EF Core migrations
- Implement DTOs and AutoMapper
- Understand layered architecture
This project is licensed under the MIT License.
See the LICENSE file for details.
This project is for learning purposes, but feel free to fork and improve it. Suggestions, issues, and pull requests are welcome!
















