> ## Documentation Index
> Fetch the complete documentation index at: https://docs.diyanet.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# Proje Yapısı

> Monorepo dizin yapısı: katmanlar, BuildingBlocks, SPA'lar ve devops dosyaları

Şablon bir **monorepo**'dur. Backend (Clean Architecture katmanları), iki frontend SPA ve tüm devops dosyaları tek repoda yaşar. Çözüm dosyası **`DiyanetCleanArchitecture.slnx`** (yeni XML tabanlı `.slnx` formatı).

## Üst düzey dizinler

```text theme={null}
diyanet-clean-architecture/
├── src/                      # Tüm kaynak kod (backend + frontend)
├── test/                     # Birim ve fonksiyonel testler
├── docker/                   # Keycloak temaları, Grafana/Prometheus/RabbitMQ config, init SQL
├── scripts/                  # Keycloak yardımcıları + Hetzner deploy script'leri
├── docs/                     # Bu Mintlify dokümantasyonu
├── .template.config/         # dotnet new şablon tanımı (template.json)
├── docker-compose*.yml       # Ortam bazlı compose dosyaları
├── .env*.example             # Ortam değişkeni şablonları
└── DiyanetCleanArchitecture.slnx
```

## `src/` — kaynak kod

```text theme={null}
src/
├── DiyanetCleanArchitecture.API                      # ASP.NET Core 10 host (Controllers, Program.cs)
├── DiyanetCleanArchitecture.Application              # CQRS: Features, Handlers, Behaviors
├── DiyanetCleanArchitecture.Domain                   # Aggregate'ler, Entity'ler, Domain Event'ler
├── DiyanetCleanArchitecture.Domain.SharedKernel      # EntityBase, ValueObject, Enumeration, ...
├── DiyanetCleanArchitecture.Infrastructure.EFCore    # DbContext, Repository, Migrations
├── DiyanetCleanArchitecture.Infrastructure.Jobs.Hangfire
├── DiyanetCleanArchitecture.Infrastructure.Services.Email
├── DiyanetCleanArchitecture.Infrastructure.Services.Sms
├── DiyanetCleanArchitecture.Infrastructure.Services.Notification
├── DiyanetCleanArchitecture.Infrastructure.Services.OAuth
├── DiyanetCleanArchitecture.Infrastructure.Services.Authenticator
├── DiyanetCleanArchitecture.Presentation.Website     # React 19 + Vite SPA → / (vatandaş)
├── DiyanetCleanArchitecture.Presentation.Admin       # React 19 + Vite SPA → /admin (personel)
└── BuildingBlocks/                                    # 20 yeniden kullanılabilir altyapı paketi
```

### Katmanların sorumlulukları

<CardGroup cols={2}>
  <Card title="Domain" icon="cube" href="/domain/overview">
    İş kuralları. Hiçbir dış katmanı bilmez. Aggregate, Entity, Value Object, Domain Event, Factory, Domain Service.
  </Card>

  <Card title="Application" icon="diagram-project" href="/application/overview">
    Use-case orkestrasyonu. MediatR Command/Query + Handler, Pipeline Behavior, Validator, DTO.
  </Card>

  <Card title="Infrastructure" icon="server" href="/data/overview">
    Application arayüzlerinin somut implementasyonu: EF Core, RabbitMQ, Redis, Email, SMS, OAuth, TOTP, Hangfire.
  </Card>

  <Card title="API + Presentation" icon="window" href="/api/overview">
    İnce controller'lar (sadece MediatR'a iletir) + iki React SPA.
  </Card>
</CardGroup>

Bağımlılık yönü **her zaman içe doğrudur**: `API → Application → Domain`. Infrastructure, Application arayüzlerini implemente eder. Detay: [Mimari › Bağımlılık Akışı](/architecture/dependency-flow).

## `BuildingBlocks/` — altyapı paketleri

Uygulamadan bağımsız, başka projelere de taşınabilen 20 paket. Öne çıkanlar:

| Paket                                          | İçerik                                                  |
| ---------------------------------------------- | ------------------------------------------------------- |
| `BuildingBlocks.Caching` (+`.Redis`)           | HybridCache (L1+L2), distributed lock, tag invalidation |
| `BuildingBlocks.EventBus.MassTransit.RabbitMq` | MassTransit + RabbitMQ + EF Outbox event bus            |
| `BuildingBlocks.Keycloak`                      | Çift-realm Keycloak SSO + claims transformation         |
| `BuildingBlocks.Jwt`                           | Çok-şemalı JWT (Backoffice + OTP Challenge)             |
| `BuildingBlocks.OAuth`                         | OAuth2 / PKCE soyutlaması (Google, Meta, Keycloak)      |
| `BuildingBlocks.Otp`                           | HMAC-SHA256 OTP üretim/doğrulama                        |
| `BuildingBlocks.Specification`                 | Generic Specification (Ardalis tabanlı)                 |
| `BuildingBlocks.DeviceDetector`                | IP çözümleme, cihaz parmak izi, güven skoru             |
| `BuildingBlocks.Observability`                 | OpenTelemetry metrik/trace + health→gauge köprüsü       |
| `BuildingBlocks.HealthChecks`                  | K8s uyumlu live/ready/external endpoint'leri            |

Tam liste ve API'ler: [BuildingBlocks › Genel Bakış](/building-blocks/overview).

## `test/` — testler

```text theme={null}
test/
├── DiyanetCleanArchitecture.Domain.UnitTests
├── DiyanetCleanArchitecture.API.Authorization.UnitTests
├── DiyanetCleanArchitecture.Caching.Redis.UnitTests
├── DiyanetCleanArchitecture.Infrastructure.Services.Email.UnitTests
├── DiyanetCleanArchitecture.Infrastructure.Services.Sms.UnitTests
└── BuildingBlocks.EventBus.MassTransit.RabbitMq.FunctionalTests
```

## `docker/` — container yardımcıları

```text theme={null}
docker/
├── keycloak/         # Özel Keycloak imajı + Türkçe temalar (diyanet-website, diyanet-admin)
├── grafana/          # Datasource + dashboard provisioning (diyanet-health.json)
├── prometheus/       # prometheus.yml scrape config (/metrics)
├── rabbitmq/         # enabled_plugins (management + delayed_message_exchange)
├── init/             # Postgres init SQL (keycloak şeması, tenant'lar)
└── init-hetzner/     # Çok-proje veritabanı oluşturma
```

## Compose ve ortam dosyaları

| Dosya                                                            | Amaç                                                       |
| ---------------------------------------------------------------- | ---------------------------------------------------------- |
| `docker-compose.yml`                                             | Base: API + Website + Admin                                |
| `docker-compose.override.yml`                                    | **Dev** — tüm altyapı + host port'ları (otomatik yüklenir) |
| `docker-compose.stage.yml`                                       | Stage — nginx-proxy + acme-companion + Let's Encrypt       |
| `docker-compose.prod.yml`                                        | Prod — aynı yapı, prod realm/sertifika                     |
| `docker-compose.stage.local.yml`                                 | Local'de stage simülasyonu (HTTP-only)                     |
| `docker-compose.platform.yml` / `.shared-infra.yml` / `.app.yml` | Hetzner çok-proje dağıtımı                                 |

Detay: [Operasyon › Genel Bakış](/operations/overview).

## Sonraki adım

<CardGroup cols={2}>
  <Card title="Mimari Genel Bakış" icon="sitemap" href="/architecture/overview">
    Katmanlar ve bağımlılık yönü.
  </Card>

  <Card title="Çözüm Yapısı" icon="folder-tree" href="/architecture/solution-structure">
    `.slnx` içindeki projeler ve referans grafiği.
  </Card>
</CardGroup>
