Skip to content

The practical implementation of .NET Aspire using Microservices

License

Notifications You must be signed in to change notification settings

foxminchan/BookWorm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1e4d39f · Mar 29, 2025

History

63 Commits
Mar 25, 2025
Mar 27, 2025
Mar 28, 2025
Mar 13, 2025
Mar 25, 2025
Mar 20, 2025
Mar 25, 2025
Mar 27, 2025
Mar 29, 2025
Mar 13, 2025
Mar 13, 2025
Mar 25, 2025
Mar 13, 2025
Mar 28, 2025
Mar 28, 2025
Mar 25, 2025
Mar 28, 2025
Mar 13, 2025
Mar 27, 2025
Mar 28, 2025
Mar 26, 2025
Mar 13, 2025
Mar 20, 2025

Repository files navigation

CI Coverage Duplicated Lines (%) Netlify Status

📖 BookWorm: A Practical .NET Aspire Application

Introduction

⭐ BookWorm demonstrates the practical implementation of .NET Aspire in a cloud-native application. The project employs Domain-Driven Design (DDD) and Vertical Slice Architecture to organize the codebase effectively.

Project Goals

  • Build a cloud-native application with .NET Aspire
  • Implement Vertical Slice Architecture for codebase organization
  • Apply Domain-Driven Design principles
  • Implement CQRS pattern with MediatR
  • Utilize RabbitMQ with MassTransit for messaging
  • Implement gRPC for service-to-service communication
  • Implement Saga patterns (Orchestration & Choreography) with MassTransit
  • Implement Event Sourcing
  • Implement Outbox Pattern and Inbox Pattern for messaging
  • Support API versioning
  • Implement comprehensive health checks
  • Provide OpenAPI/Scalar documentation
  • Enable feature flags to control application behavior
  • Implement AuthN/AuthZ with Keycloak
  • Enable observability with .NET Aspire
  • Integrate Mailpit for local email testing
  • Integrate with DeepSeek R1 & Nomic Embed Text
    • Text embedding with Nomic Embed Text
    • Support hybrid search with Qdrant
    • Chatbot integration with DeepSeek R1
  • Create EDA documentation with EventCatalog and AsyncAPI
  • Configure CI/CD with GitHub Actions
  • Deploy with Aspirate on k3d
  • Implement testing strategy
    • Service unit tests
    • Integration tests

Project Architecture

BookWorm is structured as a microservices-based application with the following services:

  • Catalog: Book inventory management with search and pagination
  • Basket: Shopping cart functionality
  • Ordering: Order processing and fulfillment
  • Identity: User authentication and profile management
  • Notification: Email notification services (Worker Service)
  • Rating: Book review and rating system
  • Finance: Orchestration service for basket reservation and order processing

Domain Architecture

Getting Started

Prerequisites

Important

In this project, we use DeepSeek R1 & Nomic Embed Text. So, you must have an Nvidia GPU to run the application.

In Production, we use SendGrid for email services. But, for local development, we use Mailpit.

Run the Application

  1. Clone the repository

    git clone git@github.com:foxminchan/BookWorm.git
  2. Change directory to the repository

    cd BookWorm
  3. Run the application

    make run

Warning

Docker must be running on your machine before starting the application.

Deploy the Application

There are two ways to deploy the application to a Kubernetes cluster using Aspirate:

  • Method 1: Deploy to Azure Kubernetes Service (AKS):

    bash ./deploys/scripts/deploy.sh
  • Method 2: Deploy to k3d:

    dotnet aspire apply --non-interactive -p ./src/BookWorm.AppHost

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us. Thank you for contributing to BookWorm!

Support

  • If you like this project, please give it (⭐) a star.
  • If you have any issues or feature requests, please open an issue.

License

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