Skip to content

Latest commit

Β 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ RDMicroServis β€” Distributed Mini Commerce Platform

A production-grade, distributed e-commerce platform built with a polyglot microservices architecture. Each service is independently deployable, uses the right database for its workload, and communicates asynchronously through Kafka and RabbitMQ.


πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                          CLIENT LAYER                                        β”‚
β”‚                                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  shop-web    β”‚  β”‚ landing-web  β”‚  β”‚ admin-portal β”‚  β”‚operations-panel β”‚ β”‚
β”‚  β”‚  (Next.js)   β”‚  β”‚  (Next.js)   β”‚  β”‚  (Angular)   β”‚  β”‚   (Angular)     β”‚ β”‚
β”‚  β”‚  :3001       β”‚  β”‚  :3002       β”‚  β”‚  :4201       β”‚  β”‚   :4202         β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚                β”‚                β”‚                   β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚  HTTP/REST
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         BACKEND SERVICES LAYER                               β”‚
β”‚                                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚auth-serviceβ”‚  β”‚order-serviceβ”‚  β”‚notification-svc  β”‚  β”‚audit-service β”‚   β”‚
β”‚  β”‚  (.NET 9)  β”‚  β”‚  (.NET 9)  β”‚  β”‚    (.NET 9)       β”‚  β”‚  (.NET 9)    β”‚   β”‚
β”‚  β”‚  :8001     β”‚  β”‚  :8002     β”‚  β”‚    :8003          β”‚  β”‚  :8004       β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚        β”‚               β”‚                   β”‚                    β”‚            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚analytics-  β”‚  β”‚search-     β”‚  β”‚product-service   β”‚  β”‚payment-svc   β”‚   β”‚
β”‚  β”‚service     β”‚  β”‚indexer-svc β”‚  β”‚  (Node.js/TS)    β”‚  β”‚  (Laravel)   β”‚   β”‚
β”‚  β”‚(.NET 9)    β”‚  β”‚(.NET 9)    β”‚  β”‚  :8007           β”‚  β”‚  :8008       β”‚   β”‚
β”‚  β”‚:8005       β”‚  β”‚:8006       β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜           β”‚                    β”‚            β”‚
β”‚        β”‚               β”‚           β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”            β”‚            β”‚
β”‚        β”‚               β”‚           β”‚inventory-svc β”‚            β”‚            β”‚
β”‚        β”‚               β”‚           β”‚(Node.js/TS)  β”‚            β”‚            β”‚
β”‚        β”‚               β”‚           β”‚:8009         β”‚            β”‚            β”‚
β”‚        β”‚               β”‚           β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚               β”‚                  β”‚                     β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚  Events / Messaging
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      MESSAGING & CACHE LAYER                                 β”‚
β”‚                                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Apache Kafka       β”‚  β”‚    RabbitMQ         β”‚  β”‚       Redis          β”‚ β”‚
β”‚  β”‚  (confluentinc      β”‚  β”‚  (3.13-management)  β”‚  β”‚    (7-alpine)        β”‚ β”‚
β”‚  β”‚   cp-kafka:7.7.0)   β”‚  β”‚  :15672 / :15673   β”‚  β”‚    :16379            β”‚ β”‚
β”‚  β”‚  :19092 (ext)       β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         DATA LAYER                                           β”‚
β”‚                                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ postgres-authβ”‚  β”‚postgres-     β”‚  β”‚postgres-     β”‚  β”‚ mssql-order  β”‚   β”‚
β”‚  β”‚ (auth svc)   β”‚  β”‚analytics     β”‚  β”‚payment       β”‚  β”‚ (order svc)  β”‚   β”‚
β”‚  β”‚  :55432      β”‚  β”‚  :55433      β”‚  β”‚  :55434      β”‚  β”‚  :11433      β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚mongo-        β”‚  β”‚mongo-product β”‚  β”‚mongo-        β”‚  β”‚elasticsearch β”‚   β”‚
β”‚  β”‚notification  β”‚  β”‚(product svc) β”‚  β”‚inventory     β”‚  β”‚(audit/search)β”‚   β”‚
β”‚  β”‚  :27017      β”‚  β”‚  :27018      β”‚  β”‚  :27019      β”‚  β”‚  :19200      β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      OBSERVABILITY LAYER                                     β”‚
β”‚                                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Prometheus  β”‚  β”‚   Grafana    β”‚  β”‚     Loki     β”‚  β”‚    Tempo     β”‚   β”‚
β”‚  β”‚   :19090     β”‚  β”‚   :13000     β”‚  β”‚    :13100    β”‚  β”‚    :14317    β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚    OTel Collector        β”‚  β”‚              Kibana                     β”‚ β”‚
β”‚  β”‚  gRPC :14317 HTTP :14318 β”‚  β”‚              :15601                     β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🧰 Technology Stack

Layer Technology Version
Backend API ASP.NET Core (auth, order, notification, audit, analytics, search-indexer) .NET 9
Backend API Node.js / TypeScript (product, inventory) Node 20 LTS
Backend API Laravel (payment) Laravel 11 / PHP 8.3
Frontend Next.js (shop-web, landing-web) Next.js 14
Frontend Angular (admin-portal, operations-panel) Angular 17
Database PostgreSQL (auth, analytics, payment) 16-alpine
Database MSSQL Server (order) 2022-latest
Database MongoDB (notification, product, inventory) 7
Search Elasticsearch 8.13.4
Cache Redis 7-alpine
Message Broker Apache Kafka + Zookeeper Confluent 7.7.0
Message Queue RabbitMQ 3.13-management
Metrics Prometheus v2.51.2
Dashboards Grafana 10.4.2
Log Aggregation Loki 2.9.7
Distributed Tracing Grafana Tempo 2.4.1
Telemetry OpenTelemetry Collector (contrib) 0.99.0
Log UI Kibana 8.13.4
Containerization Docker + Docker Compose v3.9 spec

πŸ“¦ Services & Port Reference

Backend Services

Service Tech Host Port Container Port Database
auth-service .NET 9 8001 8080 PostgreSQL (authdb)
order-service .NET 9 8002 8080 MSSQL (orderdb)
notification-service .NET 9 8003 8080 MongoDB (notificationdb)
audit-service .NET 9 8004 8080 PostgreSQL + Elasticsearch
analytics-service .NET 9 8005 8080 PostgreSQL (analyticsdb)
search-indexer-service .NET 9 8006 8080 Elasticsearch
product-service Node.js/TS 8007 8080 MongoDB (productdb)
payment-service Laravel/PHP 8008 8080 PostgreSQL (paymentdb)
inventory-service Node.js/TS 8009 8080 MongoDB (inventorydb)

Frontend Applications

Application Tech Host Port Container Port
shop-web Next.js 14 3001 3000
landing-web Next.js 14 3002 3000
admin-portal Angular 17 4201 80
operations-panel Angular 17 4202 80

Infrastructure Services

Service Image Host Port(s)
postgres-auth postgres:16-alpine 55432
postgres-analytics postgres:16-alpine 55433
postgres-payment postgres:16-alpine 55434
mssql-order mssql/server:2022-latest 11433
mongo-notification mongo:7 27017
mongo-product mongo:7 27018
mongo-inventory mongo:7 27019
elasticsearch elasticsearch:8.13.4 19200
redis redis:7-alpine 16379
zookeeper cp-zookeeper:7.7.0 12181
kafka cp-kafka:7.7.0 19092
rabbitmq rabbitmq:3.13-management 15672 (amqp), 15673 (mgmt)

Observability Services

Service Image Host Port(s)
prometheus prom/prometheus:v2.51.2 19090
grafana grafana/grafana:10.4.2 13000
loki grafana/loki:2.9.7 13100
tempo grafana/tempo:2.4.1 14317, 3200
otel-collector otel-collector-contrib:0.99.0 14317 (gRPC), 14318 (HTTP)
kibana kibana:8.13.4 15601

πŸš€ Quick Start

Prerequisites

  • Docker Desktop β‰₯ 4.28 (or Docker Engine + Compose plugin v2)
  • Git
  • 16 GB RAM recommended (all services combined)

Step 1 β€” Clone

git clone https://github.com/AhmetNuri/RDMicroServis.git
cd RDMicroServis

Step 2 β€” Configure environment

cp .env .env.local   # optional: keep .env as-is for local dev
# Edit .env if you need custom passwords or ports

⚠️ .env is committed for development convenience. Never commit .env to a shared/production repo.

Step 3 β€” Start everything

# 1. Start infrastructure (databases, brokers, cache)
docker compose -f compose.base.yml up -d

# 2. Wait for infra to be healthy, then start observability
docker compose -f compose.observability.yml up -d

# 3. Start backend services and frontends (after building service images)
docker compose -f compose.apps.yml up -d

Verify health

# Check all containers are running
docker compose -f compose.base.yml ps
docker compose -f compose.observability.yml ps
docker compose -f compose.apps.yml ps

# Quick health check on auth service
curl http://localhost:8001/health

# Open Grafana
open http://localhost:13000  # admin / Grafana@Str0ng!Pass

Stop everything

docker compose -f compose.apps.yml down
docker compose -f compose.observability.yml down
docker compose -f compose.base.yml down

Tear down with volumes

docker compose -f compose.base.yml down -v
docker compose -f compose.observability.yml down -v

πŸ—‚οΈ Repository Structure

RDMicroServis/
β”œβ”€β”€ compose.base.yml              # Infrastructure: DBs, Kafka, Redis, RabbitMQ
β”œβ”€β”€ compose.apps.yml              # Application services + frontends
β”œβ”€β”€ compose.observability.yml     # Prometheus, Grafana, Loki, Tempo, OTel, Kibana
β”œβ”€β”€ .env                          # Environment variables (dev defaults)
β”œβ”€β”€ .gitignore
β”‚
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ auth-service/             # .NET 9 β€” JWT auth, user management
β”‚   β”œβ”€β”€ order-service/            # .NET 9 β€” Order lifecycle, MSSQL
β”‚   β”œβ”€β”€ notification-service/     # .NET 9 β€” Email/push via Kafka + RabbitMQ
β”‚   β”œβ”€β”€ audit-service/            # .NET 9 β€” Audit log β†’ Elasticsearch
β”‚   β”œβ”€β”€ analytics-service/        # .NET 9 β€” Events β†’ PostgreSQL analytics
β”‚   β”œβ”€β”€ search-indexer-service/   # .NET 9 β€” Kafka consumer β†’ Elasticsearch
β”‚   β”œβ”€β”€ product-service/          # Node.js/TS β€” Product catalog, MongoDB
β”‚   β”œβ”€β”€ payment-service/          # Laravel/PHP β€” Payment processing, PostgreSQL
β”‚   └── inventory-service/        # Node.js/TS β€” Stock management, MongoDB
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ shop-web/                 # Next.js 14 β€” Customer storefront
β”‚   β”œβ”€β”€ landing-web/              # Next.js 14 β€” Marketing landing page
β”‚   β”œβ”€β”€ admin-portal/             # Angular 17 β€” Admin dashboard
β”‚   └── operations-panel/         # Angular 17 β€” Ops & logistics dashboard
β”‚
└── observability/
    β”œβ”€β”€ prometheus/
    β”‚   └── prometheus.yml
    β”œβ”€β”€ grafana/
    β”‚   └── provisioning/
    β”‚       └── datasources/
    β”‚           └── datasources.yml
    β”œβ”€β”€ loki/
    β”‚   └── loki-config.yml
    β”œβ”€β”€ tempo/
    β”‚   └── tempo-config.yml
    └── otel-collector/
        └── otel-collector.yml

πŸ”­ Observability

All .NET services export OpenTelemetry traces/metrics/logs to the OTel Collector. Node.js and Laravel services connect via OTLP HTTP/gRPC.

Tool URL Credentials
Grafana http://localhost:13000 admin / Grafana@Str0ng!Pass
Prometheus http://localhost:19090 β€”
Kibana http://localhost:15601 β€”
RabbitMQ Mgmt http://localhost:15673 rabbituser / Rabbit@Str0ng!Pass

Grafana Datasources (auto-provisioned):

  • Prometheus β€” metrics (default)
  • Loki β€” logs (with TraceID β†’ Tempo deep links)
  • Tempo β€” distributed traces (with service map via Prometheus)

πŸ—ΊοΈ Development Roadmap

Phase 1 β€” Platform Foundation βœ… (current)

  • Docker Compose for all infrastructure, app services, and observability
  • Environment configuration and network topology
  • Observability stack with auto-provisioned Grafana datasources

Phase 2 β€” Auth Service

  • ASP.NET Core 8 with JWT + Refresh Tokens
  • PostgreSQL via EF Core
  • OTLP telemetry, /health, /metrics

Phase 3 β€” Product & Inventory Services

  • Node.js/TypeScript with Express
  • MongoDB via Mongoose
  • Kafka producer (product events β†’ search indexer)

Phase 4 β€” Order Service

  • ASP.NET Core 8 with MSSQL via EF Core
  • Saga orchestration via Kafka
  • Kafka events: order.created, order.paid, order.shipped

Phase 5 β€” Payment Service

  • Laravel 11 with PostgreSQL
  • Stripe/mock payment gateway integration
  • Kafka consumer for order events

Phase 6 β€” Notification Service

  • ASP.NET Core 8 consuming Kafka + RabbitMQ
  • Email (SMTP) and push notification channels
  • MongoDB for notification history

Phase 7 β€” Audit & Search Indexer Services

  • Audit: structured event log to PostgreSQL + Elasticsearch
  • Search Indexer: Kafka consumer indexing products/orders into Elasticsearch

Phase 8 β€” Analytics Service

  • ASP.NET Core 8 Kafka consumer
  • Aggregate events into PostgreSQL analytics schema
  • Grafana dashboard for business KPIs

Phase 9 β€” Frontend Applications

  • shop-web: Next.js 14 App Router + Tailwind CSS
  • landing-web: Next.js 14 static marketing site
  • admin-portal: Angular 17 with Angular Material
  • operations-panel: Angular 17 for logistics and inventory ops

πŸ› οΈ Development Guide

Building a single service

# Build and run just the auth service (infra must be up)
docker compose -f compose.apps.yml up auth-service --build

Running a .NET service locally

cd services/auth-service
dotnet restore
dotnet run
# Connects to localhost ports defined in .env

Running a Node.js service locally

cd services/product-service
npm install
npm run dev

Running the Laravel service locally

cd services/payment-service
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate
php artisan serve --port=8008

Viewing logs

# All services
docker compose -f compose.apps.yml logs -f

# Single service
docker compose -f compose.apps.yml logs -f auth-service

# Infrastructure
docker compose -f compose.base.yml logs -f kafka

Kafka topic management

# List topics
docker exec kafka kafka-topics --bootstrap-server localhost:9092 --list

# Consume from a topic
docker exec kafka kafka-console-consumer \
  --bootstrap-server localhost:9092 \
  --topic order.created \
  --from-beginning

Redis CLI

docker exec -it redis redis-cli -a Redis@Str0ng!Pass

MongoDB Shell

# Connect to product service DB
docker exec -it mongo-product mongosh \
  "mongodb://productuser:Product@Str0ng!Pass@localhost:27017/productdb"

πŸ”’ Security Notes

  • All service-to-service traffic runs on the internal commerce-network Docker bridge
  • Passwords in .env are for development only β€” use secrets management (Vault, AWS Secrets Manager, etc.) in production
  • JWT secret should be rotated per environment
  • Elasticsearch has xpack.security.enabled=false for dev β€” enable for production
  • MSSQL SA account should be replaced with a least-privilege account in production

πŸ“„ License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages