jandudulski / ecommerce

Application with CQRS and Event Sourcing built on Rails and Rails Event Store

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ecommerce

Application with CQRS and Event Sourcing built on Rails and Rails Event Store.

πŸ‘‰ ecommerce.arkademy.dev

imgur

Domains

Domains exist in directories starting at ecommerce.

ecommerce/
β”œβ”€β”€ crm
β”œβ”€β”€ inventory
β”œβ”€β”€ ordering
β”œβ”€β”€ payments
β”œβ”€β”€ pricing
└── product_catalog
└── shipping

Each one has a README introduction:

Application

Order management application lives at rails_application directory.

This application simulates a process of managing orders.

We start with a list of exiting products and customers (populated with seeds).

UI flow

Customer perspective

The customer perspective is "simulated" only - via using the select box.

  • Add/remove some of the existing products to the order
  • Choose the customer
  • Submit the order
    • after this you can't update the order items or customer
    • it generates the order number like "2021/03/20" (the last part is random(100))
  • Look at the order
  • Look at the history of events (in the Rails Event Store Browser)

Read models

There's only one read model - which helps us listing all the orders and individual order details.

It consists of 2 ActiveRecord classes: Order and OrderItem.

Process Managers

Release payments when order expired

There's a process manager responsible for dealing with the process of expiring orders.

It takes the following events as the input:

  • Ordering::OrderSubmitted
  • Ordering::OrderExpired
  • Ordering::OrderPaid
  • Payments::PaymentAuthorized
  • Payments::PaymentReleased

When certain conditions are met the process manager return a ReleasePayment command.

Confirm order when payment successful

Another process manager is responsible for confirming order. It does it, when a successful payment is detected.

I like it, where can I learn more about all those DDD concepts?

Over time we have developed a number of DDD-related online courses. We now sell them as part of one membership access via arkademy.dev for $49/month.

About

Application with CQRS and Event Sourcing built on Rails and Rails Event Store


Languages

Language:Ruby 85.2%Language:HTML 12.7%Language:Makefile 1.5%Language:CSS 0.4%Language:Shell 0.1%Language:JavaScript 0.1%