Skip to content

Latest commit

Β 

History

History
112 lines (81 loc) Β· 3.49 KB

File metadata and controls

112 lines (81 loc) Β· 3.49 KB

Parallel Docker Builds with Cache

🧾 Order Tracking System

A distributed order processing system built with .NET Clean Architecture, featuring CQRS, RabbitMQ messaging, and dual persistence in SQL Server and MongoDB.

This project demonstrates a scalable microservice pattern using domain events and message queues to decouple the system.


πŸ“ Architecture Overview

API ──> Application ──> Infra ──> RabbitMQ ──> Consumer
                           β”‚                     β”‚
                      SQL Server            MongoDB

πŸ”„ Flow Description

  1. API

    • Exposes endpoints to create and retrieve orders.
    • Triggers a SaveOrderCommand when a POST request is received.
  2. Application

    • Implements CQRS to separate command and query logic.
    • Handles business rules (e.g., inventory validation).
    • Saves the order to SQL Server.
    • Raises an OrderCreatedEvent as a domain event.
  3. Infra

    • Listens for domain events.
    • Publishes messages to RabbitMQ queue (order.created).
  4. Consumer

    • Subscribes to the RabbitMQ queue.
    • Reads order details from SQL.
    • Syncs the order into MongoDB for read-side optimization or analytics.

πŸ› οΈ Tech Stack

Layer Technology
API ASP.NET Core Web API
Application MediatR, CQRS, FluentValidation
Infra Entity Framework Core, RabbitMQ
Consumer Background Worker, MongoDB
Messaging RabbitMQ
Databases SQL Server, MongoDB
Architecture Clean Architecture
DevOps Docker, GitHub Actions (CI/CD)

πŸ“‚ Project Structure

OrderTrackingApp/
β”œβ”€β”€ API                     # Entry point
β”œβ”€β”€ Application             # CQRS, Commands/Queries, COre app logic
β”œβ”€β”€ Application.Contracts   # Interfaces, DTOs, Validation
β”œβ”€β”€ Domain                  # Entities, Value Objects, Events
β”œβ”€β”€ Infrastructure          # Event Handlers, RabbitMQ
β”œβ”€β”€ Consumer                # Background service that syncs to MongoDB
β”œβ”€β”€ ReadPersistence         # MongoDB Read Models
β”œβ”€β”€ Persistence             # EF Core
└── docker-compose.yml      # Services for RabbitMQ, SQL Server, MongoDB

πŸš€ Getting Started

Prerequisites

Run Locally

git clone https://github.com/ParagNaikade/order-tracking-app.git
cd order-tracking-app
docker-compose up --build

Test API

  • POST /api/orders β†’ Creates an order
  • GET /api/orders/{id} β†’ Retrieves an order
  • GET /api/orders β†’ Retrieves paginated list

πŸ§ͺ Features

  • βœ… Clean Architecture (Separation of Concerns)
  • βœ… CQRS with MediatR
  • βœ… Domain Events and Messaging
  • βœ… Async Communication via RabbitMQ
  • βœ… SQL Write DB & MongoDB Read DB (eventual consistency)
  • βœ… Dockerized Microservices

πŸ“¬ Contact

Created with ❀️ by Parag Naikade