Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- ARCHITECTURE.md +102 -61
ARCHITECTURE.md
CHANGED
|
@@ -11,67 +11,108 @@ By aggressively decoupling the presentation layer (Client), the orchestration an
|
|
| 11 |
## 🏗 High-Level Architecture Diagram
|
| 12 |
|
| 13 |
```mermaid
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
```
|
| 76 |
|
| 77 |
---
|
|
|
|
| 11 |
## 🏗 High-Level Architecture Diagram
|
| 12 |
|
| 13 |
```mermaid
|
| 14 |
+
%% Generated by https://gitdiagram.com/idkhowtocodefr/heartflow_os
|
| 15 |
+
flowchart TD
|
| 16 |
+
|
| 17 |
+
subgraph group_client["Telemetry interface"]
|
| 18 |
+
node_dashboard["Live dashboard<br/>[page.tsx]"]
|
| 19 |
+
node_telemetry_context["Telemetry context"]
|
| 20 |
+
node_history_ui["History view<br/>[page.tsx]"]
|
| 21 |
+
node_analytics["Analytics view<br/>[page.tsx]"]
|
| 22 |
+
node_simulator_ui["Simulator view<br/>[page.tsx]"]
|
| 23 |
+
node_mlops_ui["MLOps view<br/>[page.tsx]"]
|
| 24 |
+
node_edge_ui["Edge export view<br/>[page.tsx]"]
|
| 25 |
+
node_architecture_ui["Architecture view<br/>[page.tsx]"]
|
| 26 |
+
node_shap_chart["SHAP chart<br/>[ShapChart.tsx]"]
|
| 27 |
+
end
|
| 28 |
+
|
| 29 |
+
subgraph group_api["API orchestration"]
|
| 30 |
+
node_api["FastAPI routes<br/>[main.py]"]
|
| 31 |
+
node_simulator["Vitals simulator<br/>[simulator.py]"]
|
| 32 |
+
end
|
| 33 |
+
|
| 34 |
+
subgraph group_ml["Prediction and MLOps"]
|
| 35 |
+
node_inference["Inference pipeline<br/>[inference.py]"]
|
| 36 |
+
node_preprocessing["Feature preprocessing<br/>[preprocessing.py]"]
|
| 37 |
+
node_ensemble["Soft-voting ensemble<br/>[ensemble.py]"]
|
| 38 |
+
node_training["Model training<br/>[models.py]"]
|
| 39 |
+
node_export["C code exporter<br/>[export.py]"]
|
| 40 |
+
node_model_files["Trained model files"]
|
| 41 |
+
node_dataset["Patient dataset"]
|
| 42 |
+
end
|
| 43 |
+
|
| 44 |
+
subgraph group_state["Persistence and sync"]
|
| 45 |
+
node_database[("Prediction history<br/>[database.py]")]
|
| 46 |
+
node_sqlite[("SQLite history store<br/>[patient_history.db]")]
|
| 47 |
+
end
|
| 48 |
+
|
| 49 |
+
node_clinician(("Clinical user"))
|
| 50 |
+
node_hub["Hugging Face Hub"]
|
| 51 |
+
|
| 52 |
+
node_clinician -.->|"monitors"| node_dashboard
|
| 53 |
+
node_clinician -.->|"reviews"| node_history_ui
|
| 54 |
+
node_clinician -.->|"explores"| node_analytics
|
| 55 |
+
node_clinician -.->|"uses"| node_simulator_ui
|
| 56 |
+
node_clinician -.->|"manages"| node_mlops_ui
|
| 57 |
+
node_clinician -.->|"exports"| node_edge_ui
|
| 58 |
+
node_clinician -.->|"views"| node_architecture_ui
|
| 59 |
+
node_dashboard -->|"uses"| node_telemetry_context
|
| 60 |
+
node_clinician -.->|"submits vitals"| node_api
|
| 61 |
+
node_dashboard -.->|"streams telemetry"| node_api
|
| 62 |
+
node_history_ui -.->|"requests history"| node_api
|
| 63 |
+
node_analytics -.->|"requests data"| node_api
|
| 64 |
+
node_mlops_ui -.->|"uploads retraining data"| node_api
|
| 65 |
+
node_edge_ui -.->|"requests C export"| node_api
|
| 66 |
+
node_api -->|"initializes and queries"| node_database
|
| 67 |
+
node_api -->|"streams generated vitals"| node_simulator
|
| 68 |
+
node_api -->|"evaluates vitals"| node_inference
|
| 69 |
+
node_api -->|"prepares explanations"| node_preprocessing
|
| 70 |
+
node_api -->|"generates C code"| node_export
|
| 71 |
+
node_api -->|"loads and refreshes"| node_ensemble
|
| 72 |
+
node_api -->|"starts background retraining"| node_training
|
| 73 |
+
node_inference -->|"transforms features"| node_preprocessing
|
| 74 |
+
node_inference -.->|"predicts probabilities"| node_ensemble
|
| 75 |
+
node_ensemble -->|"resolves model directory"| node_preprocessing
|
| 76 |
+
node_training -->|"splits and transforms data"| node_preprocessing
|
| 77 |
+
node_training -->|"reads training data"| node_dataset
|
| 78 |
+
node_training -->|"writes trained models"| node_model_files
|
| 79 |
+
node_ensemble -->|"loads model artifacts"| node_model_files
|
| 80 |
+
node_database -->|"reads and writes"| node_sqlite
|
| 81 |
+
node_database -->|"syncs history"| node_hub
|
| 82 |
+
|
| 83 |
+
click node_dashboard "https://github.com/idkhowtocodefr/heartflow_os/blob/main/frontend/src/app/dashboard/page.tsx"
|
| 84 |
+
click node_telemetry_context "https://github.com/idkhowtocodefr/heartflow_os/blob/main/frontend/src/context/TelemetryContext.tsx"
|
| 85 |
+
click node_history_ui "https://github.com/idkhowtocodefr/heartflow_os/blob/main/frontend/src/app/history/page.tsx"
|
| 86 |
+
click node_analytics "https://github.com/idkhowtocodefr/heartflow_os/blob/main/frontend/src/app/analytics/page.tsx"
|
| 87 |
+
click node_simulator_ui "https://github.com/idkhowtocodefr/heartflow_os/blob/main/frontend/src/app/simulator/page.tsx"
|
| 88 |
+
click node_mlops_ui "https://github.com/idkhowtocodefr/heartflow_os/blob/main/frontend/src/app/mlops/page.tsx"
|
| 89 |
+
click node_edge_ui "https://github.com/idkhowtocodefr/heartflow_os/blob/main/frontend/src/app/edge/page.tsx"
|
| 90 |
+
click node_architecture_ui "https://github.com/idkhowtocodefr/heartflow_os/blob/main/frontend/src/app/architecture/page.tsx"
|
| 91 |
+
click node_shap_chart "https://github.com/idkhowtocodefr/heartflow_os/blob/main/frontend/src/components/ShapChart.tsx"
|
| 92 |
+
click node_api "https://github.com/idkhowtocodefr/heartflow_os/blob/main/backend/main.py"
|
| 93 |
+
click node_simulator "https://github.com/idkhowtocodefr/heartflow_os/blob/main/backend/simulator.py"
|
| 94 |
+
click node_inference "https://github.com/idkhowtocodefr/heartflow_os/blob/main/backend/inference.py"
|
| 95 |
+
click node_preprocessing "https://github.com/idkhowtocodefr/heartflow_os/blob/main/backend/preprocessing.py"
|
| 96 |
+
click node_ensemble "https://github.com/idkhowtocodefr/heartflow_os/blob/main/backend/ensemble.py"
|
| 97 |
+
click node_training "https://github.com/idkhowtocodefr/heartflow_os/blob/main/backend/models.py"
|
| 98 |
+
click node_export "https://github.com/idkhowtocodefr/heartflow_os/blob/main/backend/export.py"
|
| 99 |
+
click node_model_files "https://github.com/idkhowtocodefr/heartflow_os/tree/main/model"
|
| 100 |
+
click node_dataset "https://github.com/idkhowtocodefr/heartflow_os/blob/main/data/patient_dataset.csv"
|
| 101 |
+
click node_database "https://github.com/idkhowtocodefr/heartflow_os/blob/main/backend/database.py"
|
| 102 |
+
click node_sqlite "https://github.com/idkhowtocodefr/heartflow_os/blob/main/backend/patient_history.db"
|
| 103 |
+
|
| 104 |
+
classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
|
| 105 |
+
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
|
| 106 |
+
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
|
| 107 |
+
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
|
| 108 |
+
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
|
| 109 |
+
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
|
| 110 |
+
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
|
| 111 |
+
class node_dashboard,node_telemetry_context,node_history_ui,node_analytics,node_simulator_ui,node_mlops_ui,node_edge_ui,node_architecture_ui,node_shap_chart,node_clinician toneBlue
|
| 112 |
+
class node_api,node_simulator toneAmber
|
| 113 |
+
class node_inference,node_preprocessing,node_ensemble,node_training,node_export,node_model_files,node_dataset toneMint
|
| 114 |
+
class node_database,node_sqlite toneRose
|
| 115 |
+
class node_hub toneIndigo
|
| 116 |
```
|
| 117 |
|
| 118 |
---
|