# mea-lab/visionmd-desktopapp-backend architecture

> Architecture diagram of the GitHub repository mea-lab/visionmd-desktopapp-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mea-lab/visionmd-desktopapp-backend
- Repository: https://github.com/mea-lab/visionmd-desktopapp-backend

## Overview

VisionMD is an archived Django backend for a desktop video-analysis application. The principal workflow is a frontend submitting a video, then selecting an examination task and receiving movement landmarks, signals, gait events, and measurements for visualization or editing. The tree documents task families and API capabilities beyond the sampled excerpts; those are represented at their enclosing directories, with links omitted where call ownership is not established. The sampled gait and upload code supports the main workflow, but does not establish every route’s wiring.

Main entry points: [`app/urls.py`](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/urls.py) (Django routes), [`app/views/create_task_views.py`](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/views/create_task_views.py) (Task endpoints), [`app/analysis/tasks/gait.py`](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/tasks/gait.py) (Gait examination), [`app/views/upload_video.py`](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/views/upload_video.py) (Video upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and video"]
  node_routes["Django routes<br/>[urls.py]"]
  node_upload["Video upload<br/>[upload_video.py]"]
  node_videoapi["Video operations"]
  node_taskapi["Task endpoints"]
  node_plots["Plot updates"]
  node_clientdata["Video and landmarks API"]
  node_django["Django backend<br/>[urls.py]"]
end

subgraph group_tasks["Examination tasks"]
  node_taskbase["Task base<br/>[base_task.py]"]
  node_gaittask["Gait examination<br/>[gait.py]"]
  node_handtasks["Hand examinations"]
  node_legtasks["Leg examinations"]
end

subgraph group_analysis["Movement analysis"]
  node_detectors["Pose detectors"]
  node_yolo["Person tracking<br/>[yolo_detectors.py]"]
  node_gaitmodel["Gait phase model"]
  node_gaitanalyzer["Gait signal analysis"]
  node_peak["Peak analysis"]
end

subgraph group_state["Project data"]
  node_media[("Video files")]
end

node_frontend(("Desktop frontend"))

node_frontend -->|"sends requests"| node_django
node_django -->|"dispatches"| node_routes
node_routes -->|"routes upload"| node_upload
node_routes -->|"routes video requests"| node_videoapi
node_routes -->|"routes task requests"| node_taskapi
node_routes -->|"routes plot updates"| node_plots
node_upload -->|"stores video"| node_media
node_videoapi -->|"reads and updates"| node_media
node_taskapi -->|"creates tasks"| node_taskbase
node_taskbase -->|"reads video"| node_media
node_taskapi -->|"dispatches gait"| node_gaittask
node_gaittask -->|"uses pose detection"| node_detectors
node_gaittask -->|"loads phase model"| node_gaitmodel
node_gaittask -->|"analyzes gait"| node_gaitanalyzer
node_gaitanalyzer -->|"infers phases"| node_gaitmodel
node_taskapi -->|"dispatches hand tasks"| node_handtasks
node_taskapi -->|"dispatches leg tasks"| node_legtasks
node_plots -->|"returns plot data"| node_frontend
node_clientdata -->|"reads or updates"| node_media
node_frontend -->|"requests project data"| node_clientdata

click node_routes "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/urls.py"
click node_upload "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/views/upload_video.py"
click node_videoapi "https://github.com/mea-lab/visionmd-desktopapp-backend/tree/main/app/views"
click node_taskapi "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/views/create_task_views.py"
click node_taskbase "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/tasks/base_task.py"
click node_gaittask "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/tasks/gait.py"
click node_handtasks "https://github.com/mea-lab/visionmd-desktopapp-backend/tree/main/app/analysis/tasks"
click node_legtasks "https://github.com/mea-lab/visionmd-desktopapp-backend/tree/main/app/analysis/tasks"
click node_detectors "https://github.com/mea-lab/visionmd-desktopapp-backend/tree/main/app/analysis/detectors"
click node_yolo "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/detectors/yolo_detectors.py"
click node_gaitmodel "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/models/gait_transformer/gait_phase_transformer_old.py"
click node_gaitanalyzer "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/signal_analyzers/gait_signal_analyzer.py"
click node_peak "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/signal_analyzers/peakfinder_signal_analyzer.py"
click node_plots "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/views/update_plot_data.py"
click node_clientdata "https://github.com/mea-lab/visionmd-desktopapp-backend/tree/main/app/views"
click node_django "https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/VideoAnalysisToolBackend/urls.py"

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_routes,node_upload,node_videoapi,node_taskapi,node_plots,node_clientdata,node_django,node_frontend toneBlue
class node_taskbase,node_gaittask,node_handtasks,node_legtasks toneAmber
class node_detectors,node_yolo,node_gaitmodel,node_gaitanalyzer,node_peak toneMint
class node_media toneRose
```

## Components

### API and video

- [Django routes](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/urls.py): `app/urls.py`
- [Video upload](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/views/upload_video.py): `app/views/upload_video.py`
- [Video operations](https://github.com/mea-lab/visionmd-desktopapp-backend/tree/main/app/views): `app/views`
- [Task endpoints](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/views/create_task_views.py): `app/views/create_task_views.py`
- [Plot updates](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/views/update_plot_data.py): `app/views/update_plot_data.py`
- [Video and landmarks API](https://github.com/mea-lab/visionmd-desktopapp-backend/tree/main/app/views): `app/views`
- [Django backend](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/VideoAnalysisToolBackend/urls.py): `VideoAnalysisToolBackend/urls.py`

### Examination tasks

- [Task base](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/tasks/base_task.py): `app/analysis/tasks/base_task.py`
- [Gait examination](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/tasks/gait.py): `app/analysis/tasks/gait.py`
- [Hand examinations](https://github.com/mea-lab/visionmd-desktopapp-backend/tree/main/app/analysis/tasks): `app/analysis/tasks`
- [Leg examinations](https://github.com/mea-lab/visionmd-desktopapp-backend/tree/main/app/analysis/tasks): `app/analysis/tasks`

### Movement analysis

- [Pose detectors](https://github.com/mea-lab/visionmd-desktopapp-backend/tree/main/app/analysis/detectors): `app/analysis/detectors`
- [Person tracking](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/detectors/yolo_detectors.py): `app/analysis/detectors/yolo_detectors.py`
- [Gait phase model](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/models/gait_transformer/gait_phase_transformer_old.py): `app/analysis/models/gait_transformer/gait_phase_transformer_old.py`
- [Gait signal analysis](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/signal_analyzers/gait_signal_analyzer.py): `app/analysis/signal_analyzers/gait_signal_analyzer.py`
- [Peak analysis](https://github.com/mea-lab/visionmd-desktopapp-backend/blob/main/app/analysis/signal_analyzers/peakfinder_signal_analyzer.py): `app/analysis/signal_analyzers/peakfinder_signal_analyzer.py`

### Project data

- **Video files**

### Other components

- **Desktop frontend**

## Connections

- Desktop frontend → Django backend: sends requests
- Django backend → Django routes: dispatches
- Django routes → Video upload: routes upload
- Django routes → Video operations: routes video requests
- Django routes → Task endpoints: routes task requests
- Django routes → Plot updates: routes plot updates
- Video upload → Video files: stores video
- Video operations → Video files: reads and updates
- Task endpoints → Task base: creates tasks
- Task base → Video files: reads video
- Task endpoints → Gait examination: dispatches gait
- Gait examination → Pose detectors: uses pose detection
- Gait examination → Gait phase model: loads phase model
- Gait examination → Gait signal analysis: analyzes gait
- Gait signal analysis → Gait phase model: infers phases
- Task endpoints → Hand examinations: dispatches hand tasks
- Task endpoints → Leg examinations: dispatches leg tasks
- Plot updates → Desktop frontend: returns plot data
- Video and landmarks API → Video files: reads or updates
- Desktop frontend → Video and landmarks API: requests project data
