Airline Microservice is a simple Airline application that has the basic business scenario for
online reserving flight ticket. Airlines provide transport services for their passengers. All operations of an airline company are controlled by their airline management system.
Domain Driven Design (DDD)implementation.
CQRSimplementation and event driven architecture.
This project is in progress, New features will be added over time.
I will try to register some Issues for my
TODO works, just to not forget and also for tracking my works in future.
High-level plan is represented in the table
|API Gateway||Completed ✔️|
|Identity Service||Completed ✔️|
|Flight Service||Completed ✔️|
|Passenger Service||Completed ✔️|
|Reservation Service||Completed ✔️|
|Building Blocks||In Progress 👷♂️|
.NET 6- .NET Framework and .NET Core, including ASP.NET and ASP.NET Core
MVC Versioning API- Set of libraries which add service API versioning to ASP.NET Web API, OData with ASP.NET Web API, and ASP.NET Core
EF Core- Modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations
Masstransit- Distributed Application Framework for .NET.
MediatR- Simple, unambitious mediator implementation in .NET.
FluentValidation- Popular .NET validation library for building strongly-typed validation rules
Swagger & Swagger UI- Swagger tools for documenting API's built on ASP.NET Core
Serilog- Simple .NET logging with fully-structured events
Polly- Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner
Scrutor- Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection
Opentelemetry-dotnet- The OpenTelemetry .NET Client
DuendeSoftware IdentityServer- The most flexible and standards-compliant OpenID Connect and OAuth 2.x framework for ASP.NET Core
EasyCaching- Open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier.
Mapster- Convention-based object-object mapper in .NET.
Hellang.Middleware.ProblemDetails- A middleware for handling exception in .Net Core
IdGen- Twitter Snowflake-alike ID generator for .Net
Yarp- Reverse proxy toolkit for building fast proxy servers in .NET
Tye- Developer tool that makes developing, testing, and deploying microservices and distributed applications easier
Identity Service: The Identity Service is a bounded context for authenticate and authorize users through with Identity Server. Also, this service is responsible for creating users and their corresponding roles and permission with using .Net Core Identity and Jwt authentication and authorization.
Flight Service: The Flight Service is a bounded context for all operation related to flight and get available filght and seat.
Passenger Service: The Passenger Service is a bounded context for managing our passengers information, track the activities and subscribing to get notification for out of stock products
Reservation Service: The Passenger Service is a bounded context for managing all operation related to reserve flight ticket.
I used a mediator pattern with using MediatR library in my controllers for a clean and thin controller, also instead of using a
application service class because after some times our controller will depends to different services and this breaks single responsibility principle. We use mediator pattern to manage the delivery of messages to handlers. One of the advantages behind the mediator pattern is that it allows the application code to define a pipeline of activities for requests . For example in our controllers we create a command and send it to mediator and mediator will route our command to a specific command handler in application layer.
To support Single Responsibility Principle and Don't Repeat Yourself principles, the implementation of cross-cutting concerns is done using the mediatr pipeline behaviors or creating a mediatr decorators.
Also here I used cqrs for decompose my features to very small parts that make our application
I treat each request as a distinct use case or slice, encapsulating and grouping all concerns from front-end to back.
When adding or changing a feature in an application in n-tire architecture, we are typically touching many different "layers" in an application. we are changing the user interface, adding fields to models, modifying validation, and so on. Instead of coupling across a layer, we couple vertically along a slice. we
between slices, and
in a slice.
With this approach, each of our vertical slices can decide for itself how to best fulfill the request. New features only add code, we're not changing shared code and worrying about side effects.
With using CQRS pattern, we cut each business functionality into some vertical slices, and inner each of this slices we have technical folders structure specific to that feature (command, handlers, infrastructure, repository, controllers, ...). In Our CQRS pattern each command/query handler is a separate slice. This is where you can reduce coupling between layers. Each handler can be a separated code unit, even copy/pasted. Thanks to that, we can tune down the specific method to not follow general conventions (e.g. use custom SQL query or even different storage). In a traditional layered architecture, when we change the core generic mechanism in one layer, it can impact all methods.
Run infrastructer on docker with this Infrastructure-docker-compose.yaml file with bellow command in root of application:
docker-compose -f ./deployments/Infrastructure-docker-compose.yaml up -d
Run this app on docker with this docker-compose.yaml file with bellow command in root of application:
docker-compose -f ./deployments/docker-compose.yaml up -d
If you like my work, feel free to:
Thanks a bunch for supporting me!
Contributions are always welcome! Please take a look at the contribution guidelines pages first.
Thanks to all contributors, you're awesome and wouldn't be possible without you! The goal is to build a categorized community-driven collection of very well-known resources.
Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users.
🧺 A practical store microservices sample, built with Golang, Domain-Driven Design, CQRS, Event Sourcing, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
🛍️ A practical e-commerce microservices sample, built with C#, .Net Core, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
a simple blog and otp Authentication with django rest framework
a sample clean architecture project with jetpack compose
List of awesome tips and tricks, resources, videos and articles in .net, software architecture, microservice and cloud-native