This demo showcases an e-commerce application built using several microservices based on .NET Core, running on Dapr. It illustrates how to integrate small, independent microservices into a larger system, following microservice architectural principles.
- Install & start Docker Desktop
- Install .NET 8.0 SDK or later, and Visual Studio 2022
- Install Dapr CLI
- Install Node.js
The CoolShop application, as depicted in the diagram, is built with .NET Core and Dapr, an event-driven runtime that simplifies the development of resilient microservice applications. It consists of the following microservices:
- The API gateway abstracts the client from the underlying microservices, providing a single entry point for all requests. It is built with YARP (Yet Another Reverse Proxy) and is responsible for routing requests to the appropriate microservices.
- For identity management, the application uses the Keycloak identity and access management solution. Keycloak provides a single sign-on solution for all your applications, allowing you to secure your applications and services with minimum effort.
- The set of core backend microservices includes functionality required for an eCommerce store. Each is self-contained and independent of the others. The services include:
- The catalog service manages the products available in the store.
- The cart service manages the shopping cart for each user.
- The order service manages the orders placed by users.
- The inventory service manages the stock levels of products.
- The promotion service manages the promotions available in the store.
- The notification service sends notifications to users.
- The rating service manages the ratings and reviews of products.
- Each service integrates elements of Clean Architecture and Vertical Slice Architecture, resulting in a clean, maintainable, and testable codebase.
- For website development, the application uses Blazor Interactive Server [This feature is under development].
- Clone the repository:
git clone https://github.com/foxminchan/CoolShop
cd CoolShop
- Start Dapr:
dapr uninstall --all && dapr init
- Install dependencies:
make run
- Run the following command to set the user secrets for the
CoolShop.AppHost
project
dotnet user-secrets set "keycloak-username" "your-username"
dotnet user-secrets set "keycloak-password" "your-password"
dotnet user-secrets set "postgres-user" "postgres"
dotnet user-secrets set "postgres-password" "your-password"
- Start the application:
dotnet run --project ./src/CoolShop.AppHost/CoolShop.AppHost.csproj
Warning
Docker Desktop must be running before starting the application.
If you like this project, please consider supporting it by starring ⭐ and sharing it with your friends!
This project is licensed under the MIT License - see the LICENSE file for details.