When you work on a non-trivial e-commerce application the complexity is usually, well non-trivial too.
E-commerce is one of this kind of apps, where just following a CRUD approach may not be enough.
Here is a list of modules (definitely not a full list) that might be worth having as separate, in order to avoid coupling.
Ordering
This is a classic one. If you have no modules in your e-commerce code then you can call it Ordering anyway, because that's the most important.
Some possible operations (commands) here:
- initiate an order (usually with some items from the cart)
- confirm the order (so that other modules are aware)
Ecommerce
I recently like to call this Ecommerce - a module which contains the logic around the cart concept.
Catalog
This module allows adding products to the offer visible to the clients.
Inventory
Keep track of how many items are left. Sometimes booking too.
Pricing
Pricing is usually not as trivial as just assigning a price to one product. USually we have a whole range of pricing strategies that change over time. It's nice to encapsulate them and keep it separate from other modules.
Payments
Keep track of what was paid for. Sometimes your order will be paid in multiple payments, sometimes it's not fully paid. Sometimes you pay for multiple orders with one payment - hadle this logic here.
Sample application with ecommerce modules
I'm working on sample application which shows some of those concepts. It started as a ordering system, but now it's in a process of becoming an e-commerce app too.
https://github.com/RailsEventStore/cqrs-es-sample-with-res
Are there any other modules that you like to extract in ecommerce apps? Share them in the comments :)
Top comments (3)
IMO the following two subdomains are missing unless you didn't include them elsewhere:
Good point!
I was wondering if
Customers
could be calledCRM
- what do you think? Is it the same concepts?Agree on Shipments (sometimes can be called Delivery too).
Yes, I confirm that Customers are related to CRM