Skip to content

This is an example insurance company for understanding azure, architecture, and integration

Notifications You must be signed in to change notification settings

AIS-Commercial-Business-Unit/RiskInsure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

138 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RiskInsure

Event-driven .NET 10 monorepo using NServiceBus, RabbitMQ transport, Azure Cosmos DB, and Azure Container Apps.

πŸ—οΈ Architecture

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

☁️ GitHub Codespaces (Recommended for New Developers)

Get started in minutes with zero local setup!

Open in GitHub Codespaces

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:

  1. Click the badge above or go to Code β†’ Codespaces β†’ Create codespace
  2. Wait ~5-10 minutes for setup
  3. Run: docker-compose up -d
  4. Start coding!

See .devcontainer/README.md for full documentation.

πŸ“ Repository Structure

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

πŸš€ Getting Started

Option 1: GitHub Codespaces (Easiest)

See ☁️ GitHub Codespaces section above - no local setup required!

Option 2: Local Development with Emulators

No Azure subscription needed! Run everything locally with emulators.

  1. Clone and setup:

    git clone https://github.com/your-org/RiskInsure.git
    cd RiskInsure
    cp .env.emulator .env
  2. Start emulators:

    docker-compose up -d rabbitmq cosmos-emulator
  3. Start all services:

    docker-compose up -d
  4. Run tests:

    cd test/e2e
    npm install
    npm test

See docs/EMULATOR-SETUP.md for detailed instructions.

Option 3: Local Development with Azure Resources

For production-like testing:

Prerequisites

First-Time Setup

  1. Clone the repository

    git clone https://github.com/your-org/RiskInsure.git
    cd RiskInsure
  2. 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
  3. 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
  4. Build the solution

    dotnet restore
    dotnet build
  5. Run tests

    dotnet test

Creating Your First Service

See copilot-instructions/project-structure.md for the bounded context template.

Quick steps:

  1. Create folder structure: \services/yourservice/src/{Api,Domain,Infrastructure,Endpoint.In}\
  2. Start with Domain layer (contracts, models, interfaces)
  3. Add Infrastructure layer (handlers, repositories)
  4. Add API layer (HTTP endpoints)
  5. Configure Endpoint.In (NServiceBus hosting)
  6. Add all projects to solution: \dotnet sln add \

Docker Compose Development

Start Infrastructure Only (SQL Server and Emulators)

# Start Cosmos DB and RabbitMQ infrastructure
docker-compose --profile infra up -d

# Verify emulators are healthy
docker-compose ps

Start All Services

# Build and start all services (including emulators)
docker-compose up --build

# Or start in detached mode
docker-compose up -d --build

Access Services

Stop Services

# Stop all services
docker-compose down

# Stop and remove volumes (clean slate)
docker-compose down -v

Troubleshooting

Cosmos 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).

πŸ“– Documentation

πŸ§ͺ Testing Strategy

  • 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

πŸ” Security

See SECURITY.md for vulnerability reporting.

πŸ“‹ Contributing

  1. Review constitution.md principles
  2. Follow project-structure.md template
  3. Ensure test coverage meets thresholds
  4. All PRs require review from @your-org/contributors

πŸ“„ License

[Your License Here]

About

This is an example insurance company for understanding azure, architecture, and integration

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •