Skip to content

This is a demo with two ASP .NET 6 microservices using RabbitMQ and Docker

License

Notifications You must be signed in to change notification settings

ozzShpigel/MicroserviceDemo

Repository files navigation

Quality Gate Status   .NET 6.0   Built With Docker   CI Build   FOSSA Status   codecov

The main idea of creating this project is implementing an infrastructure for up and running distributed system with the latest technology and architecture like CQRS, DDD, RabbitMq, and we will not deal mainly with business. 🚀

Table of Contents

The Goals of This Project

  • ❇️ Using Domain Driven Design (DDD) to implement all business processes in microservices.
  • ❇️ Using Rabbitmq for Event Driven Architecture between our microservices.
  • ❇️ Using CQRS implementation with MediatR library.
  • ❇️ Using Fluent Validation and a Validation Pipeline Behaviour on top of MediatR.
  • ❇️ Using Docker-Compose for our deployment mechanism.
  • ❇️ Using GitHub Actions for automation processes.
  • ❇️ Using Terraform for buiding the environment.
  • ❇️ Using Minikube for build development environment.
  • ❇️ Using Helm for installing the environment.

Plan

🌀This project is a work in progress, new features will be added over time.🌀

I will try to register future goals and additions in the Issues section of this repository.

High-level plan is represented in the table

Feature Status
Cusomer Service Completed ✔️
Order Service Completed ✔️

❤️ Technologies - Libraries

  • ✔️ .NET 6 - .NET Framework and .NET Core, including ASP.NET and ASP.NET Core with ASP.NET Web API, and ASP.NET Core
  • ✔️ EF Core - Modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations
  • ✔️ MediatR - Simple, unambitious mediator implementation in .NET.
  • ✔️ FluentValidation - Popular .NET validation library for building strongly-typed validation rules
  • ✔️ Swagger & Swagger UI - Swagger tools for documenting API's built on ASP.NET Core Net Core
  • ✔️ xUnit.net - A free, open source, community-focused unit testing tool for the .NET Framework.

The Domain And Bounded Context - Service Boundary

  • Customer Service: The Customer Service is a bounded context CRUD service to handle customer related operations.

  • Order Service: The Order Service is a bounded context CRUD service to handle order related operations.

How to build development environment on minikube :

Start Minikube:

minikube start

Build the docker images:

docker build -f "./CustomerApi/CustomerApi/Dockerfile" --force-rm -t  customer-app:latest "./CustomerApi"
docker build -f "./OrderApi/OrderApi/Dockerfile" --force-rm -t  order-app:latest "./OrderApi"

Load the local images into the minikube cluster:

minikube image load customer-app:latest
minikube image load order-app:latest

Then enter to helm repository and install the charts:

helm install release .\charts\ -f .\charts\values.yaml

For applying access all the endpoints with urls :

kubectl port-forward svc/customer-api-service 3001:8080
kubectl port-forward svc/order-api-service 3002:8080
minikube tunnel

Then access endpoints with urls :

# Browsing customer & order microservices
http://localhost:3001/swagger/index.html
http://localhost:3002/swagger/index.html

# Browsing rabbitmq
http://localhost:1433

# Conncting customer & order databases from sql managment studio
localhost,81
localhost,82

Support

If you like my work, feel free to:

  • ⭐ this repository. And we will be happy together :)

Thanks a bunch for supporting me!

License

The code in this project is released under the MIT License.

FOSSA Status