# fatma-404/repflow architecture

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

- Interactive diagram: https://gitdiagram.com/fatma-404/repflow
- Repository: https://github.com/fatma-404/repflow

## Overview

RepFlow is a Flet MVP for side-view push-up coaching. Its documented user flow is welcome → camera/setup and rep goal → live spotting → set summary. The sampled runtime modules provide pose inference, rep counting, form analysis, and cue throttling, but the excerpts do not show main.py wiring those modules together or performing camera capture/audio playback. The graph therefore preserves documented screens and runtime capabilities without asserting uncertain connections.

Main entry points: [`pose_engine.py`](https://github.com/fatma-404/repflow/blob/main/pose_engine.py) (Pose estimation), [`main.py`](https://github.com/fatma-404/repflow/blob/main/main.py) (Camera setup), [`form_analyzer.py`](https://github.com/fatma-404/repflow/blob/main/form_analyzer.py) (Form analysis), [`feedback.py`](https://github.com/fatma-404/repflow/blob/main/feedback.py) (Cue throttling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Workout app"]
  node_welcome["Welcome screen<br/>[main.py]"]
  node_setup["Camera setup<br/>[main.py]"]
  node_live["Live workout HUD<br/>[main.py]"]
  node_summary["Set summary<br/>[main.py]"]
  node_session["Session state<br/>[main.py]"]
end

subgraph group_analysis["Movement analysis"]
  node_pose["Pose estimation<br/>[pose_engine.py]"]
  node_model["MoveNet model"]
  node_counter["Rep counter<br/>[rep_counter.py]"]
  node_form["Form analysis<br/>[form_analyzer.py]"]
end

subgraph group_coaching["Coaching logic"]
  node_feedback["Cue throttling<br/>[feedback.py]"]
end

node_user(("Athlete"))
node_camera(("Camera frames"))
node_audio(("Audio output"))

node_user -->|"opens app"| node_welcome
node_welcome -->|"starts workout"| node_setup
node_setup -->|"sets rep goal"| node_session
node_setup -->|"continues"| node_live
node_live -->|"shows session"| node_session
node_session -->|"summarizes state"| node_summary
node_camera -.->|"supplies frames"| node_pose
node_pose -->|"runs inference"| node_model
node_pose -.->|"keypoints input"| node_counter
node_pose -.->|"keypoints input"| node_form
node_form -.->|"cue text"| node_feedback
node_feedback -.->|"dispatch hook"| node_audio

click node_welcome "https://github.com/fatma-404/repflow/blob/main/main.py"
click node_setup "https://github.com/fatma-404/repflow/blob/main/main.py"
click node_live "https://github.com/fatma-404/repflow/blob/main/main.py"
click node_summary "https://github.com/fatma-404/repflow/blob/main/main.py"
click node_session "https://github.com/fatma-404/repflow/blob/main/main.py"
click node_pose "https://github.com/fatma-404/repflow/blob/main/pose_engine.py"
click node_model "https://github.com/fatma-404/repflow/blob/main/models/movenet_lightning.tflite"
click node_counter "https://github.com/fatma-404/repflow/blob/main/rep_counter.py"
click node_form "https://github.com/fatma-404/repflow/blob/main/form_analyzer.py"
click node_feedback "https://github.com/fatma-404/repflow/blob/main/feedback.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_welcome,node_setup,node_live,node_summary,node_session toneBlue
class node_pose,node_model,node_counter,node_form toneAmber
class node_feedback toneMint
class node_user,node_camera,node_audio toneIndigo
```

## Components

### Workout app

- [Welcome screen](https://github.com/fatma-404/repflow/blob/main/main.py): `main.py`
- [Camera setup](https://github.com/fatma-404/repflow/blob/main/main.py): `main.py`
- [Live workout HUD](https://github.com/fatma-404/repflow/blob/main/main.py): `main.py`
- [Set summary](https://github.com/fatma-404/repflow/blob/main/main.py): `main.py`
- [Session state](https://github.com/fatma-404/repflow/blob/main/main.py): `main.py`

### Movement analysis

- [Pose estimation](https://github.com/fatma-404/repflow/blob/main/pose_engine.py): `pose_engine.py`
- [MoveNet model](https://github.com/fatma-404/repflow/blob/main/models/movenet_lightning.tflite): `models/movenet_lightning.tflite`
- [Rep counter](https://github.com/fatma-404/repflow/blob/main/rep_counter.py): `rep_counter.py`
- [Form analysis](https://github.com/fatma-404/repflow/blob/main/form_analyzer.py): `form_analyzer.py`

### Coaching logic

- [Cue throttling](https://github.com/fatma-404/repflow/blob/main/feedback.py): `feedback.py`

### Other components

- **Athlete**
- **Camera frames**
- **Audio output**

## Connections

- Athlete → Welcome screen: opens app
- Welcome screen → Camera setup: starts workout
- Camera setup → Session state: sets rep goal
- Camera setup → Live workout HUD: continues
- Live workout HUD → Session state: shows session
- Session state → Set summary: summarizes state
- Camera frames → Pose estimation: supplies frames
- Pose estimation → MoveNet model: runs inference
- Pose estimation → Rep counter: keypoints input
- Pose estimation → Form analysis: keypoints input
- Form analysis → Cue throttling: cue text
- Cue throttling → Audio output: dispatch hook
