# devanandukkt/ai_powered_fitness_coach architecture

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

- Interactive diagram: https://gitdiagram.com/devanandukkt/ai_powered_fitness_coach
- Repository: https://github.com/devanandukkt/ai_powered_fitness_coach

## Overview

AI_Fit is a Django fitness application for account/profile management and webcam-based exercise tracking. Users register or sign in, choose push-ups, sit-ups, or squats, stream frames through a session, receive rep/form feedback, and save workout metrics for dashboard summaries. Views coordinate the workflow and persist profile/workout records; detector classes handle pose analysis. The URL, view, detector, form, and model excerpts support the principal links. Other account actions and UI capabilities are visible in routes/tree but their detailed implementation is only partly sampled.

Main entry points: [`myapp/views.py`](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/views.py) (Request Views), [`myapp/urls.py`](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/urls.py) (Web Routes), [`myapp/exercise_model/detectors.py`](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/exercise_model/detectors.py) (Pose and Rep Analysis), [`myapp/models.py`](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/models.py) (Profile Records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts and Profiles"]
  node_routing["Web Routes<br/>[urls.py]"]
  node_views["Request Views<br/>[views.py]"]
  node_forms["Account Forms<br/>[forms.py]"]
  node_account_pages["Account Pages"]
end

subgraph group_workout["Workout Tracking"]
  node_dashboard["Workout Dashboard<br/>[home.html]"]
  node_exercise_page["Exercise Page<br/>[exercise.html]"]
  node_session_control["Session Control<br/>[views.py]"]
  node_frame_processing["Frame Processing<br/>[views.py]"]
  node_detector_factory["Detector Factory<br/>[detectors.py]"]
  node_pose_analysis["Pose and Rep Analysis<br/>[detectors.py]"]
  node_pose_model["Pose Model Asset"]
  node_recordings["Session Recordings"]
end

subgraph group_persistence["Application Data"]
  node_profile_data[("Profile Records<br/>[models.py]")]
  node_workout_data[("Workout Records<br/>[models.py]")]
  node_sqlite[("SQLite Database<br/>[db.sqlite3]")]
end

node_visitor(("User"))
node_email_service["SMTP Email"]

node_visitor -->|"requests pages"| node_routing
node_routing -->|"routes requests"| node_views
node_views -->|"validates input"| node_forms
node_views -.->|"renders pages"| node_account_pages
node_views -->|"renders summary"| node_dashboard
node_views -.->|"renders exercise"| node_exercise_page
node_views -->|"starts session"| node_session_control
node_session_control -->|"selects detector"| node_detector_factory
node_frame_processing -->|"processes frames"| node_pose_analysis
node_pose_analysis -->|"loads pose asset"| node_pose_model
node_frame_processing -->|"writes recording"| node_recordings
node_views -->|"updates profile"| node_profile_data
node_views -->|"saves and summarizes"| node_workout_data
node_profile_data -.->|"persists"| node_sqlite
node_workout_data -.->|"persists"| node_sqlite
node_views -->|"sends reset email"| node_email_service

click node_routing "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/urls.py"
click node_views "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/views.py"
click node_forms "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/forms.py"
click node_account_pages "https://github.com/devanandukkt/ai_powered_fitness_coach/tree/main/myapp/templates/accounts"
click node_dashboard "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/templates/accounts/home.html"
click node_exercise_page "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/templates/accounts/exercise.html"
click node_session_control "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/views.py"
click node_frame_processing "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/views.py"
click node_detector_factory "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/exercise_model/detectors.py"
click node_pose_analysis "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/exercise_model/detectors.py"
click node_pose_model "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/pose_landmarker_lite.task"
click node_recordings "https://github.com/devanandukkt/ai_powered_fitness_coach/tree/main/static/recordings"
click node_profile_data "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/models.py"
click node_workout_data "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/models.py"
click node_sqlite "https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/db.sqlite3"

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_routing,node_views,node_forms,node_account_pages,node_visitor toneBlue
class node_dashboard,node_exercise_page,node_session_control,node_frame_processing,node_detector_factory,node_pose_analysis,node_pose_model,node_recordings toneAmber
class node_profile_data,node_workout_data,node_sqlite toneMint
class node_email_service toneIndigo
```

## Components

### Accounts and Profiles

- [Web Routes](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/urls.py): `myapp/urls.py`
- [Request Views](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/views.py): `myapp/views.py`
- [Account Forms](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/forms.py): `myapp/forms.py`
- [Account Pages](https://github.com/devanandukkt/ai_powered_fitness_coach/tree/main/myapp/templates/accounts): `myapp/templates/accounts`

### Workout Tracking

- [Workout Dashboard](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/templates/accounts/home.html): `myapp/templates/accounts/home.html`
- [Exercise Page](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/templates/accounts/exercise.html): `myapp/templates/accounts/exercise.html`
- [Session Control](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/views.py): `myapp/views.py`
- [Frame Processing](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/views.py): `myapp/views.py`
- [Detector Factory](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/exercise_model/detectors.py): `myapp/exercise_model/detectors.py`
- [Pose and Rep Analysis](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/exercise_model/detectors.py): `myapp/exercise_model/detectors.py`
- [Pose Model Asset](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/pose_landmarker_lite.task): `myapp/pose_landmarker_lite.task`
- [Session Recordings](https://github.com/devanandukkt/ai_powered_fitness_coach/tree/main/static/recordings): `static/recordings`

### Application Data

- [Profile Records](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/models.py): `myapp/models.py`
- [Workout Records](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/myapp/models.py): `myapp/models.py`
- [SQLite Database](https://github.com/devanandukkt/ai_powered_fitness_coach/blob/main/db.sqlite3): `db.sqlite3`

### Other components

- **User**
- **SMTP Email**

## Connections

- User → Web Routes: requests pages (evidence: `myapp/urls.py`)
- Web Routes → Request Views: routes requests (evidence: `myapp/urls.py`)
- Request Views → Account Forms: validates input (evidence: `myapp/views.py`)
- Request Views → Account Pages: renders pages
- Request Views → Workout Dashboard: renders summary (evidence: `myapp/views.py`)
- Request Views → Exercise Page: renders exercise
- Request Views → Session Control: starts session (evidence: `myapp/urls.py`)
- Session Control → Detector Factory: selects detector (evidence: `myapp/views.py`)
- Frame Processing → Pose and Rep Analysis: processes frames (evidence: `myapp/views.py`)
- Pose and Rep Analysis → Pose Model Asset: loads pose asset (evidence: `myapp/exercise_model/detectors.py`)
- Frame Processing → Session Recordings: writes recording (evidence: `myapp/views.py`)
- Request Views → Profile Records: updates profile (evidence: `myapp/views.py`)
- Request Views → Workout Records: saves and summarizes (evidence: `myapp/views.py`)
- Profile Records → SQLite Database: persists
- Workout Records → SQLite Database: persists
- Request Views → SMTP Email: sends reset email
