https://github.com/fkucukkara/event-driven-demo
AI powered EDA Demo
https://github.com/fkucukkara/event-driven-demo
csharp demo docker docker-compose dotnet-core eda educational event-driven-architecture rabbitmq
Last synced: about 2 months ago
JSON representation
AI powered EDA Demo
- Host: GitHub
- URL: https://github.com/fkucukkara/event-driven-demo
- Owner: fkucukkara
- Created: 2025-07-26T21:03:11.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-12-21T13:06:43.000Z (6 months ago)
- Last Synced: 2025-12-22T16:11:35.399Z (6 months ago)
- Topics: csharp, demo, docker, docker-compose, dotnet-core, eda, educational, event-driven-architecture, rabbitmq
- Language: C#
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Event-Driven Architecture Demo with .NET 10
This project demonstrates an event-driven architecture using .NET 10 with C# 14, Minimal APIs, RabbitMQ message broker, and Docker Compose.
This is an educational demonstration project perfect for learning event-driven architecture patterns and modern .NET development practices.
## Architecture Overview
The system consists of three microservices that communicate through events:
1. **Order API** (Port 5001) - Manages orders and publishes order events
2. **Inventory API** (Port 5002) - Manages inventory and subscribes to order events
3. **Notification API** (Port 5003) - Sends notifications and subscribes to order events
## Event Flow
```
Order API → RabbitMQ → Inventory API (reserves stock)
↘ ↗ Notification API (sends emails)
```
### Events Published:
- `OrderCreatedEvent` - When a new order is created
- `OrderUpdatedEvent` - When an order status is updated
- `OrderCancelledEvent` - When an order is cancelled
## Getting Started
### Prerequisites
- Docker and Docker Compose
- .NET 10.0 SDK
### Running with Docker Compose
1. Clone the repository
2. Run the entire system:
```bash
docker-compose up --build
```
3. 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)
### 🐛 Debugging in Visual Studio
For Visual Studio users, the solution includes Docker Compose orchestration support:
1. **Open the solution** in Visual Studio 2022
2. **Set docker-compose as startup project**:
- Right-click on `docker-compose` project in Solution Explorer
- Select "Set as Startup Project"
3. **Start debugging** (F5) or run without debugging (Ctrl+F5)
4. **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
#### 🔧 Debug Configuration Features:
- **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
### Testing the Event Flow
1. **Create an Order** (POST to Order API):
```json
{
"customerEmail": "customer@example.com",
"items": [
{
"productId": "LAPTOP001",
"productName": "Gaming Laptop",
"quantity": 1,
"unitPrice": 999.99
}
]
}
```
2. **Check Inventory** (GET from Inventory API):
- View reserved quantities for products
3. **Check Notifications** (GET from Notification API):
- View sent notifications for the customer
## Key Features
- **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
## Technologies Used
- .NET 10.0 with C# 14
- ASP.NET Core Minimal APIs
- Entity Framework Core (In-Memory)
- RabbitMQ
- Docker & Docker Compose
- Swagger/OpenAPI
---
## 📚 Educational Purpose & Attribution
### 🎓 **Learning Objectives**
This project serves as a comprehensive educational resource for:
- **Event-Driven Architecture** patterns and best practices
- **Microservices** design and implementation
- **.NET 10 with C# 14 Minimal APIs** modern development approach
- **Message Brokers** (RabbitMQ) integration
- **Docker containerization** and orchestration
- **Asynchronous communication** between services
### ⚖️ **License & Usage**
- **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
### 🔗 **Learn More**
- **Event-Driven Architecture**: Study the patterns demonstrated in this project
- **Microservices**: Explore the service boundaries and communication patterns
## License
[](LICENSE)
This project is licensed under the MIT License. See the [`LICENSE`](LICENSE) file for details.