{"id":20719362,"url":"https://github.com/arafatsabbir/eshop-microservice-dotnet","last_synced_at":"2026-04-02T03:02:36.284Z","repository":{"id":160857401,"uuid":"635186261","full_name":"ArafatSabbir/eshop-microservice-dotnet","owner":"ArafatSabbir","description":"Microservices on .Net platforms which used Asp.Net Web API, Docker, RabbitMQ, MassTransit, gRPC, Ocelot API Gateway, MongoDB, Redis, PostgreSQL, SqlServer, Dapper, Entity Framework Core, CQRS and Clean Architecture implementation. ","archived":false,"fork":false,"pushed_at":"2023-07-12T21:05:52.000Z","size":96,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-14T08:42:32.964Z","etag":null,"topics":["api-gateway","asp-net-core","clean-architecture","cqrs-pattern","csharp","dapper","docker","dotnet","entity-framework-core","grpc","masstransit","mongodb","postgresql","rabitmq","rest-api","sql-server"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArafatSabbir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-02T06:39:38.000Z","updated_at":"2024-07-09T18:21:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0b1364c-496a-4644-bcc8-4bde735fcda6","html_url":"https://github.com/ArafatSabbir/eshop-microservice-dotnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ArafatSabbir/eshop-microservice-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArafatSabbir%2Feshop-microservice-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArafatSabbir%2Feshop-microservice-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArafatSabbir%2Feshop-microservice-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArafatSabbir%2Feshop-microservice-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArafatSabbir","download_url":"https://codeload.github.com/ArafatSabbir/eshop-microservice-dotnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArafatSabbir%2Feshop-microservice-dotnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gateway","asp-net-core","clean-architecture","cqrs-pattern","csharp","dapper","docker","dotnet","entity-framework-core","grpc","masstransit","mongodb","postgresql","rabitmq","rest-api","sql-server"],"created_at":"2024-11-17T03:16:56.651Z","updated_at":"2026-04-02T03:02:36.256Z","avatar_url":"https://github.com/ArafatSabbir.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eshop Microservice in .NET 6\nSee the overall picture of **implementations on microservices with .net tools** on real-world **e-commerce microservices** project;\n\n![microservices_remastered](https://user-images.githubusercontent.com/1147445/110304529-c5b70180-800c-11eb-832b-a2751b5bda76.png)\n\nThere is a couple of microservices that implemented **e-commerce** modules over **Catalog, Basket, Discount** and **Ordering** microservices with **NoSQL (MongoDB, Redis)** and **Relational databases (PostgreSQL, SQL Server)** with communicating over **RabbitMQ Event-Driven Communication** and using **Ocelot API Gateway**.\n\n## What Including In This Repository\nWe have implemented the below **features over the eshop-microservice-dotnet repository**.\n\n#### Catalog microservice which includes; \n* ASP.NET Core Web API application \n* REST API principles, CRUD operations\n* **MongoDB database** connection and containerization\n* Repository Pattern Implementation\n* Swagger Open API implementation\t\n\n#### Basket microservice which includes;\n* ASP.NET Web API application\n* REST API principles, CRUD operations\n* **Redis database** connection and containerization\n* Consume Discount **Grpc Service** for inter-service sync communication to calculate product final price\n* Publish BasketCheckout Queue with using **MassTransit and RabbitMQ**\n  \n#### Discount microservice which includes;\n* ASP.NET **Grpc Server** application\n* Build a Highly Performant **inter-service gRPC Communication** with Basket Microservice\n* Exposing Grpc Services with creating **Protobuf messages**\n* Using **Dapper for micro-orm implementation** to simplify data access and ensure high performance\n* **PostgreSQL database** connection and containerization\n\n#### Microservices Communication\n* Sync inter-service **gRPC Communication**\n* Async Microservices Communication with **RabbitMQ Message-Broker Service**\n* Using **RabbitMQ Publish/Subscribe Topic** Exchange Model\n* Using **MassTransit** for abstraction over the RabbitMQ Message-Broker system\n* Publishing BasketCheckout event queue from Basket microservices and Subscribing to this event from Ordering microservices\t\n* Create **RabbitMQ EventBus.Messages library** and add references Microservices\n\n#### Ordering Microservice\n* Implementing **DDD, CQRS, and Clean Architecture** with using Best Practices\n* Developing **CQRS using MediatR, FluentValidation, and AutoMapper packages**\n* Consuming **RabbitMQ** BasketCheckout event queue with using **MassTransit-RabbitMQ** Configuration\n* **SqlServer database** connection and containerization\n* Using **Entity Framework Core ORM** and auto migrate to SqlServer when application startup\n\t\n#### API Gateway Ocelot Microservice\n* Implement **API Gateways with Ocelot**\n* Sample microservices/containers to reroute through the API Gateways\n* Run multiple different **API Gateway/BFF** container types\t\n* The Gateway aggregation pattern in Shopping.Aggregator\n\n#### WebUI ShoppingApp Microservice\n* ASP.NET Core Web Application with Bootstrap 4 and Razor template\n* Call **Ocelot APIs with HttpClientFactory** and **Polly**\n\n#### Microservices Cross-Cutting Implementations\n* Implementing **Centralized Distributed Logging with Elastic Stack (ELK); Elasticsearch, Logstash, Kibana and SeriLog** for Microservices\n* Use the **HealthChecks** feature in back-end ASP.NET microservices\n* Using **Watchdog** in a separate service that can watch health and load across services, and report health about the microservices by querying with the HealthChecks\n\n#### Microservices Resilience Implementations\n* Making Microservices more **resilient Use IHttpClientFactory** to implement resilient HTTP requests\n* Implement **Retry and Circuit Breaker patterns** with exponential backoff with IHttpClientFactory and **Polly policies**\n\n#### Ancillary Containers\n* Use **Portainer** for Container lightweight management UI which allows you to manage your different Docker environments easily\n* **pgAdmin PostgreSQL Tools** feature rich Open Source administration and development platform for PostgreSQL\n\n#### Docker Compose establishment with all microservices on docker;\n* Containerization of microservices\n* Containerization of databases\n* Override Environment variables\n\n## Run The Project\nYou will need the following tools:\n\n* [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)\n* [.Net 6](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)\n* [Docker Desktop](https://www.docker.com/products/docker-desktop)\n\n### Installing\nFollow these steps to get your development environment set up: (Before Run Start the Docker Desktop)\n1. Clone the repository\n2. Once Docker for Windows is installed, go to the **Settings \u003e Advanced option**, from the Docker icon in the system tray, to configure the minimum amount of memory and CPU like so:\n* **Memory: 4 GB**\n* CPU: 2\n3. At the root directory which include **docker-compose.yml** files, run below command:\n```csharp\ndocker-compose -f docker-compose.yml -f docker-compose.override.yml up -d\n```\n\n\u003eNote: If you get a connection timeout error Docker for Mac please [Turn Off Docker's \"Experimental Features\".](https://github.com/aspnetrun/run-aspnetcore-microservices/issues/33)\n\n4. Wait for docker compose all microservices. That’s it! (some microservices need extra time to work so please wait if they are not working in the first shot)\n\n5. You can **launch microservices** as below URLs:\n\n* **Catalog API -\u003e http://host.docker.internal:8000/swagger/index.html**\n* **Basket API -\u003e http://host.docker.internal:8001/swagger/index.html**\n* **Discount API -\u003e http://host.docker.internal:8002/swagger/index.html**\n* **Ordering API -\u003e http://host.docker.internal:8004/swagger/index.html**\n\n* **pgAdmin PostgreSQL -\u003e http://host.docker.internal:5050**   -- admin@aspnetrun.com/admin1234\n* **Portainer -\u003e http://host.docker.internal:9000**   -- admin/admin1234\n* **Rabbit Management Dashboard -\u003e http://host.docker.internal:15672**   -- guest/guest\n\n\u003c!--\n* **Shopping.Aggregator -\u003e http://host.docker.internal:8005/swagger/index.html**\n* **API Gateway -\u003e http://host.docker.internal:8010/Catalog**\n* **Rabbit Management Dashboard -\u003e http://host.docker.internal:15672**   -- guest/guest\n* **Portainer -\u003e http://host.docker.internal:9000**   -- admin/admin1234\n* **pgAdmin PostgreSQL -\u003e http://host.docker.internal:5050**   -- admin@aspnetrun.com/admin1234\n* **Elasticsearch -\u003e http://host.docker.internal:9200**\n* **Kibana -\u003e http://host.docker.internal:5601**\n\n* **Web Status -\u003e http://host.docker.internal:8007**\n* **Web UI -\u003e http://host.docker.internal:8006**\n\n5. Launch http://host.docker.internal:8007 in your browser to view the Web Status. Make sure that every microservices are healthy.\n6. Launch http://host.docker.internal:8006 in your browser to view the Web UI. You can use Web project in order to **call microservices over API Gateway**. When you \n--\u003e\n**checkout the basket** you can follow **queue record on RabbitMQ dashboard**.\n\u003c!--\n![mainscreen2](https://user-images.githubusercontent.com/1147445/81381837-08226000-9116-11ea-9489-82645b8dbfc4.png)\n--\u003e\n\n\u003eNote: If you are running this application in macOS then use `docker.for.mac.localhost` as DNS name in `.env` file and the above URLs instead of `host.docker.internal`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farafatsabbir%2Feshop-microservice-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farafatsabbir%2Feshop-microservice-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farafatsabbir%2Feshop-microservice-dotnet/lists"}