Polyglot mikroservis platformu — periyodik tablo element ticareti, dağıtık saga, API gateway ve tam observability stack.
cp docker/.env.example docker/.env
docker compose --env-file docker/.env up -d --build| Adres | Ne için? |
|---|---|
| localhost:8888 | Kontrol paneli — tüm UI bağlantıları |
| localhost:3000 | Web mağaza arayüzü |
| localhost:5000 | API Gateway (REST) |
| localhost:5000/health-ui | Tüm servislerin sağlık paneli |
| localhost:5002/swagger | Catalog OpenAPI |
Durdurma: docker compose down · Verileri sil: docker compose down -v
flowchart TB
subgraph clients [İstemciler]
Web[web-app :3000]
API[REST / GraphQL]
end
GW[gateway-service :5000]
subgraph public [Gateway üzerinden erişilebilir]
ID[identity :5001]
CAT[catalog :5002]
ORD[order :5003]
NOT[notification :5006]
end
subgraph internal [Mesaj tabanlı — internal]
PAY[payment :5005]
SHP[shipment :5004]
end
subgraph infra [Altyapı]
PG[(PostgreSQL)]
RD[(Redis)]
MQ[RabbitMQ]
end
subgraph obs [Observability]
HUB[hub :8888]
GRA[Grafana :3001]
KIB[Kibana :5601]
JAE[Jaeger :16686]
end
Web --> GW
API --> GW
GW --> ID & CAT & ORD & NOT
ORD -->|saga events| MQ
MQ --> PAY & SHP & CAT & NOT
ID & CAT & ORD & SHP --> PG
CAT & GW --> RD
GW -.-> HUB
POST /api/v1/orders → Submitted
→ catalog (stok ayır) → StockReserved
→ payment (ödeme) → PaymentProcessed
→ shipment (kargo) → ShipmentDispatched
→ Completed
Her servisin kendi README'si endpoint tabloları, ortam değişkenleri ve tek başına çalıştırma adımlarını içerir.
| Servis | Port | Stack | Rol | Dokümantasyon |
|---|---|---|---|---|
| gateway-service | 5000 | .NET YARP + GraphQL | Tek giriş, API key, rate limit | README |
| identity-service | 5001 | .NET 9 | Auth, JWT, API anahtarları | README |
| catalog-service | 5002 | .NET 9 | Element kataloğu, arama, stok | README |
| order-service | 5003 | Node.js 22 | Sipariş + saga orkestrasyonu | README |
| shipment-service | 5004 | .NET 9 | Kargo worker + sorgu API | README |
| payment-service | 5005 | Java 21 | Ödeme worker | README |
| notification-service | 5006 | .NET 9 | SignalR push bildirimleri | README |
| web-app | 3000 | React + Vite | Mağaza UI | README |
| shared-lib | — | .NET lib | Ortak event, logging, ops | README |
| contracts | — | JSON şemalar | Polyglot mesaj sözleşmeleri | README |
Gateway üzerinden (localhost:5000) erişilen rotalar:
| Rota | Hedef | Auth |
|---|---|---|
GET /api/v1 |
Catalog discovery | — |
GET /api/v1/elements/** |
Catalog | History için API key |
GET /api/v1/elements/search?q= |
Catalog arama | — |
GET /api/v1/categories/** |
Catalog | — |
GET /api/v1/statistics/** |
Catalog istatistik | — |
POST /api/v1/auth/register|login |
Identity | — |
* /api/v1/api-keys/** |
Identity | JWT |
* /api/v1/orders/** |
Order | API key (X-API-Key) |
WS /hub/notifications |
Notification SignalR | — |
POST /graphql |
Gateway BFF | — |
Internal (gateway dışı): payment, shipment saga worker'ları; identity POST /api/v1/internal/api-keys/validate.
Keşif: GET http://localhost:5000/info · Sağlık UI: /health-ui
Tüm backend servislerde tutarlı ops yüzeyi:
| Endpoint | Açıklama |
|---|---|
GET /info |
Servis adı, sürüm, ortam, link haritası |
GET /health |
Readiness (bağımlılıklar dahil) |
GET /health/live |
Liveness (process ayakta mı) |
GET /health/ready |
Readiness (DB, Redis, RabbitMQ…) |
GET /metrics |
Prometheus scrape (.NET, Node) |
GET /actuator/prometheus |
Prometheus (payment-service) |
Payment ek olarak: /actuator/health/liveness, /actuator/health/readiness
Platform docker compose up ile izleme stack'ini birlikte başlatır.
| Araç | Port | UI? | Rol |
|---|---|---|---|
| Kontrol paneli | 8888 | ✅ | Tüm UI bağlantıları |
| Grafana | 3001 | ✅ | Metrik + log dashboard (admin/admin) |
| Kibana | 5601 | ✅ | ELK log arama |
| Jaeger | 16686 | ✅ | Distributed tracing |
| Seq | 5341 | ✅ | .NET yapılandırılmış loglar |
| Prometheus | 9090 | ✅ | Metrik sorguları |
| RabbitMQ | 15672 | ✅ | Kuyruk yönetimi (guest/guest) |
| Elasticsearch | 9200 | ❌ JSON | Depolama → Kibana kullan |
| Loki | 3100 | ❌ | Depolama → Grafana Explore |
Kibana index pattern'leri kibana-setup ile otomatik: element-app-logs-*, element-logs-*, element-metrics-*.
# docker/.env.example
SEQ_URL=http://seq:80
OTLP_ENDPOINT=http://jaeger:4317
LOGSTASH_HTTP_URL=http://logstash:8080Konfig: docker/observability/
Tek Postgres instance, ayrı veritabanları:
| DB | Servis |
|---|---|
element_identity_db |
identity-service |
element_market_db |
catalog-service |
element_order_db |
order-service |
element_shipment_db |
shipment-service |
./deploy/scripts/build-all.ps1
./deploy/scripts/test-unit.ps1
./deploy/scripts/test-smoke.ps1 # Stack ayaktayken smoke testTek servis: ilgili klasörde docker compose up -d --build (kendi README'sine bakın).
element-api/
├── gateway-service/ identity-service/ catalog-service/
├── order-service/ shipment-service/ payment-service/
├── notification-service/ web-app/ shared-lib/
├── contracts/ deploy/ docker/
├── docker-compose.yml docker/.env.example
└── README.md ← bu dosya