Skip to content

Varagos/MinasPhone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

182 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MinasPhone: E-commerce Modular Monolith with NestJS, CQRS & DDD

A clean architecture implementation of an e-commerce system using NestJS, CQRS, and Domain-Driven Design principles.

🏗️ Architecture Overview

This project demonstrates a microservices-based e-commerce platform with clear separation of concerns through:

  • Clean Architecture with distinct layers
  • CQRS (Command Query Responsibility Segregation) for scalable read/write operations
  • Domain-Driven Design principles for business logic organization
  • Event-driven communication between bounded contexts
  • Saga Choreography for distributed transaction management
Image

📦 Current Modules

Core Domains

  • User Management - User registration, authentication, and profile management
  • Product Catalog - Product creation, updates, and inventory management
  • Order Processing - Order lifecycle with saga-based orchestration
  • Notifications - Event-driven messaging system

Planned Modules

  • Shipping - Delivery management and tracking
  • Marketing - Campaigns and promotions
  • Analytics - Business intelligence and reporting

🎯 Key Features

  • Stock Data Integrity - Saga choreography ensures consistent inventory management
  • Event Sourcing - Complete audit trail of domain events (TODO)
  • Scalable Architecture - Independent scaling of read/write operations
  • Type Safety - Full TypeScript implementation
  • Clean Boundaries - Clear separation between domains

🔄 Order Processing Flow

The order processing implements a saga choreography pattern that guarantees data consistency across multiple services:

  1. Order Creation → Validates customer and initiates process
  2. Stock Reservation → Ensures product availability
  3. Order Confirmation → Confirms successful reservation
  4. Notification Dispatch → Sends confirmation emails
  5. Compensation → Automatic rollback on failures

💳 Payment Support

Currently supports in-store payments only. Online payment integration planned for future releases.

🚀 Getting Started

# Clone the repository
git clone <repository-url>

# View Readme in /server for details

📖 Documentation

🤝 Contributing

This project serves as a reference implementation for clean architecture principles in NestJS. Contributions and discussions are welcome!

📄 License

MIT


Built with ❤️ using NestJS, TypeScript, and Clean Architecture principles

About

An ecommerce webapp built with Domain Driven Design & Hexagonal Architecture in mind

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors