# yang20040522/tkuim_project architecture

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

- Interactive diagram: https://gitdiagram.com/yang20040522/tkuim_project
- Repository: https://github.com/yang20040522/tkuim_project

## Overview

RehabAssist is a Flutter rehabilitation app for patients and therapists. Its principal patient workflow is to view a therapist’s plan, perform daily exercises, use on-device pose recognition to assess movement, and review training records and statistics. Therapist capabilities include patient and plan management plus a 3D custom-exercise editor; chat, calls, profiles, and notifications are supporting branches. The README names these app modules, but their Dart sources are absent from the supplied tree, so those links reflect documented capabilities. The sampled ML code describes a separate research/training workflow, not evidence of app runtime integration.

Main entry points: [`ml/body_v3/training.py`](https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/training.py) (Body training), [`lib/features/training`](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/training) (Daily training), [`lib/features/plan`](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/plan) (Rehab plans), [`ml/body_v3/features.py`](https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/features.py) (Body features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient rehabilitation"]
  node_plan["Rehab plans"]
  node_daily["Daily training"]
  node_rehab["Rehab exercises"]
  node_history["Training history"]
  node_stats["Training statistics"]
  node_patient_home["Patient home"]
end

subgraph group_therapist["Therapist tools"]
  node_patient_mgmt["Patient management"]
  node_custom["Custom exercises"]
end

subgraph group_shared["Communication and account"]
  node_account["Account and profile"]
  node_chat["Chat"]
  node_call["Video calls"]
  node_notify["Notifications"]
end

subgraph group_pose["On-device pose"]
  node_pose_infer["Pose inference"]
  node_pose_measure["Pose measurement"]
end

subgraph group_ml["ML research pipeline"]
  node_body_features["Body features<br/>[features.py]"]
  node_body_dataset["Body dataset<br/>[dataset.py]"]
  node_body_models["Body models<br/>[models.py]"]
  node_body_split["Body split<br/>[split.py]"]
  node_body_training["Body training<br/>[training.py]"]
  node_body_parity["Body parity<br/>[parity.py]"]
  node_body_synthetic["Synthetic samples<br/>[synthetic.py]"]
  node_train_body["Body train entry<br/>[train_body.py]"]
  node_hand_features["Hand features<br/>[hand_features.py]"]
  node_feature_schema["Feature schema<br/>[feature_schema.py]"]
  node_train_hand["Hand model training<br/>[train.py]"]
  node_artifacts["Model artifacts<br/>[model_artifacts.py]"]
end

subgraph group_shell["Desktop application shell"]
  node_win_entry["Windows entry<br/>[main.cpp]"]
  node_flutter_window["Flutter window<br/>[flutter_window.cpp]"]
  node_win_window["Win32 window<br/>[win32_window.cpp]"]
end

node_patient(("Patient"))
node_therapist(("Therapist"))
node_backend["REST backend"]
node_camera["Phone camera"]
node_onnx["ONNX Runtime"]

node_patient -->|"views"| node_plan
node_plan -->|"guides"| node_daily
node_patient -->|"performs"| node_daily
node_daily -->|"analyzes with"| node_pose_infer
node_pose_infer -->|"reads frames"| node_camera
node_pose_infer -->|"runs models"| node_onnx
node_daily -->|"judges movement"| node_pose_measure
node_daily -->|"records sessions"| node_history
node_patient -->|"reviews"| node_history
node_patient -->|"reviews"| node_stats
node_patient -->|"opens"| node_patient_home
node_therapist -->|"manages patients"| node_patient_mgmt
node_therapist -->|"arranges plans"| node_plan
node_therapist -->|"edits exercises"| node_custom
node_custom -.->|"provides exercises"| node_plan
node_patient -->|"manages profile"| node_account
node_patient -->|"chats with therapist"| node_chat
node_therapist -->|"chats with patient"| node_chat
node_patient -->|"starts calls"| node_call
node_therapist -->|"starts calls"| node_call
node_patient -->|"receives alerts"| node_notify
node_account -->|"exchanges account data"| node_backend
node_patient_mgmt -->|"exchanges patient data"| node_backend
node_plan -->|"exchanges plan data"| node_backend
node_chat -->|"exchanges messages"| node_backend
node_body_dataset -->|"extracts features"| node_body_features
node_body_parity -->|"checks parity"| node_body_features
node_body_synthetic -->|"builds samples"| node_body_features
node_body_split -->|"uses schema"| node_body_features
node_body_training -->|"uses features"| node_body_features
node_body_training -->|"uses models"| node_body_models
node_body_training -->|"splits data"| node_body_split
node_body_training -->|"consumes data"| node_body_dataset
node_train_body -->|"runs training"| node_body_training
node_train_body -->|"loads dataset"| node_body_dataset
node_train_body -->|"checks parity"| node_body_parity
node_train_body -->|"generates samples"| node_body_synthetic
node_feature_schema -->|"uses features"| node_hand_features
node_train_hand -->|"builds feature rows"| node_feature_schema
node_train_hand -->|"trains artifacts"| node_artifacts
node_win_entry -->|"creates window"| node_flutter_window
node_flutter_window -->|"extends window"| node_win_window

click node_plan "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/plan"
click node_daily "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/training"
click node_rehab "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/rehab"
click node_history "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/history"
click node_stats "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/stats"
click node_patient_home "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/home"
click node_patient_mgmt "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/friends"
click node_custom "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/custom_exercise"
click node_account "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/account"
click node_chat "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/chat"
click node_call "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/call"
click node_notify "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/notification"
click node_pose_infer "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/analysis"
click node_pose_measure "https://github.com/yang20040522/tkuim_project/tree/master/lib/features/pose_measurement"
click node_body_features "https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/features.py"
click node_body_dataset "https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/dataset.py"
click node_body_models "https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/models.py"
click node_body_split "https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/split.py"
click node_body_training "https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/training.py"
click node_body_parity "https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/parity.py"
click node_body_synthetic "https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/synthetic.py"
click node_train_body "https://github.com/yang20040522/tkuim_project/blob/master/ml/train_body.py"
click node_hand_features "https://github.com/yang20040522/tkuim_project/blob/master/ml/hand_features.py"
click node_feature_schema "https://github.com/yang20040522/tkuim_project/blob/master/ml/feature_schema.py"
click node_train_hand "https://github.com/yang20040522/tkuim_project/blob/master/ml/train.py"
click node_artifacts "https://github.com/yang20040522/tkuim_project/blob/master/ml/model_artifacts.py"
click node_win_entry "https://github.com/yang20040522/tkuim_project/blob/master/windows/runner/main.cpp"
click node_flutter_window "https://github.com/yang20040522/tkuim_project/blob/master/windows/runner/flutter_window.cpp"
click node_win_window "https://github.com/yang20040522/tkuim_project/blob/master/windows/runner/win32_window.cpp"

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_plan,node_daily,node_rehab,node_history,node_stats,node_patient_home toneBlue
class node_patient_mgmt,node_custom toneAmber
class node_account,node_chat,node_call,node_notify,node_therapist toneMint
class node_pose_infer,node_pose_measure toneRose
class node_body_features,node_body_dataset,node_body_models,node_body_split,node_body_training,node_body_parity,node_body_synthetic,node_train_body,node_hand_features,node_feature_schema,node_train_hand,node_artifacts,node_patient,node_backend,node_camera,node_onnx toneIndigo
class node_win_entry,node_flutter_window,node_win_window toneTeal
```

## Components

### Patient rehabilitation

- [Rehab plans](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/plan): `lib/features/plan`
- [Daily training](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/training): `lib/features/training`
- [Rehab exercises](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/rehab): `lib/features/rehab`
- [Training history](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/history): `lib/features/history`
- [Training statistics](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/stats): `lib/features/stats`
- [Patient home](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/home): `lib/features/home`

### Therapist tools

- [Patient management](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/friends): `lib/features/friends`
- [Custom exercises](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/custom_exercise): `lib/features/custom_exercise`

### Communication and account

- [Account and profile](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/account): `lib/features/account`
- [Chat](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/chat): `lib/features/chat`
- [Video calls](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/call): `lib/features/call`
- [Notifications](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/notification): `lib/features/notification`

### On-device pose

- [Pose inference](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/analysis): `lib/features/analysis`
- [Pose measurement](https://github.com/yang20040522/tkuim_project/tree/master/lib/features/pose_measurement): `lib/features/pose_measurement`

### ML research pipeline

- [Body features](https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/features.py): `ml/body_v3/features.py`
- [Body dataset](https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/dataset.py): `ml/body_v3/dataset.py`
- [Body models](https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/models.py): `ml/body_v3/models.py`
- [Body split](https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/split.py): `ml/body_v3/split.py`
- [Body training](https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/training.py): `ml/body_v3/training.py`
- [Body parity](https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/parity.py): `ml/body_v3/parity.py`
- [Synthetic samples](https://github.com/yang20040522/tkuim_project/blob/master/ml/body_v3/synthetic.py): `ml/body_v3/synthetic.py`
- [Body train entry](https://github.com/yang20040522/tkuim_project/blob/master/ml/train_body.py): `ml/train_body.py`
- [Hand features](https://github.com/yang20040522/tkuim_project/blob/master/ml/hand_features.py): `ml/hand_features.py`
- [Feature schema](https://github.com/yang20040522/tkuim_project/blob/master/ml/feature_schema.py): `ml/feature_schema.py`
- [Hand model training](https://github.com/yang20040522/tkuim_project/blob/master/ml/train.py): `ml/train.py`
- [Model artifacts](https://github.com/yang20040522/tkuim_project/blob/master/ml/model_artifacts.py): `ml/model_artifacts.py`

### Desktop application shell

- [Windows entry](https://github.com/yang20040522/tkuim_project/blob/master/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Flutter window](https://github.com/yang20040522/tkuim_project/blob/master/windows/runner/flutter_window.cpp): `windows/runner/flutter_window.cpp`
- [Win32 window](https://github.com/yang20040522/tkuim_project/blob/master/windows/runner/win32_window.cpp): `windows/runner/win32_window.cpp`

### Other components

- **Patient**
- **Therapist**
- **REST backend**
- **Phone camera**
- **ONNX Runtime**

## Connections

- Patient → Rehab plans: views
- Rehab plans → Daily training: guides
- Patient → Daily training: performs
- Daily training → Pose inference: analyzes with
- Pose inference → Phone camera: reads frames
- Pose inference → ONNX Runtime: runs models
- Daily training → Pose measurement: judges movement
- Daily training → Training history: records sessions
- Patient → Training history: reviews
- Patient → Training statistics: reviews
- Patient → Patient home: opens
- Therapist → Patient management: manages patients
- Therapist → Rehab plans: arranges plans
- Therapist → Custom exercises: edits exercises
- Custom exercises → Rehab plans: provides exercises
- Patient → Account and profile: manages profile
- Patient → Chat: chats with therapist
- Therapist → Chat: chats with patient
- Patient → Video calls: starts calls
- Therapist → Video calls: starts calls
- Patient → Notifications: receives alerts
- Account and profile → REST backend: exchanges account data
- Patient management → REST backend: exchanges patient data
- Rehab plans → REST backend: exchanges plan data
- Chat → REST backend: exchanges messages
- Body dataset → Body features: extracts features (evidence: `ml/body_v3/dataset.py`)
- Body parity → Body features: checks parity (evidence: `ml/body_v3/parity.py`)
- Synthetic samples → Body features: builds samples (evidence: `ml/body_v3/synthetic.py`)
- Body split → Body features: uses schema (evidence: `ml/body_v3/split.py`)
- Body training → Body features: uses features (evidence: `ml/body_v3/training.py`)
- Body training → Body models: uses models (evidence: `ml/body_v3/training.py`)
- Body training → Body split: splits data (evidence: `ml/body_v3/training.py`)
- Body training → Body dataset: consumes data (evidence: `ml/body_v3/training.py`)
- Body train entry → Body training: runs training (evidence: `ml/train_body.py`)
- Body train entry → Body dataset: loads dataset (evidence: `ml/train_body.py`)
- Body train entry → Body parity: checks parity (evidence: `ml/train_body.py`)
- Body train entry → Synthetic samples: generates samples (evidence: `ml/train_body.py`)
- Feature schema → Hand features: uses features (evidence: `ml/feature_schema.py`)
- Hand model training → Feature schema: builds feature rows (evidence: `ml/train.py`)
- Hand model training → Model artifacts: trains artifacts (evidence: `ml/train.py`)
- Windows entry → Flutter window: creates window (evidence: `windows/runner/main.cpp`)
- Flutter window → Win32 window: extends window
