GithubHelp home page GithubHelp logo

mehdihadeli / food-delivery-modular-monolith Goto Github PK

View Code? Open in Web Editor NEW
275.0 8.0 34.0 4.14 MB

๐ŸŒญ A practical food delivery modular monolith, built with .Net 7, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.

License: MIT License

C# 100.00%
clean-architechture cqrs ddd ddd-example domain-driven-design dotnet dotnetcore event-driven-architecture integration-testing message-broker

food-delivery-modular-monolith's Introduction

Hi there, I'm Mehdi Hadeli ๐Ÿ‘‹

I'm a software engineer, specializing in backend development and distributed systems. I have extensive experience in designing and implementing resilient, responsive, scalable, and maintainable systems using C#, .NET, Golang on top of cutting-edge technologies. My interests include microservices, system design, software architecture, domain driven design (DDD), event sourcing, CQRS, DevOps. I love learning, sharing, and facing challenges. Last but not least, I am also an open-source enthusiast.

๐Ÿ›  Technologies & Skils

golang golang dotnet postgres mongodb kubernetes docker azure javascript kafka javascript typescript angular


๐Ÿ’ป Open Source Projects

I always make sure that I find enough time for open source contribution that also helps me expand my knowledge and work with other developers and team globally. here are some of my projects:

  • ๐Ÿ” food-delivery-microservices: A practical food delivery microservices, built with .Net 7, MassTransit, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
  • ๐Ÿ• go-food-delivery-microservices: A practical food delivery microservices, built with golang, domain-driven design, cqrs, event sourcing, vertical slice architecture, event-driven architecture, and the latest technologies.
  • ๐ŸŽฎ mehdihadeli/game-leaderboard-microservices: Implementation of a imaginary Game Leader Board application, based on Event Driven Architecture, Vertical Slice Architecture, Event Sourcing with EventStoreDB, Redis SortedSet and Pub/Sub, SignalR and .Net 8.
  • ๐Ÿš€ mehdihadeli/awesome-software-architecture: A curated list of awesome articles, videos, and other resources to learn and practice software architecture, patterns, and principles.
  • ๐Ÿ‰ mehdihadeli/vertical-slice-api-template: An asp.net core template based on .Net 8, Vertical Slice Architecture, CQRS, Minimal APIs, API Versioning and Swagger.
  • ๐Ÿšƒ mehdihadeli/Go-MediatR: A library for handling mediator pattern and simplified CQRS pattern within an event driven architecture. inspired by csharp MediatR library.
  • โšก FastEndpoints/FastEndpoints - Contributer: A light-weight REST API development framework for ASP.Net 6 and newer.
  • ๐Ÿ“™ davidfowl/TodoApi - Contributer: Todo application with ASP.NET Core Blazor WASM, Minimal APIs and Authentication
  • ๐ŸŒญ mehdihadeli/food-delivery-modular-monolith: A practical food delivery modular monolith, built with .Net 7, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
  • ๐Ÿงช mehdihadeli/tdd-sample: A sample project demonstrating Test-Driven Development (TDD) using .Net 8 and Vertical Slice Architecture based on Minimal APIs in .NET Core
  • ๐Ÿฅท mehdihadeli/go-vertical-slice-template: A Golang boilerplate template, based on Vertical Slice Architecture and CQRS pattern with using Echo, Gorm, Zap, Viper, MediatR for CQRS and sarulabs/di for Dependency Injection.
  • ๐ŸŽฌ mehdihadeli/movie-search-application: A simple movie search app, built with .Net 7, Vertical Slice Architecture and using TMDB APIs and YouTube APIs for searching and details of the movies.

๐Ÿš€ Activities

food-delivery-modular-monolith's People

Contributors

mehdihadeli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

food-delivery-modular-monolith's Issues

Modular DI

Hi, I want to isolate the dependency injection between modules, which means that we can have an interface sharing across modules and each module has it own implementation. Do you have any idea ?
For example I have Catalog module which use IRepository and a MongoDbRepository class for using mongo db.
Another module called Order Module also use IRepository and a EfCoreRepositoryClass for using ef core.

I would like to ask you that how can I inject or can I isolate DI for each Module ?

Service Not Registered, Calling Module from other Module

using BuildingBlocks.Abstractions.CQRS.Command;
using BuildingBlocks.Abstractions.Messaging;
using BuildingBlocks.Abstractions.Messaging.Context;
using BuildingBlocks.Abstractions.Persistence;
using BuildingBlocks.Core.Messaging;
using ECommerce.Modules.Customers.RestockSubscriptions.Features.ProcessingRestockNotification;

namespace ECommerce.Modules.Customers.Products.Features.ReplenishingProductStock.Events.External;

public record ProductStockReplenished(long ProductId, int NewStock, int ReplenishedQuantity) :
    IntegrationEvent,
    ITxRequest;

public class ProductStockReplenishedConsumer : IMessageHandler<ProductStockReplenished>
{
    private readonly ICommandProcessor _commandProcessor;
    private readonly ILogger<ProductStockReplenishedConsumer> _logger;

    public ProductStockReplenishedConsumer(
        ICommandProcessor commandProcessor,
        ILogger<ProductStockReplenishedConsumer> logger)
    {
        _commandProcessor = commandProcessor;
        _logger = logger;
    }

    // If this handler is called successfully, it will send a ACK to rabbitmq for removing message from the queue and if we have an exception it send an NACK to rabbitmq
    // and with NACK we can retry the message with re-queueing this message to the broker
    public async Task HandleAsync(
        IConsumeContext<ProductStockReplenished> messageContext,
        CancellationToken cancellationToken = default)
    {
        var productStockReplenished = messageContext.Message;

        await _commandProcessor.SendAsync(
            new ProcessRestockNotification(productStockReplenished.ProductId, productStockReplenished.NewStock),
            cancellationToken);

        _logger.LogInformation(
            "Sending restock notification command for product {ProductId}",
            productStockReplenished.ProductId);
    }
}

Above SendAsync method works sometimes, sometimes throw an error:

Error constructing handler for request of type MediatR.IRequestHandler`2[ECommerce.Modules.Customers.RestockSubscriptions.Features.ProcessingRestockNotification.ProcessRestockNotification,MediatR.Unit]. Register your handlers with the container. See the samples in GitHub for examples.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.