BookWorm
BookWorm copied to clipboard
The practical implementation of .NET Aspire using Microservices
trafficstars
BookStore: The practical .NET Aspire
Introduction
⭐ This is a pet project to demonstrate the practical use of .NET Aspire. The project is a cloud-native application with applying Domain-Driven Design (DDD) and Vertical Slice Methodology to organize the codebase.
The Goals of the Project
- [x] Building a cloud-native application with .NET Aspire
- [x] Using
Vertical Slice Architectureto organize the codebase - [x] Using
Domain-Driven Designto design the domain model - [x] Implement the
CQRSpattern withMediatR - [x] Using
RabbitMQon topMassTransitfor messaging - [x] Using
gRPCfor inter-service communication - [x] API versioning
- [x] Health checks
- [x] OpenAPI/Swagger
- [x] AuthN/AuthZ with
Duende IdentityServer - [x] Observability with
.NET Aspire - [x] Add
MailDevfor local email testing - [x] CI/CD with
GitHub Actions - [x] Testing
- [x] Service unit tests
- [ ] Integration tests with
Aspire Testing&WireMock
- [ ] Output Caching, Response Caching and Distributed Caching with Redis
- [ ] Deployment with
Aspirateonk3d - [ ] EDA document with
EventCatalog
Domain Business & Bounded Contexts - Services Boundaries
- Catalog: Display books with pagination and search functionality.
- Basket: Add books to the shopping cart and place an order.
- Ordering: Display orders with pagination and search functionality.
- Identity: Register, login, and manage user profile.
- Notification: Send email notifications.
- Rating: Rate books.

How to run the project
Prerequisites
Setting up user secrets
- Open a terminal
- Run the following command to set the user secrets for the
BookWorm.AppHostproject
dotnet user-secrets set "Parameters:SqlUser" "postgres"
dotnet user-secrets set "Parameters:SqlPassword" "yourcomplexpassword"
dotnet user-secrets set "Parameters:FromEmail" "yourfromemail"
dotnet user-secrets set "ConnectionStrings:openai" "Key=yourapikey"
[!NOTE] You need and OpenAI API key to run the project. You can get one here.
Running the project
- Clone the repository
git clone [email protected]:foxminchan/BookWorm.git
- Run the project
dotnet run --project src/BookWorm.AppHost/BookWorm.AppHost.csproj
[!WARNING] Ensure that you have Docker running on your machine.
Contributing
- Fork the repository
- Create a new branch for your feature
- Make your changes
- Create a pull request
[!CAUTION] Do not change namespaces for
Integration Eventsas it will break the messaging system.
Project References
License
This project is licensed under the MIT License - see the LICENSE file for details.