Skip to content

na2mul/Inventory-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

75 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ Inventory Management System

.NET C# SQL Server Docker

An enterprise-grade inventory management solution built with ASP.NET Core, featuring Clean Architecture principles and Domain-Driven Design patterns.


🌟 Overview

DevSkill Inventory is a comprehensive inventory management system designed for businesses to efficiently manage their products, sales, customers, and financial transactions. Built with modern .NET technologies and cloud-native architecture, this application ensures scalability, security, and maintainability.

Why This Project?

  • πŸ—οΈ Clean Architecture: Separation of concerns for better maintainability
  • πŸ” Enterprise Security: Role-based and claim-based access control
  • ☁️ Cloud-Ready: AWS S3 and SQS integration
  • πŸ“Š Real-Time Insights: Comprehensive reporting and analytics
  • 🐳 Container-First: Docker support for easy deployment

πŸ“‹ Table of Contents


✨ Features

πŸ“¦ Product Management

  • Complete CRUD operations for products
  • Category-based product organization
  • Stock level tracking with low-stock alerts
  • Dual pricing support (MRP, wholesale)
  • Image upload with automatic resizing (AWS S3)

πŸ’° Sales & Financial Management

  • Multi-type sales transactions (MRP, wholesale)
  • Payment status tracking
  • Customer balance management
  • Account transfers (Cash, Bank, Mobile)
  • Comprehensive sales reporting

πŸ‘₯ Customer Management

  • Customer database with purchase history
  • Balance tracking
  • Customer-specific pricing
  • Relationship management

πŸ” Security & User Management

  • Hybrid authentication (role + claim-based)
  • Fine-grained permission system
  • Employee management
  • Department and unit management
  • Secure password policies with ASP.NET Core Identity

⚑ Advanced Features

  • Background job processing for image resizing
  • AWS SQS message queuing
  • Email notifications
  • Real-time dashboard
  • Audit logging with Serilog

πŸ—οΈ Architecture

This project implements Clean Architecture with Domain-Driven Design (DDD) principles, ensuring a clear separation of concerns and high testability.

Project Structure

DevSkill.Inventory/
β”œβ”€β”€ DevSkill.Inventory.Domain/          # Core business logic & entities
β”‚   β”œβ”€β”€ Entities/                       # Domain models
β”‚   β”œβ”€β”€ Interfaces/                     # Repository & service contracts
β”‚   └── DTOs/                          # Data transfer objects
β”‚
β”œβ”€β”€ DevSkill.Inventory.Application/     # Use cases & business logic
β”‚   β”œβ”€β”€ Features/                       # CQRS commands & queries
β”‚   β”œβ”€β”€ Services/                       # Application services
β”‚   └── Mappings/                       # AutoMapper profiles
β”‚
β”œβ”€β”€ DevSkill.Inventory.Infrastructure/  # External concerns
β”‚   β”œβ”€β”€ Data/                          # EF Core & repositories
β”‚   β”œβ”€β”€ Identity/                      # Authentication & authorization
β”‚   └── Services/                      # External service implementations
β”‚
β”œβ”€β”€ DevSkill.Inventory.Web/            # Presentation layer
β”‚   β”œβ”€β”€ Controllers/                   # MVC controllers
β”‚   β”œβ”€β”€ Views/                         # Razor views
β”‚   └── wwwroot/                       # Static files
β”‚
└── DevSkill.Inventory.Worker/         # Background processing
    └── Jobs/                          # Scheduled tasks

Design Patterns

Pattern Implementation Benefits
πŸ›οΈ Repository Data access abstraction Testability, persistence ignorance
πŸ”„ Unit of Work Transaction management Data consistency, atomic operations
⚑ CQRS MediatR implementation Scalability, separation of concerns
πŸ”Œ Dependency Injection Autofac container Loose coupling, maintainability

πŸ› οΈ Technology Stack

Backend

  • Framework: ASP.NET Core MVC (.NET 9)
  • ORM: Entity Framework Core
  • Database: Microsoft SQL Server (with stored procedures)
  • Authentication: ASP.NET Core Identity (extended)
  • Patterns: CQRS via MediatR

Frontend

  • UI Framework: AdminLTE
  • Templating: Razor Pages
  • Styling: Bootstrap 5 + Custom CSS
  • JavaScript: Modern ES6+

Cloud & DevOps

  • Storage: Amazon S3 (image storage)
  • Messaging: Amazon SQS (async processing)
  • Containerization: Docker & Docker Compose
  • Logging: Serilog

Development Tools

  • DI Container: Autofac
  • Object Mapping: AutoMapper
  • Testing: NUnit, Moq, Shouldly
  • Code Coverage: Coverlet

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

Optional (for full features)

  • πŸͺ£ AWS Account with S3 bucket
  • πŸ“¨ AWS SQS Queue configured
  • πŸ”‘ AWS IAM credentials

πŸ“₯ Installation

Method 1: Local Development

  1. Clone the repository

    git clone https://github.com/your-username/DevSkill.Inventory.git
    cd DevSkill.Inventory
  2. Restore dependencies

    dotnet restore
  3. Update database connection

    Edit DevSkill.Inventory.Web/appsettings.json:

    {
      "ConnectionStrings": {
        "DefaultConnection": "Server=localhost;Database=InventoryDB;Trusted_Connection=true;"
      }
    }
  4. Apply database migrations

    cd DevSkill.Inventory.Web
    dotnet ef database update
  5. Run the application

    dotnet run

    Access at: https://localhost:5001 or http://localhost:5000

Method 2: Docker Deployment (Recommended)

  1. Clone and navigate

    git clone https://github.com/your-username/DevSkill.Inventory.git
    cd DevSkill.Inventory
  2. Configure environment variables

    Create .env file:

    DB_CONNECTION=Server=sql-server;Database=InventoryDB;User=sa;Password=YourStrong@Passw0rd
    AWS_REGION=us-east-1
    AWS_ACCESS_KEY=your_access_key
    AWS_SECRET_KEY=your_secret_key
    AWS_S3_BUCKET=your-bucket-name
    AWS_SQS_URL=your-sqs-url
  3. Launch with Docker Compose

    docker-compose up --build -d

    Access at: http://localhost:8000


βš™οΈ Configuration

AWS Configuration (Optional)

For full functionality with image storage and background processing:

{
  "AWS": {
    "Profile": "your-profile",
    "Region": "us-east-1",
    "BucketName": "your-inventory-bucket",
    "SqsUrl": "https://sqs.us-east-1.amazonaws.com/your-account/your-queue",
    "UrlExpiryMinutes": 15
  }
}

Default Admin Credentials

After first run:

⚠️ Important: Change these credentials immediately after first login!


🧩 Core Modules

Accounts Module

Manages financial accounts and transaction types:

  • Cash accounts
  • Bank accounts
  • Mobile banking accounts
  • Balance transfers

Categories Module

Product categorization system:

  • Hierarchical categories
  • Category-based filtering
  • Bulk category operations

Customers Module

Customer relationship management:

  • Customer profiles
  • Purchase history
  • Balance tracking
  • Customer analytics

Products Module

Core inventory functionality:

  • Product CRUD operations
  • Stock management
  • Pricing (MRP & wholesale)
  • Image management
  • Low-stock alerts

Sales Module

Sales transaction processing:

  • Order creation
  • Payment tracking
  • Sales reports
  • Invoice generation

Users Module

Identity and access management:

  • User authentication
  • Role management
  • Claim-based permissions
  • Employee assignments

🐳 Docker Deployment

The project includes a complete Docker setup with multi-service orchestration.

Docker Compose Structure

services:
  - web: ASP.NET Core web application
  - worker: Background processing service
  - sql-server: Microsoft SQL Server database

Quick Start with Docker

# Build and start all services
docker-compose up --build -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

# Stop and remove volumes (⚠️ deletes data)
docker-compose down -v

πŸ§ͺ Testing

Run the comprehensive test suite:

# Run all tests
dotnet test

# Run tests with coverage
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

# Run specific test project
dotnet test DevSkill.Inventory.Tests

Test Structure

  • Unit Tests: Domain and application logic
  • Integration Tests: Database and external services
  • E2E Tests: Complete user workflows

🀝 Contributing

We welcome contributions! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/AmazingFeature
  3. Commit your changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

Code Standards

  • Follow C# coding conventions
  • Write unit tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ“ž Contact

Nazmul


πŸ™ Acknowledgments

  • Clean Architecture principles by Robert C. Martin
  • Domain-Driven Design by Eric Evans
  • ASP.NET Core community
  • All contributors who have helped this project

⭐ If this project helped you, please consider giving it a star!

Made with ❀️ using ASP.NET Core

Report Bug Β· Request Feature

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •