%%{init: {
"theme": "neutral",
"themeVariables": {
"background": "#ffffff"
},
"flowchart": {
"nodeSpacing": 35,
"rankSpacing": 50
}
}}%%
flowchart LR
%% ─────────── Legend classes ───────────
classDef personStyle fill:#0d3d77,color:#fff;
classDef newContainer fill:#cce5ff,stroke:#2978b5,stroke-width:2px,color:#000;
classDef databaseStyle fill:#cce5ff,stroke:#2978b5,stroke-width:2px,color:#000,stroke-dasharray: 5 5;
classDef externalStyle fill:#e0e0e0,stroke:#666,stroke-width:1px,color:#000;
%% ─────────── Atores ───────────
med(["Médico"]):::personStyle
%% ─────────── Boundary do sistema ───────────
subgraph OncoAI ["Onco AI (Software System)"]
direction TB
webUI["Web Browser SPA<br/>(React)"]:::newContainer
api["Backend API Gateway<br/>(FastAPI)"]:::newContainer
aiCore["AI Engine<br/>(Explainable AI)"]:::newContainer
graphDB[(Graph DB – Neo4j<br/>Clínica · Médico · Paciente · Exame)]:::databaseStyle
vectorDB[(Vector DB – Weaviate<br/>Exam Embeddings ↔ idPaciente)]:::databaseStyle
end
style OncoAI stroke:#2978b5,stroke-width:2px,stroke-dasharray:3 3,fill:none
%% ─────────── Sistemas externos ───────────
auth["Serviço de Autenticação<br/>(Keycloak / OAuth2)"]:::externalStyle
%% ─────────── Relacionamentos ───────────
med -- "HTTPS" --> webUI
webUI -- "REST/JSON" <--> api
api -- "HTTP" <--> aiCore
api -- "Bolt" <--> graphDB
api -- "Read/Write/Delete" --> vectorDB
aiCore -- "Bolt" <--> graphDB
aiCore -- "Similarity search" <--> vectorDB
api -- "JWT introspection" <--> auth