Dukan - Multi Tenant SaaSbased E-commerce Platform
Multi-tenant e-commerce platform with 3 .NET 10 microservices (Clean Architecture + CQRS) and Next.js 16 frontend.
system architecture & data flow
Log 005 · Engineering Specification
architectural specification & system patterns
Clean Architecture Foundation
Designed a strict layered architecture across three microservices — Domain, Application, Infrastructure, Host — ensuring dependencies flow inward and the domain remains framework-agnostic.
Multi-Tenant Isolation
Implemented shared-database multi-tenancy with EF Core global query filters, tenant interceptors for auto-stamping, and tenant resolution middleware — keeping each merchant's data isolated at the application level.
CQRS via MediatR
Separated commands and queries into distinct handlers with a FluentValidation pipeline behavior — keeping controllers thin as one-liners and centralizing cross-cutting concerns.
Event-Driven Communication
Wired Redis Streams for async cross-service events — order placement triggers notification dispatch through at-least-once delivery with consumer groups for load balancing.
Real-Time Notifications
Built a SignalR hub with Redis backplane for horizontal scaling — delivering in-app alerts, email digests, and WebSocket pushes to the frontend with a strategy-pattern dispatcher.
Media Processing Pipeline
Created a chunked upload protocol → MinIO storage → background SkiaSharp WebP conversion pipeline, generating original, display, and thumbnail variants asynchronously via Hangfire jobs.
Next.js 16 Storefront
Built a responsive frontend with App Router, TanStack Query for server state, and Tailwind v4 — covering merchant dashboards, customer storefronts, and admin panels.
Full Observability Stack
Instrumented the entire system with OpenTelemetry — shipping traces to Tempo, logs to Loki, metrics to Prometheus, all visualized in custom Grafana dashboards with alerting rules.
Testing Strategy
Unit tests with xUnit and FluentAssertions for backend handlers and dispatchers; Jest with React Testing Library for frontend components and hooks — ensuring critical paths are covered.
Appendix · Roadmap
what ships next
Continuous Refactoring
Keep the codebase modular and aligned with system performance standards.
Extensible Integration
Designed to interface easily with future services and APIs.
Built with clarity. Scaled with discipline.
Seamless merchant store management, low-latency customer checkout, and real-time order processing.

