All Projects → asc-lab → Dotnetcore Microservices Poc

asc-lab / Dotnetcore Microservices Poc

Very simplified insurance sales system made in a microservices architecture using .NET Core

Projects that are alternatives of or similar to Dotnetcore Microservices Poc

Pitstop
This repo contains a sample application based on a Garage Management System for Pitstop - a fictitious garage. The primary goal of this sample is to demonstrate several software-architecture concepts like: Microservices, CQRS, Event Sourcing, Domain Driven Design (DDD), Eventual Consistency.
Stars: ✭ 708 (-45.71%)
Mutual labels:  microservices, rabbitmq, netcore, ddd, cqrs, microservices-architecture, docker-compose
Netcoremicroservicessample
Sample using micro services in .NET Core 3.1 Focusing on clean code
Stars: ✭ 403 (-69.1%)
Mutual labels:  microservices, rabbitmq, dotnet-core, cqrs, microservices-architecture
Stove
Domain Driven Design oriented application framework, meets CRUD needs
Stars: ✭ 160 (-87.73%)
Mutual labels:  rabbitmq, dapper, ddd, cqrs
Cqrs Clean Eventual Consistency
CQRS, using Clean Architecture, multiple databases and Eventual Consistency
Stars: ✭ 247 (-81.06%)
Mutual labels:  rabbitmq, netcore, ddd, cqrs
Bankflix
Aplicação que simula um banco digital, contendo a área do cliente e administrativa, permitindo depósitos e transferências entre contas do mesmo banco. | Application that simulates a digital bank, containing the customer and administrative areas, allowing deposits and transfers between accounts of the same bank.
Stars: ✭ 82 (-93.71%)
Mutual labels:  rabbitmq, dotnet-core, ddd, cqrs
Library
A microservice project using .NET Core 2.0, DDD, CQRS, Event Sourcing, Redis and RabbitMQ
Stars: ✭ 122 (-90.64%)
Mutual labels:  rabbitmq, signalr, netcore, cqrs
Eventflow.example
DDD+CQRS+Event-sourcing examples using EventFlow following CQRS-ES architecture. It is configured with RabbitMQ, MongoDB(Snapshot store), PostgreSQL(Read store), EventStore(GES). It's targeted to .Net Core 2.2 and include docker compose file.
Stars: ✭ 131 (-89.95%)
Mutual labels:  rabbitmq, dotnet-core, ddd, cqrs
Coolstore Microservices
A full-stack .NET microservices build on Dapr and Tye
Stars: ✭ 1,903 (+45.94%)
Mutual labels:  microservices, dotnet-core, ddd, microservices-architecture
Pos
Sample Application DDD, Reactive Microservices, CQRS Event Sourcing Powered by DERMAYON LIBRARY
Stars: ✭ 207 (-84.13%)
Mutual labels:  microservices, netcore, cqrs, microservices-architecture
Practical Clean Ddd
A simplified and effortless approach to get started with Domain-driven Design, Clean Architecture, CQRS, and Microservices patterns
Stars: ✭ 28 (-97.85%)
Mutual labels:  microservices, ddd, cqrs, microservices-architecture
Digital Restaurant
DDD. Event sourcing. CQRS. REST. Modular. Microservices. Kotlin. Spring. Axon platform. Apache Kafka. RabbitMQ
Stars: ✭ 222 (-82.98%)
Mutual labels:  microservices, rabbitmq, ddd, cqrs
Practical.cleanarchitecture
Asp.Net Core 5 Clean Architecture (Microservices, Modular Monolith, Monolith) samples (+Blazor, Angular 11, React 17, Vue 2.6), Domain-Driven Design, CQRS, Event Sourcing, SOLID, Asp.Net Core Identity Custom Storage, Identity Server 4 Admin UI, Entity Framework Core, Selenium E2E Testing, SignalR Notification, Hangfire Tasks Scheduling, Health Checks, Security Headers, ...
Stars: ✭ 639 (-51%)
Mutual labels:  microservices, rabbitmq, signalr, cqrs
Quiz
Example real time quiz application with .NET Core, React, DDD, Event Sourcing, Docker and built-in infrastructure for CI/CD with k8s, jenkins and helm
Stars: ✭ 100 (-92.33%)
Mutual labels:  microservices, rabbitmq, ddd, cqrs
Event Sourcing Jambo
An Hexagonal Architecture with DDD + Aggregates + Event Sourcing using .NET Core, Kafka e MongoDB (Blog Engine)
Stars: ✭ 159 (-87.81%)
Mutual labels:  microservices, dotnet-core, ddd, cqrs
csharp-ddd-skeleton
🦈✨ C# DDD Skeleton: Bootstrap your new C# projects applying Hexagonal Architecture and Domain-Driven Design patterns
Stars: ✭ 67 (-94.86%)
Mutual labels:  cqrs, rabbitmq, ddd, netcore
Akkatecture
a cqrs and event sourcing framework for dotnet core using akka.net
Stars: ✭ 414 (-68.25%)
Mutual labels:  microservices, dotnet-core, ddd, cqrs
Kledex
.NET Standard framework to create simple and clean design. Advanced features for DDD, CQRS and Event Sourcing.
Stars: ✭ 502 (-61.5%)
Mutual labels:  dotnet-core, ddd, cqrs
Dotnet Template Onion
Onion Architecture with .NET 5/.NET Core and CQRS/Event Sourcing following a DDD approach
Stars: ✭ 70 (-94.63%)
Mutual labels:  dotnet-core, ddd, microservices-architecture
Madclones
A collection of frameworks that I love with a strong focus on clean code, testing, software architecture/design and devops.
Stars: ✭ 480 (-63.19%)
Mutual labels:  microservices, microservices-architecture, docker-compose
Shriek Fx
An easy-to-use rapid development framework developed on the basis of.NET Core 2.0, following the constraints of domain Driven Design (DDD) specifications, combined with the CQRS architecture to provide the infrastructure for event-driven, event backtracking, responsiveness, and more. Let developers enjoy the true meaning of object-oriented design patterns brought by the aesthetic.
Stars: ✭ 644 (-50.61%)
Mutual labels:  dotnet-core, ddd, cqrs

ASCLAB .NET Core PoC - LAB Insurance Sales Portal

Build Status

This is an example of a very simplified insurance sales system made in a microservice architecture using:

  • .NET Core 3.1
  • Entity Framework Core
  • MediatR
  • Marten
  • Eureka
  • Ocelot
  • JWT Tokens
  • RestEase
  • RawRabbit
  • NHibernate
  • Polly
  • NEST (ElasticSearch client)
  • Dapper
  • DynamicExpresso
  • SignalR

Comprehensive guide describing exactly the architecture, applied design patterns and technologies can be found on our blog:

Other articles around microservices that could be interesting:

Business Case

We are going to build very simplified system for insurance agents to sell various kind of insurance products. Insurance agents will have to log in and system will present them with list of products they can sell. Agents will be able to view products and find a product appropriate for their customers. Then they can create an offer and system will calculate a price based on provided parameters.
Finally agent will be able to confirm the sale by converting offer to policy and printing pdf certificate.
Portal will also give them ability to search and view offer and policies.
Portal will also have some basic social network features like chat for agents.
Latest feature is a business dashboard that displays sales stats using ElasticSearch Aggregations and ChartJS.

Architecture overview

NET Microservices Architecture

  • Web - a VueJS Single Page Application that provides insurance agents ability to select appropriate product for their customers, calculate price, create an offer and conclude the sales process by converting offer to policy. This application also provides search and view functions for policies and offers. Frontend talks to backend services via agent-portal-gateway.

  • Agent Portal API Gateway - is a special microservice whose main purpose it to hide complexity of the underlying back office services structure from client application. Usually we create a dedicated API gateway for each client app. In case in the future we add a Xamarin mobile app to our system, we will need to build a dedicated API gateway for it. API gateway provides also security barrier and does not allow unauthenticated request to be passed to backend services. Another popular usage of API gateways is content aggregation from multiple services.

  • Auth Service - a service responsible for users authentication. Our security system will be based on JWT tokens. Once user identifies himself correctly, auth service issues a token that is further use to check user permission and available products.

  • Chat Service - a service that uses SignalR to give agents ability to chat with each other.

  • Payment Service - main responsibilities: create Policy Account, show Policy Account list, register in payments from bank statement file.
    This module is taking care of a managing policy accounts. Once the policy is created, an account is created in this service with expected money income. PaymentService also has an implementation of a scheduled process where CSV file with payments is imported and payments are assigned to policy accounts. This component shows asynchronous communication between services using RabbitMQ and ability to create background jobs. It also features accessing database using Dapper.

  • Policy Service - creates offers, converts offers to insurance policies.
    In this service we demonstrated usage of CQRS pattern for better read/write operation isolation. This service demonstrates two ways of communication between services: synchronous REST based calls to PricingService through HTTP Client to get the price, and asynchronous event based using RabbitMQ to publish information about newly created policies. In this service we also access RDBMS using NHibernate.

  • Policy Search Service - provides insurance policy search.
    This module listens for events from RabbitMQ, converts received DTOs to “read model” and indexes given model in ElasticSearch to provide advanced search capabilities.

  • Pricing Service - a service responsible for calculation of price for given insurance product based on its parametrization.
    For each product a tariff should be defined. The tariff is a set of rules on the basis of which the price is calculated. DynamicExpresso was used to parse the rules. During the policy purchase process, the PolicyService connects with this service to calculate a price. Price is calculated based on user’s answers for defined questions.

  • Product Service - simple insurance product catalog.
    It provides basic information about each insurance product and its parameters that can be customized while creating an offer for a customer.

  • Document Service - this service uses JS Report to generate pdf certificates.

  • Dashboard Service - Dashboard that presents sales statistics.
    Business dashboards that presents our agents sales results. Dashboard service subscribes to events of selling policies and index sales data in ElasticSearch. Then ElasticSearch aggregation framework is used to calculate sales stats like: total sales and number of policies per product per time period, sales per agent in given time period and sales timeline. Sales stats are nicely visualized using ChartJS.

Each business microservice has also .Api project (PaymentService.Api, PolicyService.Api etc.), where we defined commands, events, queries and operations and .Test project (PaymentService.Test, PolicyService.Test) with unit and integration tests.

Running with Docker

You must install Docker & Docker Compose before.
Scripts have been divided into two parts:

  • infra.yml runs the necessary infrastructure.
  • app.yml is used to run the application.

You can use scripts to build/run/stop/down all containers.

To run the whole solution:

./infra-run.sh
./app-run.sh

Manual running

Prerequisites

Install PostgreSQL version >= 10.0.

Install RabbitMQ.

Install Elasticsearch version >= 6.

Init databases

Windows

cd postgres
"PATH_TO_PSQL.EXE" --host "localhost" --port EXAMPLE_PORT --username "EXAMPLE_USER" --file "createdatabases.sql"

In my case this command looks like:

cd postgres
"C:\Program Files\PostgreSQL\9.6\bin\psql.exe" --host "localhost" --port 5432 --username "postgres" --file "createdatabases.sql"

Linux

sudo -i -u postgres
psql --host "localhost" --port 5432 --username "postgres" --file "PATH_TO_FILE/createdatabases.sql"

This script should create lab_user user and the following databases: lab_netmicro_payments, lab_netmicro_jobs, lab_netmicro_policy and lab_netmicro_pricing.

Run Eureka

Service registry and discovery tool for our project is Eureka. It is included in the project. In order to start it open terminal / command prompt.

cd eureka-server
./gradlew.[bat] spring-boot:run

This should start Eureka and you should be able to go to http://localhost:8761/ and see Eureka management panel.

Build

Build all projects from command line without test:

Windows

cd scripts
build-without-tests.bat

Linux

cd scripts
./build-without-tests.sh

Build all projects from command with test:

Windows

cd scripts
build.bat

Linux

cd scripts
./build.sh

Run specific service

Go to folder with specific service (PolicyService, ProductService etc) and use dotnet run command.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].