DEV Community

Andrzej Krzywda
Andrzej Krzywda

Posted on

E-commerce modules worth extracting in the code

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.


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)


I recently like to call this Ecommerce - a module which contains the logic around the cart concept.


This module allows adding products to the offer visible to the clients.


Keep track of how many items are left. Sometimes booking too.


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.


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.

Are there any other modules that you like to extract in ecommerce apps? Share them in the comments :)

Top comments (3)

aleron75 profile image
Alessandro Ronchi

IMO the following two subdomains are missing unless you didn't include them elsewhere:

  • Customers
  • Shipments
andrzejkrzywda profile image
Andrzej Krzywda

Good point!

I was wondering if Customers could be called CRM - what do you think? Is it the same concepts?

Agree on Shipments (sometimes can be called Delivery too).

aleron75 profile image
Alessandro Ronchi

Yes, I confirm that Customers are related to CRM