# fazilpraphi/wisteria architecture

> Architecture diagram of the GitHub repository fazilpraphi/wisteria, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fazilpraphi/wisteria
- Repository: https://github.com/fazilpraphi/wisteria

## Overview

Wisteria is an offline-first clinical workstation: clinicians use its workspace to register and browse patients, manage doctor and system settings, and access local medical models. The README documents local structured data and AI-assisted analysis; the tree shows corresponding examination, imaging, model, inference, and storage modules. The Flutter source was not excerpted, so connections beyond the README’s conceptual architecture are omitted or marked unverified rather than inferred from filenames.

Main entry points: [`lib/features/workspace/system_workspace_panel.dart`](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/workspace/system_workspace_panel.dart) (System Workspace), [`lib/core/database/database.dart`](https://github.com/fazilpraphi/wisteria/blob/main/lib/core/database/database.dart) (Local Database), [`lib/features/workspace/workspace_shell.dart`](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/workspace/workspace_shell.dart) (Workspace Shell), [`lib/features/examinations/create_examination_page.dart`](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/examinations/create_examination_page.dart) (Examinations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace"]
  node_app["Wisteria App<br/>[main.dart]"]
  node_workspace_shell["Workspace Shell"]
  node_main_panel["Main Workspace"]
  node_system_panel["System Workspace"]
  node_dashboard["Dashboard"]
  node_settings["Settings<br/>[settings_page.dart]"]
end

subgraph group_clinical["Clinical Records"]
  node_patient_registration["Patient Registration"]
  node_patient_directory["Patient Directory<br/>[patient_page.dart]"]
  node_patient_details["Patient Details"]
  node_examinations["Examinations"]
  node_examination_details["Examination Details"]
  node_doctor_profile["Doctor Profile"]
end

subgraph group_ai["Models and AI"]
  node_medical_models["Medical Models"]
  node_inference_test["Inference Testing"]
  node_offline_models["Offline Models"]
  node_onnx_inference["ONNX Inference"]
  node_model_registry["Model Registry"]
  node_ollama["Ollama Service"]
end

subgraph group_platform["Local Data"]
  node_database[("Local Database<br/>[database.dart]")]
  node_tables["Clinical Tables<br/>[tables.dart]"]
  node_repositories["Data Repositories"]
  node_image_storage["Image Storage"]
  node_doctor_storage["Doctor Documents"]
end

node_clinician(("Clinician"))

node_clinician -->|"opens"| node_app
node_app -.->|"launches"| node_workspace_shell
node_workspace_shell -->|"presents"| node_main_panel
node_workspace_shell -->|"presents"| node_system_panel
node_main_panel -->|"offers registration"| node_patient_registration
node_main_panel -->|"offers browsing"| node_patient_directory
node_system_panel -->|"offers profile"| node_doctor_profile
node_system_panel -->|"offers settings"| node_settings
node_system_panel -->|"offers models"| node_medical_models
node_system_panel -->|"offers synchronization"| node_offline_models
node_workspace_shell -.->|"presents"| node_dashboard
node_patient_registration -->|"writes records"| node_database
node_patient_directory -->|"reads records"| node_database
node_database -.->|"uses schema"| node_tables
node_database -.->|"provides access"| node_repositories
node_patient_details -.->|"opens workflow"| node_examinations
node_examinations -.->|"shows details"| node_examination_details
node_examinations -.->|"stores records"| node_database
node_medical_models -.->|"accesses models"| node_model_registry
node_medical_models -.->|"offers testing"| node_inference_test
node_offline_models -->|"runs local inference"| node_onnx_inference
node_inference_test -.->|"tests inference"| node_onnx_inference
node_offline_models -.->|"optional integration"| node_ollama
node_examinations -.->|"uses image storage"| node_image_storage
node_doctor_profile -.->|"uses document storage"| node_doctor_storage

click node_app "https://github.com/fazilpraphi/wisteria/blob/main/lib/main.dart"
click node_workspace_shell "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/workspace/workspace_shell.dart"
click node_main_panel "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/workspace/main_workspace_panel.dart"
click node_system_panel "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/workspace/system_workspace_panel.dart"
click node_dashboard "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/dashboard/dashboard_page.dart"
click node_settings "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/workspace/settings_page.dart"
click node_patient_registration "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/patients/new_patient_registration_page.dart"
click node_patient_directory "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/patients/patient_page.dart"
click node_patient_details "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/patients/patient_details_page.dart"
click node_examinations "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/examinations/create_examination_page.dart"
click node_examination_details "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/examinations/examination_details_page.dart"
click node_doctor_profile "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/doctor/doctor_profile_page.dart"
click node_medical_models "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/models/medical_model_page.dart"
click node_inference_test "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/models/model_inference_test_page.dart"
click node_offline_models "https://github.com/fazilpraphi/wisteria/blob/main/lib/features/offline_model/offline_model_page.dart"
click node_onnx_inference "https://github.com/fazilpraphi/wisteria/blob/main/lib/core/services/onnx_inference_service.dart"
click node_model_registry "https://github.com/fazilpraphi/wisteria/blob/main/lib/core/services/model_registry_service.dart"
click node_ollama "https://github.com/fazilpraphi/wisteria/blob/main/lib/core/services/ollama_service.dart"
click node_database "https://github.com/fazilpraphi/wisteria/blob/main/lib/core/database/database.dart"
click node_tables "https://github.com/fazilpraphi/wisteria/blob/main/lib/core/database/tables.dart"
click node_repositories "https://github.com/fazilpraphi/wisteria/tree/main/lib/core/database/repositories"
click node_image_storage "https://github.com/fazilpraphi/wisteria/blob/main/lib/core/storage/medical_image_storage.dart"
click node_doctor_storage "https://github.com/fazilpraphi/wisteria/blob/main/lib/core/storage/doctor_document_storage.dart"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_workspace_shell,node_main_panel,node_system_panel,node_dashboard,node_settings toneBlue
class node_patient_registration,node_patient_directory,node_patient_details,node_examinations,node_examination_details,node_doctor_profile toneAmber
class node_medical_models,node_inference_test,node_offline_models,node_onnx_inference,node_model_registry,node_ollama toneMint
class node_database,node_tables,node_repositories,node_image_storage,node_doctor_storage toneRose
class node_clinician toneIndigo
```

## Components

### Workspace

- [Wisteria App](https://github.com/fazilpraphi/wisteria/blob/main/lib/main.dart): `lib/main.dart`
- [Workspace Shell](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/workspace/workspace_shell.dart): `lib/features/workspace/workspace_shell.dart`
- [Main Workspace](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/workspace/main_workspace_panel.dart): `lib/features/workspace/main_workspace_panel.dart`
- [System Workspace](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/workspace/system_workspace_panel.dart): `lib/features/workspace/system_workspace_panel.dart`
- [Dashboard](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/dashboard/dashboard_page.dart): `lib/features/dashboard/dashboard_page.dart`
- [Settings](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/workspace/settings_page.dart): `lib/features/workspace/settings_page.dart`

### Clinical Records

- [Patient Registration](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/patients/new_patient_registration_page.dart): `lib/features/patients/new_patient_registration_page.dart`
- [Patient Directory](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/patients/patient_page.dart): `lib/features/patients/patient_page.dart`
- [Patient Details](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/patients/patient_details_page.dart): `lib/features/patients/patient_details_page.dart`
- [Examinations](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/examinations/create_examination_page.dart): `lib/features/examinations/create_examination_page.dart`
- [Examination Details](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/examinations/examination_details_page.dart): `lib/features/examinations/examination_details_page.dart`
- [Doctor Profile](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/doctor/doctor_profile_page.dart): `lib/features/doctor/doctor_profile_page.dart`

### Models and AI

- [Medical Models](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/models/medical_model_page.dart): `lib/features/models/medical_model_page.dart`
- [Inference Testing](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/models/model_inference_test_page.dart): `lib/features/models/model_inference_test_page.dart`
- [Offline Models](https://github.com/fazilpraphi/wisteria/blob/main/lib/features/offline_model/offline_model_page.dart): `lib/features/offline_model/offline_model_page.dart`
- [ONNX Inference](https://github.com/fazilpraphi/wisteria/blob/main/lib/core/services/onnx_inference_service.dart): `lib/core/services/onnx_inference_service.dart`
- [Model Registry](https://github.com/fazilpraphi/wisteria/blob/main/lib/core/services/model_registry_service.dart): `lib/core/services/model_registry_service.dart`
- [Ollama Service](https://github.com/fazilpraphi/wisteria/blob/main/lib/core/services/ollama_service.dart): `lib/core/services/ollama_service.dart`

### Local Data

- [Local Database](https://github.com/fazilpraphi/wisteria/blob/main/lib/core/database/database.dart): `lib/core/database/database.dart`
- [Clinical Tables](https://github.com/fazilpraphi/wisteria/blob/main/lib/core/database/tables.dart): `lib/core/database/tables.dart`
- [Data Repositories](https://github.com/fazilpraphi/wisteria/tree/main/lib/core/database/repositories): `lib/core/database/repositories`
- [Image Storage](https://github.com/fazilpraphi/wisteria/blob/main/lib/core/storage/medical_image_storage.dart): `lib/core/storage/medical_image_storage.dart`
- [Doctor Documents](https://github.com/fazilpraphi/wisteria/blob/main/lib/core/storage/doctor_document_storage.dart): `lib/core/storage/doctor_document_storage.dart`

### Other components

- **Clinician**

## Connections

- Clinician → Wisteria App: opens (evidence: `README.md`)
- Wisteria App → Workspace Shell: launches
- Workspace Shell → Main Workspace: presents (evidence: `README.md`)
- Workspace Shell → System Workspace: presents (evidence: `README.md`)
- Main Workspace → Patient Registration: offers registration (evidence: `README.md`)
- Main Workspace → Patient Directory: offers browsing (evidence: `README.md`)
- System Workspace → Doctor Profile: offers profile (evidence: `README.md`)
- System Workspace → Settings: offers settings (evidence: `README.md`)
- System Workspace → Medical Models: offers models (evidence: `README.md`)
- System Workspace → Offline Models: offers synchronization (evidence: `README.md`)
- Workspace Shell → Dashboard: presents
- Patient Registration → Local Database: writes records (evidence: `README.md`)
- Patient Directory → Local Database: reads records (evidence: `README.md`)
- Local Database → Clinical Tables: uses schema
- Local Database → Data Repositories: provides access
- Patient Details → Examinations: opens workflow
- Examinations → Examination Details: shows details
- Examinations → Local Database: stores records
- Medical Models → Model Registry: accesses models
- Medical Models → Inference Testing: offers testing
- Offline Models → ONNX Inference: runs local inference (evidence: `README.md`)
- Inference Testing → ONNX Inference: tests inference
- Offline Models → Ollama Service: optional integration
- Examinations → Image Storage: uses image storage
- Doctor Profile → Doctor Documents: uses document storage
