https://github.com/hiimlawtsimp1e/eshopmicroservices
ASP.NET Core 8.0, Martern ORM, Microservices, Vertical-Slice Architecture, CQRS, Mediator
https://github.com/hiimlawtsimp1e/eshopmicroservices
asp-net-api asp-net-core cqrs-pattern dependency-injection dot-net-8 marten mediator-pattern microservices minimal-api vertical-slice-architecture
Last synced: 3 months ago
JSON representation
ASP.NET Core 8.0, Martern ORM, Microservices, Vertical-Slice Architecture, CQRS, Mediator
- Host: GitHub
- URL: https://github.com/hiimlawtsimp1e/eshopmicroservices
- Owner: HiImLawtSimp1e
- License: mit
- Created: 2025-02-16T07:17:17.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-23T20:20:17.000Z (8 months ago)
- Last Synced: 2025-02-23T20:27:03.143Z (8 months ago)
- Topics: asp-net-api, asp-net-core, cqrs-pattern, dependency-injection, dot-net-8, marten, mediator-pattern, microservices, minimal-api, vertical-slice-architecture
- Language: C#
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EShopMicroservices
This is my exercise to learn how to implement modern software architectures in ASP.NET such as:
- Microservices
- Vertical Slice Architecture
- Clean Architecture
- CQRSFrom the course tutorial [.NET 8 Microservices](https://www.udemy.com/course/microservices-architecture-and-implementation-on-dotnet) by Mehmet Ozkaya.

> _Architecture Diagram_
Thank you very much for sharing your valuable knowledge. It really helps me a lot.
## 🚀 Quick start
To run this project on your computer, you need to have .NET 8 package, MS SQL, PostgreSQL, Docker, Redis, and RabbitMQ installed.
1. **Step 1.**
Clone the project
```sh
git clone https://github.com/HiImLawtSimp1e/EShopMicroservices.git
```
## FrontEnd
- ASP.NET Razor Pages with Refit HTTP Client Factory
- Bootstrap## BackEnd API Gateways
- YARP API Gateway## Catlog Service
> _Catalog Service Architecture Diagram_
- Patterns & Principles
- Vertical Slice Architecture
- CQRS
- Mediator Pattern: for implement CQRS
- Dependency Injection
- Minimal APIs
- ORM Pattern
- Library
- MediatR for CQRS: This library simplifies the implementation of the CQRS pattern.
- Carter for API Endpoints: Routing and handling HTTP request, easier to define API endpoints with clean and concise code.
- Marten ORM for PostgreSQL Interaction: Use PostgreSQL as a Document DB. It leverages PostgreSQL's JSON capabilities for storing, querying, and managing documents.
- Mapster for Object Mapping
- FluentValidation for Input Validation
- Datastore
- PostgreSQL used as a Document database (Marten ORM): By using PostgreSQL's JSON column features, Marten ORM transforms PostgreSQL into `.NET Transactional Document DB`## Basket Service

> _Basket Service Architecture Diagram_
- Patterns & Principles
- Vertical Slice Architecture
- CQRS
- Mediator Pattern: Used for implement CQRS
- Repository Pattern
- Proxy Pattern: Used for implement Redis cache
- Decorator Pattern: Used for implement Redis cache
- Read-Aside Pattern: Caching strategy
- Dependency Injection
- Minimal APIs
- ORM Pattern
- Library
- MediatR for CQRS: This library simplifies the implementation of the CQRS pattern.
- Carter for API Endpoints: Routing and handling HTTP request, easier to define API endpoints with clean and concise code.
- Marten ORM for PostgreSQL Interaction: Use PostgreSQL as a Document DB. It leverages PostgreSQL's JSON capabilities for storing, querying, and managing documents.
- Mapster for Object Mapping
- FluentValidation for Input Validation
- Scrutor for implement decorator pattern: By registering decorator in DI Container
- gRPC for inter service communication
- Redis for distributed cache
- MassTransit for RabbitMQ operations
- Datastore
- PostgreSQL used as a Document database (Marten ORM): By using PostgreSQL's JSON column features, Marten ORM transforms PostgreSQL into `.NET Transactional Document DB`
- Redis distrubuted cache## Discount Service

> _Discount Service Architecture Diagram_
- Patterns & Principles
- N-Layered Architecture
- gRPC Protobuf files Endpoints: for service communication
- ORM Pattern
- Library
- EF Core ORM
- Mapster for Object Mapping
- FluentValidation for Input Validation
-Datastore
- SQLite RDMBS: embedded SQL database optimized for efficient small-scale data storage## Ordering Service

> _Ordering Service Architecture Diagram_
- Common Patterns & Principles
- SOLID
- Clean Architecture
- Tactical Domain-Driven Design: Oriented Microservice
- Dependency Injection#### Core Layers ( Business Logic )
1. Domain Layer
- Patterns & Principles
- Tactical Domain-Driven Design
- DDD Objects (Entities, Value Objects, Aggregates & Aggregate Root)
- Rich-Domain Model
- Domain Events & Integration Events
- ⚠️ Library
- ⚠️ Depends on EF Core: for the ORM to properly recognize Value Objects (instead of treating them as Entities)
- ⚠️ Depends on MediatR: for Domain Events2. Application Layer
- Patterns & Principles
- CQRS
- Mediator Pattern: for implement CQRS
- ⚠️ Library
- ⚠️ Depends on MediatR: Using this library is the quickest and simplest way to implement the CQRS pattern
- ⚠️ Depends on Mapster: for Object Mapping
- ⚠️ Depends on FluentValidation: for Input Validation#### Periphery Layers ( Infrastructure & External Systems )
1. Infrastructure Layer
- Patterns & Principles
- Repository Pattern
- ORM Pattern
- Domain-Driven Design
- Mapping DDD Objects to ORM Entities
- Raise & Dispatch Domain: using EF Core ORM & MediatR
- Library
- EF Core ORM
- Complex Types: suport Value Objects in DDD
- EF Aggregate Root Entities
- Datastore
- MSSQL RBMDS2. Presentation Layer (API Layer)
- Patterns & Principles
- Minimal APIs
- Library
- Carter for API Endpoints: Routing and handling HTTP request, easier to define API endpoints with clean and concise code.