# nagy-dani/szakdolgozat architecture

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

- Interactive diagram: https://gitdiagram.com/nagy-dani/szakdolgozat
- Repository: https://github.com/nagy-dani/szakdolgozat

## Overview

1. This repository is a desktop application for bicycle fit analysis, likely built as a GUI app rather than a web service. The top-level structure is organized around a classic UI → controller → service → model flow.

2. `main.py` is the application entrypoint, with `start.sh` as the convenience launcher. The presence of `assets/styles/app.qss` and `views/widgets` suggests a Qt-style desktop UI with custom styling and reusable widgets.

3. The `views/` package is the presentation layer. It contains the main window plus workflow screens for welcome, rider input, bike input, video capture, analysis, results, and help, which implies a multi-step user journey.

4. The `controllers/` package is the orchestration layer. Controllers exist for the app shell, rider, bike, video, pose, and analysis, indicating that UI events are handled separately from business logic and data processing.

5. The `models/` package holds the core domain objects: rider, bike, pose, analysis, and recommendation. These are the data structures passed between the UI, analysis logic, and persistence/export features.

6. The `services/` package contains the main computation pipeline. `video_service` and `pose_service` handle media and pose extraction, `angle_calculator` and `com_calculator` derive biomechanics measures, and `fit_rules_engine` converts those measurements into fit judgments and recommendations.

7. Configuration is externalized in `config/angle_ranges.json`, which likely defines acceptable angle thresholds used by the fit rules engine. This is an important boundary because it separates adjustable domain rules from code.

8. Persistence and reporting are supported as separate services: `persistence_service` for saving/loading analysis-related state, and `pdf_export_service` for producing a shareable output. That means the app is not just interactive; it also produces durable artifacts.

9. The data flow is: user inputs rider and bike parameters, a video is selected or captured, pose data is analyzed, angles and center-of-mass metrics are computed, the fit rules engine evaluates them against configured ranges, and the results view presents recommendations.

10. `views/widgets/` holds reusable UI building blocks such as an angle gauge, measurement input, and video player. These widgets likely encapsulate visualizations and input controls used across multiple screens.

11. The `tests/` directory focuses on core non-UI logic: angle calculation, fit rules, persistence, rider model, and analysis model. That suggests the computational and data layers are the primary stability boundary, while the UI is thinner and more workflow-oriented.

12. The `videos/` directory contains sample media inputs, which indicates the application can analyze prerecorded bike-riding footage as part of its workflow. That makes local file handling a first-class part of the architecture, not just an optional feature.

13. Overall, the architecture is a layered desktop analytics tool: GUI screens and widgets collect inputs, controllers coordinate workflow, services perform biomechanical analysis and export/persistence, and models carry the structured results. The main diagram should emphasize the separation between UI, analysis logic, and external artifacts like video files, config JSON, and exported PDFs.

Main entry points: [`myBikeFit/controllers/analysis_controller.py`](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/controllers/analysis_controller.py) (Analysis controller), [`myBikeFit/views/main_window.py`](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/main_window.py) (Main window), [`myBikeFit/views/widgets`](https://github.com/nagy-dani/szakdolgozat/tree/main/myBikeFit/views/widgets) (Widgets), [`myBikeFit/controllers/rider_controller.py`](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/controllers/rider_controller.py) (Input controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_start_sh["Launcher<br/>shell script<br/>[start.sh]"]
  node_main_py["App entry<br/>python entrypoint<br/>[main.py]"]
end

subgraph group_presentation["Presentation"]
  node_main_window["Main window<br/>qt window<br/>[main_window.py]"]
  node_welcome_view["Welcome<br/>workflow view<br/>[welcome_view.py]"]
  node_rider_view["Rider input<br/>workflow view"]
  node_bike_view["Bike input<br/>workflow view<br/>[bike_input_view.py]"]
  node_video_view["Video capture<br/>workflow view"]
  node_analysis_view["Analysis view<br/>workflow view<br/>[analysis_view.py]"]
  node_results_view["Results<br/>workflow view<br/>[results_view.py]"]
  node_help_dialog["Help<br/>dialog<br/>[help_dialog.py]"]
  node_widgets["Widgets<br/>ui components"]
end

subgraph group_orchestration["Controllers"]
  node_app_controller["App controller<br/>workflow controller<br/>[app_controller.py]"]
  node_input_controllers["Input controllers<br/>workflow controllers"]
  node_analysis_controller["Analysis controller<br/>workflow controller"]
end

subgraph group_domain["Domain"]
  node_rider_model["Rider<br/>domain model<br/>[rider_model.py]"]
  node_bike_model["Bike<br/>domain model<br/>[bike_model.py]"]
  node_pose_model["Pose<br/>domain model<br/>[pose_model.py]"]
  node_analysis_model["Analysis<br/>domain model<br/>[analysis_model.py]"]
  node_recommendation_model["Recommendation<br/>domain model"]
  node_video_service["Video service<br/>media service<br/>[video_service.py]"]
  node_pose_service["Pose service<br/>analysis service<br/>[pose_service.py]"]
  node_metrics_pipeline["Metrics<br/>calculation pipeline"]
  node_fit_rules_engine["Rules engine<br/>decision engine"]
  node_persistence_service[("Persistence<br/>storage service")]
  node_pdf_export_service["PDF export<br/>report service"]
end

subgraph group_artifacts["Artifacts"]
  node_angle_ranges["Angle ranges<br/>config json<br/>[angle_ranges.json]"]
  node_style_sheet["App style<br/>qt stylesheet<br/>[app.qss]"]
  node_sample_videos["Sample videos<br/>media assets"]
end

node_start_sh -->|"launches"| node_main_py
node_main_py -->|"creates"| node_main_window
node_main_py -->|"wires"| node_app_controller
node_main_window -->|"hosts"| node_welcome_view
node_main_window -->|"hosts"| node_rider_view
node_main_window -->|"hosts"| node_bike_view
node_main_window -->|"hosts"| node_video_view
node_main_window -->|"hosts"| node_analysis_view
node_main_window -->|"hosts"| node_results_view
node_main_window -->|"opens"| node_help_dialog
node_welcome_view -->|"uses"| node_widgets
node_rider_view -->|"uses"| node_widgets
node_bike_view -->|"uses"| node_widgets
node_video_view -->|"uses"| node_widgets
node_analysis_view -->|"uses"| node_widgets
node_results_view -->|"uses"| node_widgets
node_app_controller -->|"coordinates"| node_input_controllers
node_app_controller -->|"coordinates"| node_analysis_controller
node_input_controllers -->|"updates"| node_rider_model
node_input_controllers -->|"updates"| node_bike_model
node_input_controllers -->|"requests"| node_video_service
node_input_controllers -->|"requests"| node_pose_service
node_analysis_controller -->|"builds"| node_pose_model
node_analysis_controller -->|"builds"| node_analysis_model
node_analysis_controller -->|"builds"| node_recommendation_model
node_analysis_controller -->|"uses"| node_video_service
node_analysis_controller -->|"uses"| node_pose_service
node_analysis_controller -->|"uses"| node_metrics_pipeline
node_analysis_controller -->|"uses"| node_fit_rules_engine
node_fit_rules_engine -->|"reads"| node_angle_ranges
node_metrics_pipeline -->|"references"| node_angle_ranges
node_analysis_controller -->|"persists"| node_persistence_service
node_analysis_controller -->|"exports"| node_pdf_export_service
node_main_window -->|"styles"| node_style_sheet
node_video_service -->|"loads"| node_sample_videos

click node_start_sh "https://github.com/nagy-dani/szakdolgozat/blob/main/start.sh"
click node_main_py "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/main.py"
click node_main_window "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/main_window.py"
click node_welcome_view "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/welcome_view.py"
click node_rider_view "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/rider_input_view.py"
click node_bike_view "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/bike_input_view.py"
click node_video_view "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/video_capture_view.py"
click node_analysis_view "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/analysis_view.py"
click node_results_view "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/results_view.py"
click node_help_dialog "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/help_dialog.py"
click node_widgets "https://github.com/nagy-dani/szakdolgozat/tree/main/myBikeFit/views/widgets"
click node_app_controller "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/controllers/app_controller.py"
click node_input_controllers "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/controllers/rider_controller.py"
click node_analysis_controller "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/controllers/analysis_controller.py"
click node_rider_model "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/models/rider_model.py"
click node_bike_model "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/models/bike_model.py"
click node_pose_model "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/models/pose_model.py"
click node_analysis_model "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/models/analysis_model.py"
click node_recommendation_model "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/models/recommendation_model.py"
click node_video_service "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/video_service.py"
click node_pose_service "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/pose_service.py"
click node_metrics_pipeline "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/angle_calculator.py"
click node_fit_rules_engine "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/fit_rules_engine.py"
click node_persistence_service "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/persistence_service.py"
click node_pdf_export_service "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/pdf_export_service.py"
click node_angle_ranges "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/config/angle_ranges.json"
click node_style_sheet "https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/assets/styles/app.qss"
click node_sample_videos "https://github.com/nagy-dani/szakdolgozat/tree/main/videos"

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_start_sh,node_main_py toneBlue
class node_main_window,node_welcome_view,node_rider_view,node_bike_view,node_video_view,node_analysis_view,node_results_view,node_help_dialog,node_widgets toneAmber
class node_app_controller,node_input_controllers,node_analysis_controller toneMint
class node_rider_model,node_bike_model,node_pose_model,node_analysis_model,node_recommendation_model,node_video_service,node_pose_service,node_metrics_pipeline,node_fit_rules_engine,node_persistence_service,node_pdf_export_service toneRose
class node_angle_ranges,node_style_sheet,node_sample_videos toneIndigo
```

## Components

### Runtime

Application entrypoints and execution bootstrap.

- [Launcher](https://github.com/nagy-dani/szakdolgozat/blob/main/start.sh): shell script · Convenience script to start the desktop app. · `start.sh`
- [App entry](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/main.py): python entrypoint · Bootstraps the desktop application. · `myBikeFit/main.py`

### Presentation

Qt views and reusable widgets.

- [Main window](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/main_window.py): qt window · Primary application shell and navigation host. · `myBikeFit/views/main_window.py`
- [Welcome](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/welcome_view.py): workflow view · Initial landing screen for the fit workflow. · `myBikeFit/views/welcome_view.py`
- [Rider input](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/rider_input_view.py): workflow view · Collects rider measurements and settings. · `myBikeFit/views/rider_input_view.py`
- [Bike input](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/bike_input_view.py): workflow view · Collects bicycle geometry and setup data. · `myBikeFit/views/bike_input_view.py`
- [Video capture](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/video_capture_view.py): workflow view · Handles selecting or recording riding video. · `myBikeFit/views/video_capture_view.py`
- [Analysis view](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/analysis_view.py): workflow view · Shows pose and fit analysis progress. · `myBikeFit/views/analysis_view.py`
- [Results](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/results_view.py): workflow view · Presents fit findings and recommendations. · `myBikeFit/views/results_view.py`
- [Help](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/views/help_dialog.py): dialog · Supplementary user guidance. · `myBikeFit/views/help_dialog.py`
- [Widgets](https://github.com/nagy-dani/szakdolgozat/tree/main/myBikeFit/views/widgets): ui components · Reusable visual controls used across views. · `myBikeFit/views/widgets`

### Controllers

Workflow coordination between UI and services.

- [App controller](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/controllers/app_controller.py): workflow controller · Coordinates app shell navigation and state. · `myBikeFit/controllers/app_controller.py`
- [Input controllers](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/controllers/rider_controller.py): workflow controllers · Handles rider, bike, video, and pose user actions. · `myBikeFit/controllers/rider_controller.py`
- [Analysis controller](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/controllers/analysis_controller.py): workflow controller · Coordinates pose analysis and result generation. · `myBikeFit/controllers/analysis_controller.py`

### Domain

Core data models and analysis computation.

- [Rider](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/models/rider_model.py): domain model · Rider measurements and attributes. · `myBikeFit/models/rider_model.py`
- [Bike](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/models/bike_model.py): domain model · Bicycle geometry and setup data. · `myBikeFit/models/bike_model.py`
- [Pose](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/models/pose_model.py): domain model · Captured body pose representation. · `myBikeFit/models/pose_model.py`
- [Analysis](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/models/analysis_model.py): domain model · Aggregated fit analysis state and outputs. · `myBikeFit/models/analysis_model.py`
- [Recommendation](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/models/recommendation_model.py): domain model · Fit adjustment suggestion and rationale. · `myBikeFit/models/recommendation_model.py`
- [Video service](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/video_service.py): media service · Loads and manages riding footage. · `myBikeFit/services/video_service.py`
- [Pose service](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/pose_service.py): analysis service · Extracts pose data from video frames. · `myBikeFit/services/pose_service.py`
- [Metrics](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/angle_calculator.py): calculation pipeline · Computes angles and center-of-mass measures. · `myBikeFit/services/angle_calculator.py`
- [Rules engine](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/fit_rules_engine.py): decision engine · Evaluates measurements against fit thresholds. · `myBikeFit/services/fit_rules_engine.py`
- [Persistence](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/persistence_service.py): storage service · Saves and loads analysis-related state. · `myBikeFit/services/persistence_service.py`
- [PDF export](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/services/pdf_export_service.py): report service · Generates shareable analysis reports. · `myBikeFit/services/pdf_export_service.py`

### Artifacts

External inputs, configuration, and outputs.

- [Angle ranges](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/config/angle_ranges.json): config json · Thresholds used by the fit rules engine. · `myBikeFit/config/angle_ranges.json`
- [App style](https://github.com/nagy-dani/szakdolgozat/blob/main/myBikeFit/assets/styles/app.qss): qt stylesheet · Desktop UI styling for the application. · `myBikeFit/assets/styles/app.qss`
- [Sample videos](https://github.com/nagy-dani/szakdolgozat/tree/main/videos): media assets · Local video inputs used by the app workflow. · `videos`

## Connections

- Launcher → App entry: launches · Convenience script starts the application entrypoint.
- App entry → Main window: creates · Entrypoint initializes the main UI shell.
- App entry → App controller: wires · Bootstraps the top-level controller.
- Main window → Welcome: hosts · Main shell contains the workflow screens.
- Main window → Rider input: hosts · Main shell contains the workflow screens.
- Main window → Bike input: hosts · Main shell contains the workflow screens.
- Main window → Video capture: hosts · Main shell contains the workflow screens.
- Main window → Analysis view: hosts · Main shell contains the workflow screens.
- Main window → Results: hosts · Main shell contains the workflow screens.
- Main window → Help: opens · Auxiliary help is presented from the main window.
- Welcome → Widgets: uses · Views share reusable input and display widgets.
- Rider input → Widgets: uses · Views share reusable input and display widgets.
- Bike input → Widgets: uses · Views share reusable input and display widgets.
- Video capture → Widgets: uses · Views share reusable input and display widgets.
- Analysis view → Widgets: uses · Views share reusable input and display widgets.
- Results → Widgets: uses · Views share reusable input and display widgets.
- App controller → Input controllers: coordinates · Top-level workflow delegates user input handling.
- App controller → Analysis controller: coordinates · Top-level workflow delegates analysis orchestration.
- Input controllers → Rider: updates · Controllers populate domain objects from the UI.
- Input controllers → Bike: updates · Controllers populate domain objects from the UI.
- Input controllers → Video service: requests · Controllers hand off media handling to services.
- Input controllers → Pose service: requests · Controllers hand off pose extraction to services.
- Analysis controller → Pose: builds · Analysis flow produces pose data structures.
- Analysis controller → Analysis: builds · Analysis flow assembles the final analysis object.
- Analysis controller → Recommendation: builds · Analysis flow creates recommendation outputs.
- Analysis controller → Video service: uses · Analysis consumes selected footage.
- Analysis controller → Pose service: uses · Analysis derives pose information from video.
- Analysis controller → Metrics: uses · Analysis computes biomechanical metrics.
- Analysis controller → Rules engine: uses · Analysis turns measurements into fit judgments.
- Rules engine → Angle ranges: reads · Decision thresholds are externalized in config.
- Metrics → Angle ranges: references · Calculation and evaluation share configured ranges.
- Analysis controller → Persistence: persists · Analysis state can be saved and restored.
- Analysis controller → PDF export: exports · Results can be turned into a shareable report.
- Main window → App style: styles · Application shell is themed by the stylesheet.
- Video service → Sample videos: loads · Service works with local video inputs.
