# cde

Common Data Environment с набором воркеров. Namespace: `cde`.

```mermaid
flowchart LR
    GW[Istio Gateway]:::infra
    PG[(PostgreSQL)]:::data
    S3[S3 Proxy]:::infra
    MinIO[(MinIO)]:::data
    KC[Keycloak]:::idp
    RMQ[[RabbitMQ]]:::msg

    subgraph NS["ns: cde"]
        API[deployment: cde<br/>API + backend]:::comp
        Split[worker: split-pdf]:::comp
        Copy[worker: copy]:::comp
        Versions[worker: create-versions]:::comp
        Markings[worker: markings]:::comp
        Sign[worker: sign]:::comp
        Bundles[worker: update-bundles]:::comp
        FlowsCB[worker: flows-callback]:::comp
        API -. dispatch .-> Split
        API -. dispatch .-> Copy
        API -. dispatch .-> Versions
        API -. dispatch .-> Markings
        API -. dispatch .-> Sign
        API -. dispatch .-> Bundles
        API -. dispatch .-> FlowsCB
    end

    Docs[documentations]:::peer
    Drawings[drawings]:::peer
    BIM[bim]:::peer
    DocLink[document-link]:::peer
    Transmittal[transmittal]:::peer
    Flows[flows]:::peer

    GW -->|/cde| API
    DocLink -->|REST| API
    Transmittal -->|REST| API
    API -->|REST| Docs
    API -->|REST| Drawings
    API -->|REST| BIM
    API --> PG
    Split -->|files| S3
    Copy -->|files| S3
    Versions -->|files| S3
    Markings -->|files| S3
    Sign -->|files| S3
    Bundles -->|files| S3
    S3 --> MinIO
    Split & Copy & Versions & Markings & Sign & Bundles -.->|consume jobs| RMQ
    FlowsCB -.->|callback| Flows
    API -. JWT .-> KC

    classDef comp fill:#ec4899,stroke:#9d174d,stroke-width:2px,color:#fff
    classDef peer fill:#fce7f3,stroke:#9d174d,color:#000
    classDef data fill:#10b981,stroke:#065f46,color:#fff
    classDef infra fill:#0ea5e9,stroke:#075985,color:#fff
    classDef idp fill:#f59e0b,stroke:#92400e,color:#fff
    classDef msg fill:#ef4444,stroke:#991b1b,color:#fff
    style NS fill:#fdf2f8,stroke:#ec4899,stroke-width:2px
```
