TelephoneDirectory icon indicating copy to clipboard operation
TelephoneDirectory copied to clipboard

microservices-> .net 6, golang - Docker, Tye, Dapr, Ocelot, RabbitMq, MassTransit, mssql, postgresql, elasticsearch, kibana, jwt

TelephoneDirectory

microservices -> .net 6.0, golang - Docker, Jenkins, Ocelot, RabbitMq, MassTransit, Serilog, Elasticsearch, Kibana, Swagger / SwaggerForOcelot, Jwt, Postgresql, Mssql

If you want to read in detail in Turkish, please visit here

Running the project

The project was created with Code First approach. In this way, we will be able to run the database on the code side. Also, there is a different database for each service. In this way, we are not dependent on only one database. Postgre and Mssql were used as databases. You can switch them easily.

* dotnet ef migrations add Initial
* dotnet ef database update

Note: No need to take any action as the existing migrations in the project are automatically run.

General structure
  • API Gateway -> Ocelot
  • Message Broker -> Rabbitmq
  • Service Bus -> Mass Transit
  • Health Check -> Watchdog - (via slack implementation)
  • Continuous Integration -> Jenkins
  • Logging -> Serilog, elastic search and kibana
  • Databases -> Postgre and Mssql
  • Open Doc -> Swagger and SwaggerForOcelot
  • Applied Pattern -> DDD, Saga Pattern, Mediator, CQRS, Circuit Breaker, Event Sourcing, Publish-Subscribe
  • Tests -> xUnit (via MassTransit) - Mocking, Integration and Functional Tests
Existed microservices
  • Ocelot - Gateway, .net6 - It provides coordination as a gateway.
  • Guide - Postgre, .net6 - We can perform all kinds of CRUD operations related to contacts.
  • Report - Postgre, .net6 - There are some reports on the people in the directory.
  • Auth - MSSQL, .net6 - We keep users. Authentication is done with JWT.
  • Example - No DB, golang - A simple golang project has been created. Its development continues.
  • Saga - Saga Pattern's Orchestration method is used for transaction management.
Installation

Thanks to the docker-compose.yml file, both the tools used and the databases will run properly.

* docker-compose up -d
Testing
  • Unit Tests started to be added. We started to use it with MassTransit for consumers. Also mocking is used.

MassTransit unit testing - video
Unit testing in general - blog - Turkish
Mocking in unit testing - video - Turkish

  • Integration Test:

Integration testing in general - blog - Turkish
Integration testing in general - video - Turkish