Back to Case Studies

CASE STUDY
RES/Ecommerce

Project

RES/Ecommerce

Product

Open Source Ruby Gem

Date

July 2024

Skills

Ruby on Rails

DDD

CQRS

Event Sourcing

Local Caddie: how it works
8
Features completed
1
Developer
6
Months of work
About the project

Ecommerce is a Rails-based e-commerce platform demonstrating advanced architectural patterns in Ruby. The project serves as a comprehensive showcase of Domain-Driven Design (DDD), Command Query Responsibility Segregation (CQRS), and Event Sourcing using the RailsEventStore gem.

Its key objectives include proving modularization is possible in Rails applications, demonstrating DDD implementation in a Ruby context, showcasing event-driven architecture techniques, and providing a practical, reusable example for developers interested in these architectural approaches.

The Problem

The Ruby on Rails world lacked a practical, open source example of advanced architectural patterns like DDD, CQRS, and Event Sourcing. Existing resources were mostly theoretical, without runnable demonstrations in a complex Rails application. This project bridged that gap by creating a comprehensive, executable codebase as a real-world learning resource for developers.

Challenges for 2N
  • Implementing Domain-Driven Design (DDD) requiring a fundamental shift from traditional Rails development approaches
  • Correctly applying Command Query Responsibility Segregation (CQRS) patterns, which demands a sophisticated understanding of system design and separation of concerns
  • Mastering Event Sourcing concepts and practical implementation using RailsEventStore gem, a complex architectural pattern far beyond standard Rails development
  • Creating a modular application structure that breaks away from the conventional Rails monolithic design, challenging traditional development paradigms
  • Designing a test pyramid and implementing mutation testing, which requires advanced testing skills and deep understanding of testing methodologies
  • Balancing architectural complexity with maintainability and readability, ensuring the project remains an educational tool rather than an overly complicated demonstration
In Action
What we did

Vat Rates Support

Flexible system for managing VAT rates, enabling administrators to dynamically create and remove custom tax rates. This feature provides granular control over taxation calculations.

Coupon Codes system

Coupon application system that allows seamless discount implementation during the order process. The feature supports various coupons and validates their applicability in real-time, ensuring accurate price calculations.

Shipment tracking interface

The interface offers administrators a transparent view of order fulfillment status and item-level shipping information.

Code Quality Improvement

Addressed technical debt and fixed existing bugs to enhance overall system reliability and maintainability.

Outcome
Our contribution to the open source project resulted in meaningful development and community engagement. We successfully addressed several existing GitHub issues, adding new functionality and improving the application's overall quality. By participating in this project, we gained deep insights into advanced architectural patterns like Domain-Driven Design, CQRS, and Event Sourcing in the Rails application.
What we accomplished:
  • Contributed to an open source e-commerce platform serving as a reference implementation for advanced architectural patterns.
  • Improved code quality through systematic refactoring and consistent architectural approaches.
  • Helped build a valuable learning resource for Ruby and Rails developers interested in advanced architectural techniques.