Skip to content

A cloud-native e-commerce app built on Dapr and Aspire

License

Notifications You must be signed in to change notification settings

foxminchan/CoolShop

Repository files navigation

CoolShop Application

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.

Pre-requisites to Run the Application

Architecture Overview

CoolShop Architecture

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].

Running the Application

  1. Clone the repository:
git clone https://github.com/foxminchan/CoolShop
cd CoolShop
  1. Start Dapr:
dapr uninstall --all && dapr init
  1. Install dependencies:
make run
  1. 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"
  1. Start the application:
dotnet run --project ./src/CoolShop.AppHost/CoolShop.AppHost.csproj

Warning

Docker Desktop must be running before starting the application.

Support

If you like this project, please consider supporting it by starring ⭐ and sharing it with your friends!

Project References & Credits

License

This project is licensed under the MIT License - see the LICENSE file for details.

Releases

No releases published

Packages

No packages published

Languages