A comprehensive Inventory Management API service built with ASP.NET Core 8.0 following Clean Architecture principles. This service enables organizations to efficiently manage their inventory, track stock levels, handle purchases and sales, and maintain retail stock information.
The project follows Clean Architecture with the following layers:
- InventoryX.Domain - Core business entities and domain logic
- InventoryX.Application - Application business rules, CQRS commands/queries, and service interfaces
- InventoryX.Infrastructure - Data access, external services, and infrastructure concerns
- InventoryX.Presentation - API controllers, middleware, and presentation logic
- π¦ Inventory item management
- π·οΈ Item type categorization
- π° Purchase and sales tracking
- πͺ Retail stock management
- π Authentication and authorization with ASP.NET Identity
- π RESTful API with Swagger documentation
- π― CQRS pattern with MediatR
- πΊοΈ AutoMapper for object mapping
- .NET 8.0 - Framework
- ASP.NET Core - Web API
- Entity Framework Core - ORM
- SQL Server - Database
- MediatR - CQRS implementation
- AutoMapper - Object mapping
- Swagger/OpenAPI - API documentation
- ASP.NET Identity - Authentication & Authorization
Before you begin, ensure you have the following installed:
- .NET 8.0 SDK or later
- SQL Server (LocalDB, Express, or full version)
- Visual Studio 2022 or JetBrains Rider (recommended)
- Git
git clone https://github.com/yourusername/InventoryX.git
cd InventoryXUpdate the connection string in InventoryX.Presentation/appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=InventoryXDb;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}If you're running a frontend application, add allowed origins in appsettings.json:
{
"Frontend": {
"AllowedOrigins": [
"http://localhost:5173",
"http://localhost:3000"
]
}
}Using .NET CLI:
dotnet restoreOr using Visual Studio:
- Right-click on the solution β Restore NuGet Packages
cd InventoryX.Presentation
dotnet ef database updateIf you don't have EF Core tools installed:
dotnet tool install --global dotnet-efUsing .NET CLI:
dotnet run --project InventoryX.PresentationUsing Visual Studio/Rider:
- Press F5 or click the Run button
The API will be available at:
- HTTPS:
https://localhost:7xxx - HTTP:
http://localhost:5xxx - Swagger UI:
https://localhost:7xxx/swagger
dotnet testOnce the application is running, navigate to /swagger to view the interactive API documentation.
- Authentication:
/api/auth/* - Inventory Items:
/api/inventoryitems/* - Item Types:
/api/inventoryitemtypes/* - Purchases:
/api/purchases/* - Sales:
/api/sales/* - Retail Stocks:
/api/retailstocks/*
The API uses ASP.NET Identity with cookie-based authentication. To access protected endpoints:
- Register a new user via
/api/auth/register - Login via
/api/auth/login - Use the returned authentication cookie for subsequent requests
We welcome contributions! Please see our Contributing Guidelines for details on how to get started.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Adam Tungtaiya Lukman
- Built with Clean Architecture principles
- Inspired by modern .NET best practices
- Community contributions and feedback
For issues, questions, or suggestions:
- Open an issue on GitHub
- Contact the maintainers
Happy Coding! π