This project demonstrates an event-driven architecture using .NET 9 Minimal APIs, RabbitMQ message broker, and Docker Compose.
🤖 Created by Augment Agent This project has been fully prepared by Augment Agent, an AI-powered coding assistant developed by Augment Code. This is an educational demonstration project and is not intended for commercial use. Perfect for learning event-driven architecture patterns and modern .NET development practices.
The system consists of three microservices that communicate through events:
- Order API (Port 5001) - Manages orders and publishes order events
- Inventory API (Port 5002) - Manages inventory and subscribes to order events
- Notification API (Port 5003) - Sends notifications and subscribes to order events
Order API → RabbitMQ → Inventory API (reserves stock)
↘ ↗ Notification API (sends emails)
OrderCreatedEvent
- When a new order is createdOrderUpdatedEvent
- When an order status is updatedOrderCancelledEvent
- When an order is cancelled
- Docker and Docker Compose
- .NET 9.0 SDK
- Clone the repository
- Run the entire system:
docker-compose up --build
- Access the APIs:
- Order API: http://localhost:5001/swagger
- Inventory API: http://localhost:5002/swagger
- Notification API: http://localhost:5003/swagger
- RabbitMQ Management: http://localhost:15672 (guest/guest)
For Visual Studio users, the solution includes Docker Compose orchestration support:
- Open the solution in Visual Studio 2022
- Set docker-compose as startup project:
- Right-click on
docker-compose
project in Solution Explorer - Select "Set as Startup Project"
- Right-click on
- Start debugging (F5) or run without debugging (Ctrl+F5)
- Visual Studio will:
- Build all Docker images
- Start all services with debugging support
- Open browser to Order API Swagger UI
- Enable breakpoint debugging in containerized services
- Breakpoint debugging in all APIs
- Hot reload support for code changes
- Volume mounting for real-time file updates
- Integrated logging in Visual Studio output
- Service dependency management with health checks
- Create an Order (POST to Order API):
{
"customerEmail": "customer@example.com",
"items": [
{
"productId": "LAPTOP001",
"productName": "Gaming Laptop",
"quantity": 1,
"unitPrice": 999.99
}
]
}
-
Check Inventory (GET from Inventory API):
- View reserved quantities for products
-
Check Notifications (GET from Notification API):
- View sent notifications for the customer
- Event-Driven Communication: Loose coupling between services
- Message Broker: RabbitMQ for reliable message delivery
- Event Sourcing: All events are logged and traceable
- Microservices: Independent, scalable services
- Minimal APIs: Modern, lightweight API endpoints
- Docker Compose: Easy deployment and orchestration
- Swagger Documentation: Interactive API documentation
- .NET 9.0
- ASP.NET Core Minimal APIs
- Entity Framework Core (In-Memory)
- RabbitMQ
- Docker & Docker Compose
- Swagger/OpenAPI
This project serves as a comprehensive educational resource for:
- Event-Driven Architecture patterns and best practices
- Microservices design and implementation
- .NET 9 Minimal APIs modern development approach
- Message Brokers (RabbitMQ) integration
- Docker containerization and orchestration
- Asynchronous communication between services
This entire project was designed and implemented by Augment Agent, showcasing:
- Advanced code generation capabilities
- Architectural design expertise
- Best practices implementation
- Complete solution delivery from concept to deployment
- Educational Use Only: This project is intended for learning and educational purposes
- Not for Commercial Use: Please do not use this code in commercial applications without proper review and modifications
- Open Source: Feel free to study, modify, and learn from this codebase
- Attribution: When using this project for educational purposes, please credit Augment Agent
- Augment Code: https://www.augmentcode.com
- Event-Driven Architecture: Study the patterns demonstrated in this project
- Microservices: Explore the service boundaries and communication patterns
This project is licensed under the MIT License. See the LICENSE
file for details.