Skip to content

rglobig/InventoryManagement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
rene
Feb 14, 2025
ccf3bfa ยท Feb 14, 2025

History

71 Commits
Dec 14, 2024
Dec 14, 2024
Feb 14, 2025
Feb 14, 2025
Dec 14, 2024
Dec 14, 2024
Dec 14, 2024
Dec 14, 2024
Dec 14, 2024
Dec 14, 2024
Dec 1, 2024
Nov 29, 2024
Dec 14, 2024
Dec 14, 2024
Dec 14, 2024
Nov 29, 2024
Dec 14, 2024

Repository files navigation

CRUD Example Project

๐ŸŽฏ Goal

This project demonstrates CRUD operations using a persistent database and a Web API. Swagger integration is included for API visualization and manual testing.

๐Ÿ› ๏ธ Tech Stack

  • ASP.NET Core: Framework for building the Web API.
  • PostgreSQL: Database for persistence.
  • EF Core 9: Entity Framework Core for ORM functionality.
  • C# 13: Programming language used for development.
  • .NET 9: The runtime powering the application.
  • xUnit: Unit testing framework.
  • Moq: Mocking framework for test isolation.
  • FluentAssertions: Library for expressive test assertions.
Loading
flowchart TD
    A[ASP.NET Core] --> B[PostgreSQL]
    A --> C[EF Core 9]
    A --> D[C# 13]
    A --> E[.NET 9]
    A --> F[xUnit]
    A --> G[Moq]
    A --> H[FluentAssertions]

    subgraph Api Layer
        A
    end

    subgraph Data Layer
        B
        C
    end

    subgraph Test Layer
        F
        G
        H
    end

    A --> I[Swagger API Integration]
    I --> B

๐Ÿ—‚๏ธ Project Structure

The project adopts a layered architecture for better organization, testability, and scalability:

  • Api: Contains Web API controllers and handles application bootstrap/configuration.
  • Application: Contains business logic abstractions, including services and data transfer objects (DTOs).
  • Domain: Defines domain-specific entities and logic.
  • Infrastructure: Implements persistence, including database configurations and migrations.
Loading
graph TD
    A[Api] --> B[Application]
    B --> C[Domain]
    B --> D[Infrastructure]
    C --> E[Entities]
    D --> F[Persistence]

    subgraph "Api Layer"
        A
    end

    subgraph "Application Layer"
        B
    end

    subgraph "Domain Layer"
        C
        E
    end

    subgraph "Infrastructure Layer"
        D
        F
    end

๐Ÿงช Testing

  • Each project has a corresponding *.Tests project containing unit tests.
  • Integration tests for the API are located in InventoryManagement.Api.IntegrationTests.

๐Ÿš€ Future Ideas

  1. ๐Ÿ—๏ธ Architecture Tests (e.g., ArchUnitNET)
    Introduce architecture tests to enforce design principles and ensure the application's structure aligns with its intended architecture.

  2. ๐Ÿ“š Mediator Pattern (CQRS)
    Implement the mediator pattern for better separation of concerns and support for the CQRS (Command Query Responsibility Segregation) pattern.

  3. ๐Ÿ”ฎ Adding GraphQL as a Second Web API
    While the project currently uses a traditional RESTful Web API, adding GraphQL as a second API will enhance flexibility and provide more efficient querying capabilities.

  4. ๐Ÿ“ฑ Implementing .NET MAUI for Cross-Platform UI
    .NET MAUI (Multi-platform App UI) can be used to create a cross-platform application that works across mobile and desktop platforms (Android, iOS, macOS, and Windows) using a single codebase.

  5. ๐Ÿ” Implementing Authentication and Authorization
    Introduce authentication and authorization to secure the Web API. This will ensure that only authorized users can access specific resources.

About

CRUD Example Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published