Skip to content

The practical implementation of .NET Aspire using Microservices

License

Notifications You must be signed in to change notification settings

foxminchan/BookWorm

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
  • 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 AI components
    • Text embedding with Nomic Embed Text
    • Support hybrid search with Qdrant
    • Chatbot integration with DeepSeek R1
  • Configure CI/CD with GitHub Actions
  • Deploy with Aspirate on k3d
  • Create documentation for the project
    • Use OpenAPI/Scalar for REST API documentation
    • Provide AsyncAPI for event-driven endpoints
    • Use EventCatalog for event inventory and discovery
    • Integrate Backstage for developer portal experience
  • 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 and metadata management.
  • Basket: Shopping cart functionality.
  • Ordering: Order processing and fulfillment.
  • Notification: Handles email notifications as a Worker Service.
  • Rating: Book review and rating system.
  • Finance: Orchestration service for basket reservation and order processing.

Domain Architecture

Getting Started

Prerequisites

System Requirements

Important

  • AI Components: This project uses DeepSeek R1 for chatbot integration and Nomic Embed Text for text embedding, requiring an Nvidia GPU for local development.
  • Email Services: Production uses SendGrid, while local development uses Mailpit for email testing.

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

Please refer to the Deployment Guide for detailed deployment instructions.

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 create an issue.

License

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