Event-driven .NET 10 monorepo using NServiceBus, RabbitMQ transport, Azure Cosmos DB, and Azure Container Apps.
This repository implements an event-driven architecture with:
- NServiceBus 9.x for message-based integration via RabbitMQ transport
- Azure Cosmos DB for single-partition NoSQL persistence
- Azure Container Apps for hosting NServiceBus endpoints with KEDA scaling
- Azure Logic Apps Standard for orchestration workflows
Get started in minutes with zero local setup!
GitHub Codespaces provides a fully configured development environment with:
- β RabbitMQ broker (local message queuing)
- β Cosmos DB Emulator (local database)
- β All 10 microservices pre-configured
- β .NET 10 SDK, Docker, and Node.js
- β GitHub Copilot Chat enabled
- β No Azure subscription required!
Quick Start:
- Click the badge above or go to Code β Codespaces β Create codespace
- Wait ~5-10 minutes for setup
- Run:
docker-compose up -d - Start coding!
See .devcontainer/README.md for full documentation.
RiskInsure/
βββ platform/ # Cross-cutting concerns
β βββ publiccontracts/ # Shared message contracts (events/commands)
β βββ ui/ # Shared UI components
β βββ infra/ # Infrastructure templates (Bicep, Terraform)
βββ services/ # Business-specific bounded contexts
β βββ billing/ # Billing domain service
β βββ payments/ # Payments domain service
β βββ [your-service]/ # Add your services here
βββ copilot-instructions/ # Architectural governance
β βββ constitution.md # Non-negotiable architectural principles
β βββ project-structure.md # Bounded context template
βββ scripts/ # Automation scripts
See βοΈ GitHub Codespaces section above - no local setup required!
No Azure subscription needed! Run everything locally with emulators.
-
Clone and setup:
git clone https://github.com/your-org/RiskInsure.git cd RiskInsure cp .env.emulator .env -
Start emulators:
docker-compose up -d rabbitmq cosmos-emulator
-
Start all services:
docker-compose up -d
-
Run tests:
cd test/e2e npm install npm test
See docs/EMULATOR-SETUP.md for detailed instructions.
For production-like testing:
- .NET 10 SDK
- Docker Desktop
- Azure CLI
- Git
- Azure subscription
-
Clone the repository
git clone https://github.com/your-org/RiskInsure.git cd RiskInsure -
Create Azure resources (one-time):
# Create resource group az group create --name riskinsure-dev --location eastus # Provision RabbitMQ broker (example: local Docker) docker run -d --name rabbitmq \ -p 5672:5672 -p 15672:15672 \ rabbitmq:3-management # Create Cosmos DB account (free tier) az cosmosdb create \ --resource-group riskinsure-dev \ --name riskinsure-dev-cosmos \ --enable-free-tier true
-
Get connection strings and create .env file:
# Create .env file cat > .env << EOF RABBITMQ_CONNECTION_STRING="host=localhost;username=guest;password=guest" COSMOSDB_CONNECTION_STRING="<paste-cosmos-connection-string>" EOF
-
Build the solution
dotnet restore dotnet build
-
Run tests
dotnet test
See copilot-instructions/project-structure.md for the bounded context template.
Quick steps:
- Create folder structure: \services/yourservice/src/{Api,Domain,Infrastructure,Endpoint.In}\
- Start with Domain layer (contracts, models, interfaces)
- Add Infrastructure layer (handlers, repositories)
- Add API layer (HTTP endpoints)
- Configure Endpoint.In (NServiceBus hosting)
- Add all projects to solution: \dotnet sln add \
# Start Cosmos DB and RabbitMQ infrastructure
docker-compose --profile infra up -d
# Verify emulators are healthy
docker-compose ps# Build and start all services (including emulators)
docker-compose up --build
# Or start in detached mode
docker-compose up -d --build- Billing API: http://localhost:7071
- Customer API: http://localhost:7073
- Funds Transfer API: http://localhost:7075
- Policy API: http://localhost:7077
- Rating & Underwriting API: http://localhost:7079
- Cosmos DB Emulator: https://localhost:8081/_explorer/index.html
# Stop all services
docker-compose down
# Stop and remove volumes (clean slate)
docker-compose down -vCosmos Emulator SSL Certificate:
The Cosmos emulator uses a self-signed certificate. In production code, you'll need to configure the CosmosClient to accept the emulator certificate or import it into your trust store.
RabbitMQ Connection:
If you encounter broker connection issues, verify RABBITMQ_CONNECTION_STRING in .env and check the RabbitMQ container health (docker-compose ps).
- Constitution - Non-negotiable architectural rules
- Project Structure - Bounded context template
- Copilot Instructions - Coding assistant rules
- Template Initialization - How this template was initialized
- Domain Layer: 90%+ coverage (pure business logic)
- Application Layer: 80%+ coverage (services, handlers)
- Infrastructure: Integration tests with Cosmos DB emulator
- Framework: xUnit with AAA pattern
See SECURITY.md for vulnerability reporting.
- Review constitution.md principles
- Follow project-structure.md template
- Ensure test coverage meets thresholds
- All PRs require review from @your-org/contributors
[Your License Here]